If a fft of vector x is plotted then what would be the x-axis?
조회 수: 378(최근 30일)
Allen Goldstein 2019년 10월 16일
To plot the entire original fft use:
N = length(X_mag)
f = horzcat(-linspace(0,N/2,N/2)*Fs/N,linspace(N/2,0,N/2)*Fs/N);
To create the frequency spectrum and stem (f,X_Mag), This does a little weirdness behind the scenes because it splits the fft vector in half then plots the two ends of the vector in the middle. If you just plot(X_Mag) you will see what I mean..
One more thing, it is better to use stem() to plot ffts because the bins of the fft are independant (orthogonal) and plot interpolates a connection between the elements which can be misleading.