title: Matlab spectrogram Hann window
body: <p><strong>My task</strong><br>
  I have a signal in .wav format with sampling frequency as 44100Hz. I want to get its power spectrum. I would like to do the STFT with a Hann window with size as 200ms and the window period as 50Hz. The frequency range that I am forcing is from 0 ~ 22000Hz.<br><br>
  <strong>My question</strong><br>
  Can I get what I want with the following code?<br></p>
  
  <pre><code>[y, Fs, nbits, opts] = wavread('a.wav');
  [S,F,T,P]=spectrogram(y,hanning(8820),7938,[0:100:22000],Fs);
  </code></pre>
  
  <p>The matrix P returned from the above code is what I want, am I right?<br><br></p>
  
  <p><strong>Further question</strong><br></p>
  
  <ol>
  <li>What is the relationship between the window size and its FFT size? I through they are independent in the past but I am not sure. Anyone can provide a simple answer or some reference reading?</li>
  <li>I have a command specgram(x, 512, 8000, hamming(80)); --- I guess the original purpose is that:<br>
  signal sampling frequency : 8000<br>
  window nfft : 1024<br>
  window period : 10ms<br>
  Actually, I am not sure the original purpose of this code, anyone can read it?</li>
  </ol>