Phase shift in in FFT Harmonics results
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Pratyush Swain
2025-3-20
Hi Dom,
You can try with following workarounds to correct your signal:
1.Here you are adjusting the phase linearly based on phase(2), which could be distorting the phase across harmonics. This may not be necessary and could be introducing a cumulative shift. Consider using the original phase values directly.
for y=1:length(phase)
phase2(y, 1)=phase(y)-phase(2)*(y-1);
end
2. Consider this revised approach to reconstruct the signal. Use 'order(q)' instead of 'q-1' , the harmonic number might not simply be 'q-1', so try:
x = mag(1);
for q=2:length(M)
x = x + mag(q)*sin(2*pi*order(q)*t + phase(q));
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!