Why don't 2 signals 180 degrees out of phase add up to an array of zeros?

1 次查看(过去 30 天)
I have this code:
amp=1;
fs=24000;
duration=2;
t=0:1/fs:duration;
freq = 1000;
Y=amp*sin(2*pi*freq*t+deg2rad(0));
Yi=amp*sin(2*pi*freq*t+deg2rad(180));
combined=Y+Yi;
plot(t(1:24),Y(1:24),'b'); hold on;
plot(t(1:24),Yi(1:24),'r'); hold on;
plot(t(1:24),combined(1:24),'g')
combined(1:24)
My question is: Why doesn't 'combined' add the two out of phase signals to an array of zeros? shouldn't 2 signals 180 degrees out of phase cancel each other out completely? Why are there still very small fluctuations about zero? Is it something about the "deg2rad" function, but they just say "meh, the difference from zero is close enough"?

采纳的回答

Walter Roberson
Walter Roberson 2016-7-27

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by