I'm confused with overlap-add (OLA) in the following two scenarios
- filtering/convolution an input signal;
- applying an STFT on input signal only and draw its spectrogram.
When applying OLA to filtering/convolution, I'd take overlapped signal blocks, window them, take FFT of each windowed block, multiply filter core in frequency domain, IFFT the block, then apply OLA to the current block with buffered previous block in time domain.
When drawing spectrogram of the signal, I assume I must take overlapped signal blocks, window them, take FFT of each windowed block. Now I'm not sure how I would draw the spectrogram with the magnitude response with the block.
Which way of the following is correct?
- Apply window function to each overlapped window, and then simply draw the FFT magnitude response of each window, making the windows next to each other as if the spectrum of each window corresponds to the center time or left edge of the window.
- Apply window function to each overlapped window, add up the windowed time-domain signal between adjacent blocks. Then take FFT of the current block and draw it. This requires caching one signal buffer.
The first approach seems to give the wrong timeline, if we consider the block signal starts at its left edge and ends at its right edge, because it's overlapped with the next block, unless we say the resulting frequency response represents the non-overlapped portion of the window only.
The second approach seems to counteract the windowing and thus beats the purpose, because adding the overlapped portion in time domain will cancel out windowing on the overlap.
I'm confused which way would be the correct OLA for deriving the spectrogram of the running signal.