dsp.rs icon indicating copy to clipboard operation
dsp.rs copied to clipboard

Add FFT filter

Open klangner opened this issue 4 years ago • 2 comments

  • Convert signal into frequency domain
  • Remove given frequencies (make them 0)
  • Convert back to time domain

klangner avatar May 28 '20 13:05 klangner

I think an "FFT Filter" would be best realized using an overlap-add FFT convolution filter: http://www.dspguide.com/ch18.htm. It's an O(n logn) convolution operation and typically higher performance than a typical FIR implementation for filters >~128 taps.

I think the best approach here is to use cupy's approach, which is really clever. They have a '_correlate_or_convolve' function with flexible arguments: cupy ndimage. My next task for this repo (hoping to wrap up another project and dedicate more time to this) is to do an FIR filter implementation. I propose I make the FIR filter convolution and FFT overlap-add convolution with the same interface, with a correlation function just calling convolve with reversed filter taps (as in cupy).

markubiak avatar Jul 01 '20 21:07 markubiak

Yes it makes sense. In this context I though about doing FFT on the whole signal. This can be useful in some context (like bio signals). But overlap-add FFT sounds good to me too.

klangner avatar Jul 02 '20 07:07 klangner