Using overlap add for drawing spectrogram 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.
Apply window function to each overlapped window, and then simply draw
  the FFT magnitude response of each window as if the spectrum
  corresponds to the center time of the window.


Your approach is partially correct. But in the second half of sentence is not how you draw a spectrogram. You shouldn't align the FFT output in the same direction as time. It should be perpendicular direction as time. After you obtain FFT Magnitude, look at it from "above". Means the colour grades that you give depends on the magnitude value. This will be line corresponding to first window. Similarly, for second window, you place it next to it (since you took it after certain interval of time). An example below shows simple spectrogram having 3-bin FFT with middle bin having higher value compared to other bins.