Why do I get a phase = 0 when I add a constant to a sinusoidal wave?
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone, say you have x = A*sin(wt + phi) + A0 where A0 is a constant. When I do fft on x and try to get the phase, I always get 0. Why is that? Is it because the wave is shifted up so it is no longer considered a sinusoidal wave? Thank you
2 个评论
采纳的回答
Wayne King
2013-2-22
That should not happen
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = 2+cos(2*pi*100*t-pi/4);
xdft = fft(x);
% now look at the DFT corresponding to 100 Hz
xdft(101)
angle(xdft(101))
Can you please show your code, as you see above, adding a DC shift does not give you a phase of 0.
2 个评论
Wayne King
2013-2-22
direct current. It is a synonym for a shift in the mean value of the waveform, or the equivalently the frequency content at f = 0.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!