Phase shift in in FFT Harmonics results

2 次查看(过去 30 天)
Dom
Dom 2022-2-12
编辑: Dom 2022-2-12
Hi Guys,
I am using the fft_powerscope function to evalute a simulink output signal. My problem is, that the recreated signal does not ressemble the original signal. There seems to be a phase shift somewhere. Can you help me find the error? I shared all the data that I used.
order= z_46.fft_iabc.freq./z_46.fft_iabc.fundamental;
phase= z_46.fft_iabc.phase;
for y=1:length(phase)
phase2(y,1)=phase(y)-phase(2)*(y-1);
end
fs = 1000;
Ts = 1/fs;
duration = 10;
t = 0 : Ts : duration-Ts;
mag= z_46.fft_iabc.mag./ z_46.fft_iabc.magFundamental;
x=mag(1);
M=[order,mag,phase2];
phase=phase*pi/180;
for q=2:length(M)
x=x+mag(q)*sin(2*pi* (q-1)*t+phase(q));
end
Would gladly appreciate your help. The fft start time from the orginal signal is in the data set.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by