I have a dozen source sound waves; each is about one second duration. I want to put each one through a digital filter (I'm truncating it to 128 taps).
Currently I'm doing this with a bog standard convolution. It is chewing up a lot of CPU.
I would like to switch to fast convolution.
Could someone outline the steps?
I'm aware that the basic technique is iFFT ( FFT(src) * FFT(filter) ), but the source and the filter are different lengths.
So what I'm imagining doing is this:
For each (source, filter) pair:
- Truncate each filter at 512 taps and FFT it to give 256 frequency bins.
Now step through the source at 128-sample increments using a window size of 512.
For each step,
* multiply by a (Hanning?) window,
* FFT
* multiply FFT with FFT of filter (complex multiplication on each bin)
* add to destination bufferDivide amplitude of destination buffer by 4, as we did 4 x overlap
Questions I have at this point are: 1. Is the basic method right? 2. Do I need to zero-pad my filter? 3. Is 4x overlap appropriate / optimal? 4. is that windowing correct? Is there any way to optimise out the windowing step? 5. how good will this output be compared with standard convolution?
π
EDIT: I've just noticed that dividing by 4 at the end is probably wrong, shouldn't it be using the area under the windowing function A_w? So multiplying everything by A_w / 4. Would that be correct?