Why use the fast Fourier transform for noise reduction instead of a classical electronic filter?

I'd like to know how to remove environmental noise from a speech recording.

Well it's stored digitally now, right? so are you planning on putting your microphone next to the speaker after an analog filter to re-record it?

Enough messing around, I'll be serious.


In order to make a filter attenuate more in a smaller range of frequencies, aka making the frequency response curve more vertical, then you just need to increase the order of the filter.

That is something that is reasonably easy to do in Matlab. It's also something that is feasibly to do post-processing. It's also about repeatability, if you apply the filter on a sunny day today, then you expect it to work identically to tomorrow when it's raining. You expect it to work exactly the same, right?

In analog circuits you have all these "5% resistor", "1% capacitor", and all other stuff. So if you want to make something exact you will definitely need to trim the circuit afterwards so it matches your desired filter perfectly. If you want to increase the order of the filter... then sadly.. it will make the filter so much larger physically. Instead of taking up the size of a credit card, it will take up the size of, I don't know, depends on filter order and what you're okay with.

Regarding the repeatability, doing something today.. warm.. tomorrow.. colder... the resistances will change ever so slightly, the frequency response will change, a couple of Hz there, some there, the more components you got in your circuits, there more likely it is that your components will change their values. And then you have humidity, oxidizing...

And here's the punchline that I should've said first, you can't really post-process it, unless you got cassette tapes. I'm not 100% sure what analog musical medium that is being used to record / delete easily. LP discs would be a nightmare...

And let's not forget the price. One is software, if you write it yourself then it's essentially for free, the other requires components, physical parts.

But don't think analog filters are bad, they got their uses, such as removing nasty harmonics in large DC motors, or making ultra silent stepper motors for 3D-printers by smoothing out the current. And tons of other uses. - Also if you would solve it with an analog filter, no one would think it would be a bad solution.

I believe I'm indirectly answering why FFT is a better way to go about it, post-processing wise. The bottom line is that it's much cheaper to do. You could also just apply a notch filter if you know what frequency the noise is at. Or a wider, aka bandstop filter.

And last thing I want to add... woaw this answer is so long, I'm sorry. But if you use an analog filter and you... mess up with your calculations and then think it's all fine and dandy and use it in some serious event, like interviewing the king of Sweden (Knugen). And you messed up with the sizing of a capacitor, instead of filtering 16kHz noise, you're filtering out 4kHz "noise". If you instead deal with it digitally then it's just a matter of changing some variables, you don't need to desolder -> solder another component. Also the interview is ruined.


But why can't you use a classical electronic filter to remove the noise frequencies?

Who says you can't? It is how this was done in the days before digital signal processing. The problem is that filtering noise is always a compromise between keeping your wanted signal (speech, music) untouched while lowering the noise.

For cassette tapes and other analog tape recordings systems like DNL and Dolby were used which filter only when the signal is weak meaning the noise is more audible. Then when the signal is stronger the filter fades off. See: Wikipedia Article on Noise reduction

Speech can be limited to a narrow frequency band like 300 Hz to 3 kHz while still being perfectly understandable. You could make a simple analog filter for that band but that would limit how much the noise is suppressed. To more effectively filter out frequencies outside of this band would require a complex analog filter. Such filters are difficult to design, build and manufacture.

This is where digital signal processing comes in. In the digital domain it is much easier to implement complex filters with many poles and zeros. Also since the location (in the frequency domain) of these poles and zeros is linked to the clock of the DSP (Digital Signal Processor), which is an accurate (crystal) clock, the filter will be much more accurate compared to an analog implementation.


Well, the first step to understanding why we need FFT is to understand how digital filtering works.

So basically, you have a structure, like a shift register, with a number of memory elements, an input and an output. A sample value goes into the input, gets shifted through the register and moves to the output. At each stage in the register, it's multiplied by a number called filter coefficient.

This idea works OK when you have a fast register doing fast multiplications and you have samples coming in slowly one by one.

In real life, instead of that, you'll most likely get a frame consisting of a number of samples. When you want to filter that, you'll convolve the samples with the filter coefficients. That's same as doing the previous approach, but just looks a bit different.

Now comes the FFT part. It turns out that convolution grows in numerical complexity very quickly with number of samples. On the other hand, the FFT is at its start numerically complicated, but the number of needed operations grows much slower with the increase of filter coefficients compared to convolution.

What the above means is that above a certain number of samples, it's going to be much faster to convert a signal into the frequency domain using an FFT, filter the signal in the frequency domain, and then convert it back using IFFT. The trick that we're using is one of the properties of convolution, namely that convolution in time domain can, in some circumstances, be modeled as multiplication in frequency domain.

So to sum it up, if the number of filter coefficients you have is sufficiently large, FFT is faster. The "large" could be as small as a hundred or so.

Tags:

Fft

Noise