Why is it a bad idea to filter by zeroing out FFT bins? (2020)
dsp.stackexchange.com
Why is it a bad idea to filter by zeroing out FFT bins? (2020)
1–10 of 43 posts
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#2Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#3While it’s not necessarily a “bad idea” depending upon your application, you may be able to do “better” in the side lobes using masking functions (windows) other than rectangles, which is what zeroing is. See hanning, hamming, etc.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#4A tone played for a fixed time, a glissando, vibrato, a pure tone that lies between two frequency bins?
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#5While it’s not necessarily a “bad idea” depending upon your application, you may be able to do “better” in the side lobes using masking functions (windows) other than rectangles, which is what zeroing is. See hanning, hamming, etc.
In other words it will cause ringing (oscillations, Gibbs phenomenon) in the time domain (for signals, or spatial domain for images). If instead you want a smoother result, you will need to use oscillation in the FFT domain when zeroing out bins. As that is hard to do perfectly, it's easier to specify a window function (or a classically derived FIR or IIR filter kernel) and convolve it with your input signal / image. It is also more efficient to do online when the data is streaming.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#6Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#7Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#8While it’s not necessarily a “bad idea” depending upon your application, you may be able to do “better” in the side lobes using masking functions (windows) other than rectangles, which is what zeroing is. See hanning, hamming, etc.
Said another way, you're making a filter. Zeroing out FFT bins is a brickwall filter. Brickwall filters have poor frequency and amplitude accuracy if you are trying to preserve the signal in the passband. A Flattop filter will give maximum amplitude accuracy, a gaussian filter will give good amplitude and excellent frequency accuracy. Other filter types can be implemented to require less computation for resource cons…
Brickwall filters have the greatest possible frequency accuracy. I think you might be getting filters mixed up with windows - a boxcar window does not have the best frequency accuracy.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#9Earlier quoted context omitted.
Said another way, you're making a filter. Zeroing out FFT bins is a brickwall filter. Brickwall filters have poor frequency and amplitude accuracy if you are trying to preserve the signal in the passband. A Flattop filter will give maximum amplitude accuracy, a gaussian filter will give good amplitude and excellent frequency accuracy. Other filter types can be implemented to require less computation for resource cons…
> Brickwall filters have poor frequency and amplitude accuracy if you are trying to preserve the signal in the passband. Brickwall filters have the greatest possible frequency accuracy. I think you might be getting filters mixed up with windows - a boxcar window does not have the best frequency accuracy.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#10This would be a really good interview question!
It's not something you can expect someone to reason through from the basics, and it's not something I'd expect someone to know unless they've worked on problems involving the technique.