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.
While 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.
How does a brickwall filter affect the following things?<p>A tone played for a fixed time, a glissando, vibrato, a pure tone that lies between two frequency bins?
<a href="https://github.com/pmarks-net/chromadoze" rel="nofollow">https://github.com/pmarks-net/chromadoze</a> multiplies white noise by a stairstep shape (rectangles of various heights), then runs an IDCT to generate colored noise.<p>I wonder if this actually has subtle artifacts, or if it doesn't matter because the input is noise?
I 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 probably don't have ringing in the scene you took a picture of, so you don't want to zero bins. In other signal processing contexts where you might actually have no signal to measure in certain bins, and sometimes you want to zero them.
A much less well known fact about the FFT (or the DFT) is that it is also exhibits a brickwall (rectangular) response. This can manifest itself when using zero padding in the frequency domain for upsampling, but is also the reason for artifacts when FFTing a nonperiodic window.<p>It's used in OFDM, where the subchannels are generated by an FFT and have a sinc shape (the Impulse response of the FFT) in the frequency domain.
as 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...<p>but yeah, the implicit boxcar is a sinc.<p>sometimes it's used for image data as 2d convolutions can be expensive though...
Why 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.