Why must a sample rate by at least twice a frequency in order to reproduce that frequency accurately?

I read this: To reproduce a given frequency, the sample rate must be at least twice that frequency. Why is this so?

That's Nyquist-Shannon sampling theorem. Think about it in the other way: imagine you are given a set of samples (the black dots in the image). The most intuitive way to recover the original analog signal would be by joining these samples. But you can easily notice that there is not a unique way of joining them. In fact, there are infinite possible signals that would contain the whole set of samples. Obviously, given the sample set, you would join them the easiest way, i.e. the blue signal.

Now, what about sampling? In the image you also have a red signal (which frequency is 1 Hz) that has been sampled too slowly, resulting in the black dot sample set. To have a clue about the real signal, we should have sampled it at, at least, 2 Hz. That way, we also would have samples (dots) at 0.5, 1.5, 2.5, etc seconds. And, as you can draw in Paint, the easiest path to join all the samples would be, again, the red signal. So we would have recovered our original signal successfully.

Because you need at least 3 samples per signal period, to uniquely interpolate the original signal. (with regard to aperiodic signals, ‘period’ refers to the time period over which it has been time-limited)The reason for this is as follows:

When you sample a signal, there are three variables(degrees of freedom) involved:

1. The signal frequency/frequency spectrum. This determines the magnitude variation between the sample points.
2. The sampling frequency. This determines the spacing between the sample points.
3. The phase of the sampled signal. This determines the relative orientation of the sample points. For example, a cosine wave sampled at half its frequency, starting from the zero degree point, will have a peak followed by a trough, while a sampled sine wave will have a trough followed by a peak.

To uniquely determine the original wave from three variables, we need three relations(constraints) between them. If the number of constraints is less than three, then the solution is not unique.

Let’s illustrate this, by considering a sinusoid of frequency f sampled at a frequency fs :

Case 1: fs≤f

If the sampling frequency is less than or equal to the max signal frequency, then there would be at most one sample in a period. This one sample constrains only one variable - the sampling frequency(the spacing between the samples). The other two variables - the signal frequency and the phase can be freely chosen - meaning that any signal, with any phase, sampled at the given frequency, can pass through those points. Case 2: fs=2f

In this case, there are two samples per signal period. Now, consider two sinusoids, one of which has a frequency three times the other, as shown below: As can be seen, in this case, there are constraints on two variables - the signal frequency(the magnitude variation between the points) and the sampling frequency(spacing between the points), but the third variable - phase can be freely chosen.

As a result, a sine wave of 3 times the frequency, but phase-shifted by 270 degrees, can perfectly pass through the points generated by sampling the original wave.

Case 3: fs>2f

In this case, there are at least three constraints on the sample points and only a signal, that:

1. Has the required spacing between the sample points.(Sampling frequency)

2. Has the required magnitude variation between the sample points(Signal frequency)

3. Has the required relative orientation of sample points(Signal phase),

will pass through the generated sample points, enabling us to determine the original signal uniquely.

New contributor
Ahmed Abdelazeem is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

If the sampling rate is s, an input frequency of f will yield precisely the same sequence of samples as f+ks for any positive or negative integer k. If input frequencies are allowed to go to zero and if if the input signal may have any arbitrary phrase, then any input frequency higher than s/2 would be indistinguishable from a frequency within that range.

Note that the Nyquist criterion is only relevant in cases where inputs are allowed to go zero. If the input will only contain a narrow range of frquencies, it may be safely sampled at a much lower rate without loss of information. In some cases, such sampling may be be useful to shift a frequency which is too high to measure into a range where measurement is possible. For example, if one has a very precise 10.000000MHz reference and wants to measure a frequency which is known to be between 100.01Mhz and 100.02Mhz, sampling the input signal at a rate of 10.00Mhz will yield a signal which is between 10,000 and 20,000Hz which may in some cases be more easily measured than the direct 100+MHz signal. Note, however, that signals near any multiple of 10.00Mhz will be indistinguishable from those of any other.