In part three of this data-acquisition series, I noted that unwanted signal components can alias into sampled data. The plot, below, shows this problem for a 5kHz signal sampled at 47 ksamples/sec without an anti-alias filter. You cannot determine whether the plotted points come from a 5kHz signal or the superimposed 52kHz signal that occurs at a frequency above the signal you want to measure. Why do sampled signals exhibit such behavior? Mathematics provides the answer.
The sampled points in the 5kHz signal correspond to the following formula where f0 represents the 5,000Hz signal and ts represents the sample period in units of seconds (21.28∙10-6 sec). You could use this formula to create a spreadsheet of data and then plot it.
Without more information, you cannot determine whether the samples (black dots) represent data for a 5kHz (blue) or a 52kHz (red) signal, sampled at 47 ksamples/sec.
x(n) = sin(2π∙f0∙n∙ts)
On a sine wave, points separated by integer multiples of 2π, or m∙2π, have the same value, so you can add the term m∙2π to the equation above without altering the value of x(n):
x(n) = sin[(2π ∙f0∙n∙ts) + (m∙2π)]
This added term provides the means to show the effect of the sampling frequency on aliased signals. A bit of algebra helps factor the equation above to yield:
x(n) = sin[2π(f0∙n∙ts + m)]
then: x(n) = sin[2π∙n∙ts∙ (f0 + (m/n∙ts))]
and because 1/ts = fs,
x(n) = sin[2π∙n∙ts∙(f0 + (fs∙m/n))]
and we represent m/n as a constant, k, so:
x(n) = sin[2π∙n∙ts∙(f0 + fs∙k)]
When sampling at a rate of fs samples/sec, if k is any positive or negative integer, we cannot distinguish between the samples values of a sine wave of f0 Hz and a sine wave of (f0 + fs∙k) Hz. (We can have negative frequencies, but Ill leave them for a discussion of digital-signal processing.)
So you cannot unambiguously determine the frequency of the sinusoid that produced the values for a series of equally spaced samples unless you know more about the signal. In fact, the relationship f0 + fs∙k allows for an infinite number of sine wave signals for a set of sampled data. By using an anti-alias filter you remove unwanted high frequencies from your data and thus know it cannot represent any of the signals blocked by the filter.