How to Figure Phase Spectrum of a Signal?

63 visualizzazioni (ultimi 30 giorni)
Maria Amr
Maria Amr il 29 Mag 2021
Commentato: Maria Amr il 29 Mag 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);

Risposta accettata

Jonas
Jonas il 29 Mag 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

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by