I know that there are many similar questions, I still can not understand the answer. Let's say we have a time signal in MATLAB:
t=0:1/44100:1
and cosine signal with a frequency of 500 Hz:
x=cos(2*pi*500*t);
Now I am trying to plot the amplitude spectrum obtained with the fft from signal x
FFT=abs(fft(x)) plot(FFT)
According to the theory, we should get two peaks on the graph, one at -500 Hz and the other at 500 Hz. I don’t understand that I have two peaks, but I can’t understand at what frequencies these peaks are. I know there is a way to figure out the frequency using the FFT index, input signal length and sample rate, but I still can’t calculate the frequency.
I know that there are methods for aligning FFT graphs, so that the peaks lie on the index number of the frequency they represent using the fftshift function, but I want to find out the frequency using the graph as a result of a simple call to this function:
FFT=fft(x)
In this case, I already know that the signal contains a cosine of 500 Hz, but what if the signal that we want to receive the FFT is unknown before. How can we get the peak frequency values in this sample using the output from the fft function?
source share