Why do I get a phase = 0 when I add a constant to a sinusoidal wave?
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
Wayne King
on 22 Feb 2013
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 Comments
Wayne King
on 22 Feb 2013
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!