0
votes

I wrote a DSP program that uses overlap-add like this:
1. Incoming data is segmented into blocks of N samples
2. Each block is expanded with another N zeros, so the block has now 2N samples
3. Put the 2N block through FFT, getting a 2N spectrum
4. Multiply the 2N spectrum with a Sinc lowpass filter kernel spectrum
5. Put the resulting 2N spectrum through inverse FFT, getting a 2N block
6. Adding the first N samples to the last N samples of the preceeding run

This seems to work perfectly fine. Let's say I feed a nice sine signal to my input, so I get a nice (low pass filtered) sine at the output. I want to point out that the output signal does not show any indication that it was processed in blocks.

Now here is what puzzles me:
They say that you also need to use a windowing function. I take it that I am supposed put every input block (N samples) through a windowing function before I expand it to 2N samples.
But if I do so, the nice sine signal is faded in and faded out with every block. Of course, the output signal looks simular: what was once a nice sine signal is now an continuous repetition of fading in and fading out. This is not what I want, do I?

It seems to me that doing windowing is wrong when using overlap-add. As far as I understand windowing is useful when looking at the spectrum of an isolated block of data, but with overlap-add I have some sort of continuous stream of data, right?

1

1 Answers

2
votes

When doing fast convolution via overlap-add, one does not normally (non-rectangularly) window the input data.

But you may need to window your filter kernel to make sure that it isn't too long. The sum of the data block length (N) plus the filter impulse response or kernel length (M) must not be longer than the FFT length (>= N+M-1)

If you want to do analysis in conjunction with filtering, then one possibility is to overlap the input data by 50% and use von Hann windows. That works because the sum of the magnitudes of 50% overlapped von Hann windows is an unmodulated constant (except the very first and very last block). So the data does not fade in and out after the summation (overlap-add). Or you can just use separate FFTs, a windowed FFT for analysis, and an un-windowed FFT for overlap fast convolution.