Performing FFT in Matlab
If doing this in Matlab the command is fft(x) where x is your signal. Note that the result will be presented as a complex frequency vector of N points (or bins) from 0 to N-1.  Bin 0 is representative of the DC term and bin N-1 is 1 bin less than your sampling rate. Due to aliasing in digital sampling, this also represents the first negative frequency bin. Often we wish to view the spectrum with DC in the center with the positive and negative half spectrums. To do this easily in Matlab use fftshift:

out = fftshift(fft(y))


Also note that out will be complex, so you may want to view magnitude and phase separately:

mag = abs(out)


or

magdB = 20*log10(abs(out))


phase = angle(out)    &lt;- in radians.

Hope that helped!