Saturday, August 4, 2012

When to (not) use the FFT

In the last post I discussed one use for the FFT: pitch tracking. I also mentioned that there were better ways to do pitch tracking. Indeed, aside from improvements on that method, you could also use entirely different methods that don't rely on the FFT at all.

The FFT transforms data into the "frequency domain", or, if your data is broken down into chunks, the FFT transforms it into the "time-frequency domain," which we often still think of as the frequency domain. However, the most basic "domain" you can work in is usually the "time domain." In the time domain, audio is represented as sequence of amplitude values. You may know this as "PCM" audio. This is what's usually stored in WAVs and AIFs, and when we access audio devices like soundcards, this is the most natural way to transfer data. It turns out we can also do a whole lot of processing and analysis in the time domain as well.

ProcessTime DomainFrequency Domain
Filtering/
EQ
Yes!No!
Pitch ShiftingOkayOkay
Pitch TrackingOkayOkay
Reverb
(Simulated)
Yes!No!
Reverb
(Impulse)
No!Yes!
Guitar effects
Chorus/flanger/distortion/etc
Yes!No!
SR ConversionYes!No!
CompressionYes!No!
Panning, Mixing, etcYes!No!
Table 1: Recommendations for Audio Processing in the Time Domain vs. the Frequency Domain


Wow, so impulse reverb is really the only thing on that list you need an FFT for? Actually even that can be done in the time domain, it's just much more efficient in the frequency domain (so much so that it might be considered impossible in the time domain).

You might wonder how to adjust the frequency balance of a signal, which is what an EQ does, in the time domain rather than the frequency domain. Well, you can do it in the frequency domain, but you are asking for trouble. I'll talk about this in my next post.

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete