# Amplitude modulation in pure sine wave [duplicate]

I am generating sine wave in MATLAB with following code

fs=2000e6;%sampling frequency
t=0:1/fs:(1e-6)-1/fs; %1us seconds duration
fc=501e6;%frequency of the cosine wave
x=cos(2*pi*fc*t);
plot(x)


The wave it generates is somehing like this

My question is: Why do we see amplitude modulation in the wave. Shouldn't amplitudes be 1 at all peaks of the wave? like this wave

• What you're seeing is a plotting artifact (you have more data points that pixels, so Matlab has do discard most data points before plotting). Also, you only have four samples per period, so you can't expect the plot to be super detailed. – MBaz Sep 3 '19 at 13:22
• I'm voting to close this question as off-topic because this is not a signal processing question. – MBaz Sep 3 '19 at 13:22
• Don't close this question! It is very much a signal processing question and with the confusion it caused related to that, then a very good dsp-puzzle at that! – Dan Boschen Sep 5 '19 at 0:55