0

I am experimenting with digital signal processing and I took the FFT of a sinusoid in Matlab. I got the frequency components that I expected to be present but there are two excess spikes that mirror them. Are these reflections of the negative frequencies present in a sinusoidal spectrum that I didn't account for in my code or are they present in the signal?

Code:

Fs = 1e9;            % Sampling frequency                    
T = 1/Fs;             % Sampling period       
L = 1500;             % Length of signal
t = (0:L-1)*T;        % Time vector

S = cos(2pi200e6t) + cos(2pi400e6t); Y = fft(S); plot(Fs/L*(0:L-1),abs(Y),"LineWidth",3) title("Magnitude of fft Spectrum") xlabel("(Hz)") ylabel("|fft(signal)|")

Result:

enter image description here

  • 2
    Yes, these are reflections. If you fftshift the output and plot from Fs/L*(-L/2:L/2-1) you should see spikes at +/- the frequencies of interest. – Baddioes Feb 12 '24 at 23:05

0 Answers0