Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
FFT single sided spectrum imagesc plot
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi guys
I have a matrix where I have performed an FFT operation, and I can view it using the imagesc function. However, I am seeing the negative spectrum as well, as shown in the figure below.
![what_i_have.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/225730/what_i_have.png)
I have tried the using documentation of the single spectrum FFT from the web page but its not giving me what I want, as shown below:
% Script 1
% Try again removing negative spectrum
L = length(tmp);
P2 = abs(tmp/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
figure
imagesc(P1)
% Script 2
% here is another code snippet for removing the negative spectrum
X_mags = abs(tmp);
N_2 = ceil(L/2);
figure
imagesc(X_mags(1:N_2))
The output of the two separate scripts is shown below: definitely not what I want.
![not_what_i_want.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/225731/not_what_i_want.png)
How can I only plot the positive spectrum of the matrix - with out using the fftshift?
Regards,
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!