I am trying to sample a 50kHz sinewave @ 200 ksps using a 16-bit ADS8517 ADC. I am having a problem in that there is a lower frequency signal present on my input signal as shown:
There is no low frequency component there, and no screen resolution or sampling problem.
Shannon's theorem says you need at least 2 samples per cycle to represent the waveform accurately, and you have 4, so you are sampling it accurately.
Draw a sinewave, and mark 8 equally spaced sample points on it starting at 0, (at 45 degree intervals).
Now imagine the sinewave was sampled at 0, 90, 180 and 270 degrees; highlight those 4 samples and perhaps connect them with straight lines. Note the peak amplitude is the same as the peak amplitude of the original waveform.
Now repeat with the 45/135/225/315 degree set. Highlight and join with straight line. This time, you'll see the peak amplitude is 1/sqrt(2) of the original amplitude - yet both representations are correctly and accurately sampled representations of the original sine.
All you're seeing in the first plot is this correct sampling drifting between these two forms, as your signal and sampling rate are not precisely frequency locked.
The reason that either the sampling points, or a straight line interpolation, don't appear to reproduce the original waveform correctly, is that their spectrum extends above the Nyquist limit (Fs/2).
If you correctly band-limited the reconstructed waveform, with BW less than FS/2, you would draw it as the smoothest possible curve between the points, (alternatively, you would low pass filter at FS/2 with a reconstruction filter - or interpolate using Whitaker's Function - another way of saying the same thing) and that smooth curve would, of course, be the original sine wave.
You need at least display 2 pixels per sample to prevent aliasing and more to reduce intepolation error to some defined error limit. Shannon's law.
I measured you have 1000 datapoints in 579 image pixels instead of 2000 to 3000 Pixels. Thus a display aliasing frequency results.
It’s your screen resolution that is giving you the impression the the signal is aliased. Try focussing in and taking a closer look. My estimate is that this is a storm in a tea cup. Sure there will be artefacts that look like aliasing but it’s just how your screen is handling things. If necessary use a simulator and get an alternative view of things.