title: I need help setting up the correct frequency vector
body: <p>I have a wave of frequency 100 Hz (it is a set of data). I would like to plot the amplitude and the phase angle vs frequency.
  This is what I do but my amplitude shows at the wrong frequency, what am I missing?</p>
  
  <pre><code>given x=[....] set of data representing wave of frequency = 100 Hz, of length 1500.
  first: Nfft = 2^nextpow2(length(x));
  second: Fs = 1000; (that is 10 times my frequency of 100, is that correct?)
  third: get fft : xdft = fft(x,Nfft);
  forth: get amplitude: amp = abs(xdft);
  fifth: get phase :    ang = unwrap(angle(xdft));
  </code></pre>
  
  <p>Now my main issue is to set up the frequency vector correctly, this is what i did</p>
  
  <pre><code>f_fold = Fs/2; % folding frequency = max frequency of FFT (Hz)
  T = Nfft/Fs % total sample time (s)
  del_f = 1/T; % (Hz)
  f_v = [0:del_f:f_fold]'; % frequency (Hz)
  </code></pre>
  
  <p>I also tried matlab's suggestion:
  f_v =  Fs*(0:Nfft-1)/Nfft</p>
  
  <p>But my amplitudes always show at the wrong frequency. What can I do to fix this?
  Thank you</p>