Phase shift in in FFT Harmonics results
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!