FFT Matlab - Meaning of Frequency Vector
Specifically,
nfft = 1024
Fs = 150
so f = (0:511)x(150/1024)
ie f will go from 0x(150/1024) = 0 to 511x(150/1024) = 75
So, you are plotting the magnitude of the frequency spectrum from 0 to 75 Hz.
The spectrum is periodic &amp; will repeat for 75 to 150 Hz hence you are plotting from 0 to Fs/2