Effacer les filtres
Effacer les filtres

How to Figure Phase Spectrum of a Signal?

30 vues (au cours des 30 derniers jours)
Maria Amr
Maria Amr le 29 Mai 2021
Commenté : Maria Amr le 29 Mai 2021
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);

Réponse acceptée

Jonas
Jonas le 29 Mai 2021
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
  1 commentaire
Maria Amr
Maria Amr le 29 Mai 2021
@Jonas, Thank you so much! Really appreciated!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by