tag:blogger.com,1999:blog-7225698277211840079.post4780712750146792626..comments2020-03-07T11:21:25.605-08:00Comments on bjorg: Why EQ Is Done In the Time DomainBjorn Rochehttp://www.blogger.com/profile/17072425815152893296noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-7225698277211840079.post-64109572624485016692013-12-31T08:20:07.393-08:002013-12-31T08:20:07.393-08:00You are right that I gloss over some facts to keep...You are right that I gloss over some facts to keep this more digestible for people who do not have a theoretical background. It's true, for example, that the time and frequency domains are two perspectives on the same thing. However, it's not so simple to say that since both time and frequency domains are two perspectives on the same thing we can use either one equally well, and that's what this post is about: implementation rather than theory. For example, one major problem with the frequency domain is causality: we need to know future samples in order to compute a complete frequency domain representation of the signal, and we need that in order to filter correctly. We don't have that problem in the time domain. In the true frequency domain, we need all the samples forever into the future and past, which is unfeasible for all but the shortest signals. This is why the first attempt described above breaks the audio into chunks. Strictly speaking, this is then the time-frequency domain, not the frequency domain. The time-frequency domain is the real-world compromise we must make if we wish to process long or real-time signals in the frequency domain and it is fraught with the problems I describe above. Of course, it can be done and there are many many applications for the time-frequency domain.<br /><br />As to the moving average filter, you are right that it is an FIR filter. I use it as a simple example of a time-domain filter, not as FIR or non-FIR. It happens to be FIR.Bjorn Rochehttps://www.blogger.com/profile/17072425815152893296noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-81728595161202190412013-12-29T23:52:06.998-08:002013-12-29T23:52:06.998-08:00I'm a little confused by what you've said ...I'm a little confused by what you've said here. You make it sound like frequency domain filters and time domain filters are two totally different things. You present moving time averages as though it's somehow completely different than a FIR filter, but it's actually just a specific FIR filter where all the taps are equally weighted. The time and frequency domains are just two perspectives on the same thing after all.Eric Shttps://www.blogger.com/profile/00197125558125984649noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-45201993628443763272013-03-18T07:57:29.541-07:002013-03-18T07:57:29.541-07:00My next post contains a tutorial on building basic...My next post contains a tutorial on building basic audio eqs: http://blog.bjornroche.com/2012/08/basic-audio-eqs.html I implement a bell filter, but using the linked "cookbook", you can easilly modify it to produce a bandstop filter.Bjorn Rochehttps://www.blogger.com/profile/17072425815152893296noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-67710499997522847742013-03-17T20:57:26.339-07:002013-03-17T20:57:26.339-07:00i was wondering how we can remove frequencies in b...i was wondering how we can remove frequencies in between, ie implement a band stop filter using your time domain filtering approach. Could you explain that point? Thanks!mathmaniachttps://www.blogger.com/profile/11104558752894872228noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-3001369396114703842012-10-01T14:12:28.685-07:002012-10-01T14:12:28.685-07:00There's more than one thing going on here: the...There's more than one thing going on here: the windows themselves create artefacts, and putting them back together does not always fix it, so it depends no only on the size of the window, but also the shape and overlap. Also, if the data is altered in the frequency domain, it may have moved in time as well. There may be even more going on -- I usually only deal with time domain filters :)<br /><br />I don't think it's correct to say that poor synthesis resolution is the culprit, however. In fact, if you ignore the issue of numerical error, no data is lost when you transform data from time to frequency domain or vice versa, so even if your windows are very small, all your data is still in tact.<br /><br />To put it another way, an EQ, even one built this way, isn't doing what I would call synthesis or re-synthesis. It might contain "analysis" and "synthesis" components, but it's not really taking apart a sound and reconstructing it using newly synthesized information the way, say, a vocoder is. It may be a matter of semantics, but mathematically, we are just changing the representation from the time domain to the Fourier domain, doing some manipulations, and converting back. The time domain and Fourier domain are equivalent in terms of the amount of information they carry, whereas re-synthesis methods generally reduce the amount of information durring the analysis stage.Bjorn Rochehttps://www.blogger.com/profile/17072425815152893296noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-15125060508734470782012-09-28T13:45:20.736-07:002012-09-28T13:45:20.736-07:00That's interesting. I'd always assumed th...That's interesting. I'd always assumed that the sound had more to do with resynthesizing the sound using too few sine-waves, i.e. poor resolution in frequency space that fails to adequately characterize noisy sounds - though, now that i think of it, the artifacts are most apparent in the higher frequencies where the partials are "closer together" (in log-space). <br /><br />But you say it's an artifact of overlapping windows? Is it some kind of unintended constructive interference? I can't quite imagine how overlapping windows would cause this sound. In my experience (in experimental music, where artifacts are sometimes desirable, especially smearing), very large windows (half a second or longer) make the problem go away, which would be explained if poor resolution were the culprit. If that's not the reason, then why do large windows make the problem go away?<br /><br />for fun: If you want to hear one example of how large windows can make neat, smeared sounds, check out paulstretch: http://hypermammut.sourceforge.net/paulstretch/ (plug in your favorite classical music for instant drones)flieshttps://www.blogger.com/profile/04438262506920089149noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-14689677338405328292012-09-28T09:59:09.323-07:002012-09-28T09:59:09.323-07:00This is an excellent point. The "weird" ...This is an excellent point. The "weird" and "jangly" sound you mention, sometimes described as "hallow" or "phasy", and reminiscent of early and low quality bitrate compression, is due to something I didn't get into: overlapping FFT windows, which, in this design, would be necessary to eliminate edge effects of the windows themselves. The smearing effect comes from this as well, but can also come from pre- (and post-) echo. This is an issue that comes up in pitch shifters as well, where an art has developed around compensating for these effects, but it is not perfect.Bjorn Rochehttps://www.blogger.com/profile/17072425815152893296noreply@blogger.comtag:blogger.com,1999:blog-7225698277211840079.post-81082998085133520392012-09-28T09:08:28.327-07:002012-09-28T09:08:28.327-07:00Great article. One additional reason not to use F...Great article. One additional reason not to use FFT for filtering is that, especially for short windows/low latency, the IFFT output sounds weird and jangly - even when no transformation is done to the FFT data. (Longer windows attenuate the jangles but will smear the sound.) For speech, this may not be a big deal, but for music it's usually a very ugly sound.flieshttps://www.blogger.com/profile/04438262506920089149noreply@blogger.com