title: Plotting the log amplitude and frequency
body: <p>I'm trying to display a spectrum of a sound sample with the correct frequency-axis, in Hertz, and a
  log-amplitude y-axis. I thought I had the frequency display right, but the graphs that it produces look rather weird and I've found absolutely nothing regarding displaying the log amplitude on an axis.</p>
  
  <p>The code that I'm using (heavily borrowed from mathsworks fft example) is:</p>
  
  <pre><code>y=x(100:200);
  Fs = 10000;                    % Sampling frequency                     
  numsamples = 20000;                     % Number of samples in the signal             
  NFFT = 2^nextpow2(numsamples); % Next power of 2 from length of y
  Y = fft(y,NFFT)/numsamples;
  f = Fs/2*linspace(0,1,NFFT/2+1);
  
  plot(f,2*abs(Y(1:NFFT/2+1))) 
  </code></pre>
  
  <p>And here's one of the graphs that it produced:
  <img src="https://i96.photobucket.com/albums/l162/Hazel_077/specta3r.png" alt="speech graph"></p>
  
  <p>I don't know if that's right or not, but it doesn't look anything like the examples I've seen....</p>
  
  <p>I'm aware this is probably a really stupid question and I'm missing something obvious, or maybe I've actually got it right and don't understand enough to realise it, but this stuff is really doing my head in and I'm not finding the documentation particularly illuminating.</p>