This is indeed an excellent way of filtering if your audio is cyclic and fits into a single FFT, like a periodic waveform, a drum loop or an Optigan track. Just make sure not to apply any window.
Why is it a bad idea to filter by zeroing out FFT bins? (2020)
21–30 of 43 posts
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#22I disagree that it's always a bad idea. If you didn't have real data in those bins to begin with, then the absence of ringing was never real either. You're just choosing between interpolation strategies to fill in the data you deleted. You have to realize that whatever you do, you're making up data. One could say that you're taking out your dry erase marker and writing in your priors. For image processing, you probab…
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#23as mentioned, worth pointing out that most practical digital filters don't have that many taps so unless you have other reasons to go to the frequency domain, time domain filtering can be faster... but yeah, the implicit boxcar is a sinc. sometimes it's used for image data as 2d convolutions can be expensive though...
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#24I wonder if this actually has subtle artifacts, or if it doesn't matter because the input is noise?
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#25Why use an FFT at all? Yes it's easy but you'll almost always get a better result with a lot less computation by building an actual digital filter.
The crossover point will be system-dependent and heavily influenced by overhead, but a crude WAG might be in the vicinity of 64- to 128-wide kernels. There is no question of one implementation being "better" than the other, they are capable of identical results if implemented accordingly.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#26This is indeed an excellent way of filtering if your audio is cyclic and fits into a single FFT, like a periodic waveform, a drum loop or an Optigan track. Just make sure not to apply any window.
You also need to make sure that the gibbs phenomena does not cause the filtered signal to leave the range of the representation. So a prefiltered signal is less than 1, but the post filtered signal wont be. Meaning if 1 is the cap for your audio output, then enjoy a brand new category of distortion. But its a terrible way in general ofc, just optimize an appropriate, zero phase filter with an unaffected passband and…
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#27as mentioned, worth pointing out that most practical digital filters don't have that many taps so unless you have other reasons to go to the frequency domain, time domain filtering can be faster... but yeah, the implicit boxcar is a sinc. sometimes it's used for image data as 2d convolutions can be expensive though...
Most used digital filters are small this is true. But that is an error caused by legacy solutions which required filters to be exceedingly short beeing inappropriately applied to modern systems and problem. The most egregious examples are from videogames, where several different short classic filters are usually applied in series in order to deal with e.g. aliasing. The problem is twofold, it effectively makes a larg…
in the time domain, you're looking at what... for each sample a pointwise multiply for each tap and then a sum, right? i'm guessing for most audio applications at commonly used sample rates, you're rarely going to have more than 24 taps at the very most? (with most only really needed 8 to 16?)
with the fft, unless you're using super exotic multiwindow schemes, you're looking at a pointwise multiply just to do the windowing before the fft. then you're looking at n log n to compute the fft itself, then zeroing or applying an envelope (pointwise multiply), then another n log n back to the frequency domain.
i think with simd you're way faster to just stay in the time domain.
would be interesting to bench for sure though... small ffts and simd may be super fast and not that many instructions.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#28Earlier quoted context omitted.
Most used digital filters are small this is true. But that is an error caused by legacy solutions which required filters to be exceedingly short beeing inappropriately applied to modern systems and problem. The most egregious examples are from videogames, where several different short classic filters are usually applied in series in order to deal with e.g. aliasing. The problem is twofold, it effectively makes a larg…
i'm guessing you're talking about things like og 4 tap biquads and the like. in the time domain, you're looking at what... for each sample a pointwise multiply for each tap and then a sum, right? i'm guessing for most audio applications at commonly used sample rates, you're rarely going to have more than 24 taps at the very most? (with most only really needed 8 to 16?) with the fft, unless you're using super exotic m…
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#29This is indeed an excellent way of filtering if your audio is cyclic and fits into a single FFT, like a periodic waveform, a drum loop or an Optigan track. Just make sure not to apply any window.
Re: Why is it a bad idea to filter by zeroing out FFT bins? (2020)
#30Earlier quoted context omitted.
i'm guessing you're talking about things like og 4 tap biquads and the like. in the time domain, you're looking at what... for each sample a pointwise multiply for each tap and then a sum, right? i'm guessing for most audio applications at commonly used sample rates, you're rarely going to have more than 24 taps at the very most? (with most only really needed 8 to 16?) with the fft, unless you're using super exotic m…
It's not unusual to use hundreds of taps for a clean linear phase filter with a sharp slope. Discrete convolution reverb would need hundreds of thousands - which is why you use an FFT for that.
still, you're looking at applying a window before the fft in most applications. that's a full pointwise multiply before even stepping into the fft (and back).
reverbs have delay lines, right? what does that look like in the spectral domain? some shift of the phases?