How to Figure Phase Spectrum of a Signal?

65 ビュー (過去 30 日間)
Maria Amr
Maria Amr 2021 年 5 月 29 日
コメント済み: Maria Amr 2021 年 5 月 29 日
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);

採用された回答

Jonas
Jonas 2021 年 5 月 29 日
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 件のコメント
Maria Amr
Maria Amr 2021 年 5 月 29 日
@Jonas, Thank you so much! Really appreciated!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by