Given a band limited signal, where there's no energy outside the frequency rate FL to FH, the Nyquist-Shannon sampling theorem tells us that there are two conditions you have to meet in order for your sampling process to be lossless:
- The time period of a single sample has to be less than 1 / FH.
- The sampling rate must be at least 2 * FH / N, and no more than 2 * FL / (N - 1), where N is an integer, at least 1, and no more than FH / (FH - FL).
Informally speaking, the first condition comes about because the time period of a single sample acts as a low-pass filter on the input signal. In the case of the HackRF One, the sampling part of the ADC takes a single sample in 1/6th of a nanosecond at most, giving you the 6 GHz upper limit. However, there's time taken after doing the sampling, before the ADC outputs the sample value.
So, given that the sampling process in the HackRF runs at at least 6 GHz, why doesn't it output samples that fast? Two likely reasons:
- It can take a sample lasting 1/6th of a nanosecond, but then needs 49 nanoseconds to reset ready to sample again. This is unlikely at the HackRF One price point, but can happen.
- The sampling phase can take samples that quickly, but the conversion from an analogue sample to a digital codeword takes longer. This is the normal reason for a fast sampler with a low sample rate.
The second condition is less intuitive; it's about what signals look like after sampling. Recall that we can consider a signal as a sum of sine waves via the Fourier transform, considering thus its frequency spectrum instead of its time value. A real-valued signal in the time domain has a spectrum that's mirrored around DC in the frequency domain - if it has a 1 kHz sine wave, then the frequency analysis will also show a -1 kHz sine wave of the same amplitude. We generally don't bother displaying the negative frequency waves - they are identical to the positive frequency waves in amplitude, but with the sign of the frequency negated.
When you sample such a signal, you get values that represent the waves. At this point, information is lost; the sampling theorem tells us that, for all sine waves of frequency "F + n * FS" such that "0 ≤ F < FS", where FS is your sampling rate, and n is an integer in the rate -infinity to +infinity, you will get the same series of sample values. Remember that you can add up multiple sine waves to get a complicated signal, and their sample values simply sum up, so this works for more complex waveforms, as long as you can use the Fourier transform to express them as a sum of sine waves.
This is a problem for your receiver - with FS being 20 MHz, but the band as a whole covering DC to 6 GHz after low-pass filtering by the sampler, a set of samples that "looks" like a 5 MHz wave might actually be anything from -5.995 GHz to 5.985 GHz in 20 MHz steps. And the negative frequencies have exactly the same signal content as their absolute value equivalents - so you have not just the 299 possibilities from 5 MHz to 5.985 MHz in 20 MHz steps, but also a set of possibilities that come from 15 MHz (abs(5 MHz - 1 * FS) to 5.995 GHz in 20 MHz steps.
Fortunately, we can limit the set of possibilities with a band pass filter, which only lets through frequencies between a lower and an upper limit (and a set from the mirrored side of the filter). There's some complicated mathematics involved in considering the interaction of the sampling process and the filtering process[1], but as long as the lower limit of the filter is greater than the bandwidth of the filter, these interactions don't matter[2].
[1] And a neat trick involved, where you can look at the sampled output (discrete time) as-if it's been heterodyned down, because you get to choose the value of "n" when reconstructing the wave. So, if the filter only lets through frequencies from "5 * FS to 5 * FS + 15 MHz" (100 MHz to 115 MHz in your HackRF One), you can reconstruct with n = 1 instead of n = 5, and get the spectrum as-if you heterodyned down to FS before sampling.
[2] The interaction between filtering and sampling involves some complicated maths, but briefly, an informal way to look at it is that after sampling, "DC" recurs every FS, and the mirroring effect of the Fourier transform occurs at every one of these DC-equivalent points. If there's only one DC-equivalent point in the filter's pass band, then you can still determine which "side" of the mirror a given sample comes from, while if there's actual DC and a FS multiple in the pass band, you have two mirrors in the pass band, and can't determine which mirror applied to a given signal.