필터 지우기
필터 지우기

How to Figure Phase Spectrum of a Signal?

조회 수: 30 (최근 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 CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by