Problem with plotting a phase response of a time-series data FFT

조회 수: 3 (최근 30일)
Gustavo da Silva Lima
Gustavo da Silva Lima 2019년 6월 17일
댓글: Star Strider 2019년 6월 17일
I'm trying to compare a time-series FFT to a transfer function frequency response. For this, I'm using the commands "abs" and "phase" to colect magnitude and phase, respectively, from the data and from the transfer function (using freqresp( ) command). However, when I plot the both graphs, the magnitude is ok, but phase response is not. It's returning to zero phase at the Nyquist Frequency (this frequency is the last one of my frequency vector).
See my code bellow :
Ryu_fft = fft(Ryu)/Ryu_length; %Obtainnig the FFT of my time-series data
Ryu_fft_dB = 20*log10(abs(Ryu_fft(1:NFFT/2+1))); %Evaluating the magnitude response
Ryu_fft_phase = phase(Ryu_fft(1:NFFT/2+1))*180/pi; %Evaluating Phase response in degrees
f = linspace(0,1,NFFT/2+1)
Now, see my semilogx() plot of this:
How could I fix this problem?
I suspect it is only a code problem once the magnitude is ok.

답변 (1개)

Star Strider
Star Strider 2019년 6월 17일
See if using the unwrap function on the phase vector (in radians, before transforming it to degrees) has the desired effect.
I do not recognise the phase function, since it appears only in:
C:\Program Files\MATLAB\R2019a\toolbox\ident\idobsolete\phase.m
  댓글 수: 2
Gustavo da Silva Lima
Gustavo da Silva Lima 2019년 6월 17일
Thank you for help me. Unfortunately the command "unwrap", implemented as you suggested, is not solving my problem.
About the command "phase"...yes, I'm using this to identify a dynamic system. I've tried to use angle() and atan2(), but "phase" looks better.
Star Strider
Star Strider 2019년 6월 17일
My pleasure.
Oh, well.
It was just an hypothesis that phase-wrapping was the problem. Not enough information for any other Answer.

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by