# FFT Plot Axis Confirmation

I have a 4096 sequence of FFT coefficient. All of which a real values. My sampling frequency is also 4096 samples per seconds. Now I want to make a plot. I know my Y axis would be my FFT magnitude values, but what would my x- axis be. Would it be my sampling frequency, that is 1,2,3,4.........4096?

Here's a short snippet of code that returns the domain of the FFT depending on if you have the onesided or twosided FFT. This is from some code I posted on a somewhat related question here.

% Nfft - FFT size
% Fs - Sampling frequency in Hz
% oneside - flag indicating FFT results will be onesided or two sided

% Compute the frequency vector
if oneside == true
f = fs * (0:Nfft/2).'./Nfft;
else
f = fs * (-Nfft/2:Nfft/2-1).'./Nfft;
end


It is actually [-4096/2:4096/2-1]/4096*4096;

• The x-axis for a real-input FFT plot is typically Fs*[0:N/2-1]/N where N is the FFT size, and N/2 samples are kept from the FFT. – John Jan 8 '14 at 23:18
• Thank you John. So is it usually written as [-N/2:N/2-1]/N*Fs? – lennon310 Jan 9 '14 at 1:07