title: OpenCV using Fourier Transform to get frequency spectrogram
body: <p>I have captured a input sound signal with my microphone and visualized it in a OpenCV Mat:</p>
  
  <p><a href="https://i.stack.imgur.com/ZCT1g.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZCT1g.jpg" alt="Mat of the input sound"></a></p>
  
  <p>I read each 20 samples (=each 20 pixels in x-direction of the "sound-mat") and multiply it with the hann-window-function.
  Then, I perform the dft (decrete fourier transform) in OpenCV (<a href="http://www.docs.opencv.org/2.4/modules/core/doc/operations_on_arrays.html#dft" rel="nofollow noreferrer">docs here</a>) of this windowed sequence.
  Here is an example of the mangitude output of the dft of such a 20-sample signal:</p>
  
  <p><a href="https://i.stack.imgur.com/4cdqS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4cdqS.jpg" alt="dft output of a 20-sample-sequence"></a></p>
  
  <p>But how can I get a frequency spectrogram? Is the described attempt right? What do I have to do with these dft outputs to get a spectrogram?</p>
  
  <p>Sorry for not posting the pictures; only links. As I am new to stackoverflow, I cannot post pictures directly.</p>