How to Figure Phase Spectrum of a Signal?
32 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello Everyone,
I have a small signal (attached) to figure the amplitude and phase spectrum. I have figured the amplitude but I am not sure the phase is correct. I would appreciate if someone help me. Thank you in advance!
clc;
clear all;
close all;
data=xlsread('1');
amp=data(:,2);
time=data(:,1);%ms
t=time(1:1:end);
am=amp(1:1:end);
l=length(t);
NFFT=l';
S = fft(amp)/NFFT;
P2 = abs(S)*2;
lP2=floor(length(P2));
mS=P2(1:lP2);
freqS=1:lP2;
figure(1)
plot(freqS,P2,'LineWidth',2);
xlim([-inf max(freqS)])
PP=phase(S); %Phase Spectrum
figure(2)
plot(freqS,PP);
0 commentaires
Réponse acceptée
Jonas
le 29 Mai 2021
looks good, there was a similar post in https://de.mathworks.com/matlabcentral/answers/308872-how-can-i-determine-phase-in-fft
and another one on the question on the difference between angle() and phase() function here https://de.mathworks.com/matlabcentral/answers/318990-what-is-difference-between-unwrap-angle-x-and-phase-x
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!