2
$\begingroup$

I was told in my electronics course that "to reproduce a wave, we need to sample it at least twice every period."

If I take this to be literally true, then a sine wave with only 2-3 samples per period looks very ugly even though it obeys this rule. It looks more like a triangle wave.

I'm currently working with an FPGA and I need to synthesize and then sample the same high frequency sine wave (rf domain).

Example:

  • If I use a 50Mhz clock to synthesize a 12Mhz sine wave I get something pretty ugly even though it obeys "Nyquist's theorem".
  • After running simulations, I've found my clock needs to be ~20X faster to reproduce a "nice" sine wave of frequency $f$.
  • This leads me to believe I can't simply use an ADC which is 50Mhz to sample a 12Mhz sine wave because it will be as ugly as the sine wave I would create using such a sampling rate (it's not even five samples per period).

This would mean I either need expensive hardware or must build something myself.

Why does Nyquist's theorem seem woefully inadequate? It seems that a sample rate of 2-3 times higher is merely sufficient to tell me what the period of the signal is, not reproduce the signal with any resemblance of the original signal. Am I misapplying or misunderstanding Nyquist's theorem?

$\endgroup$
2
  • $\begingroup$ @RanGreidi you should undelete your answer and delete the comment, in my opinion. $\endgroup$ Commented Aug 15, 2021 at 12:19
  • $\begingroup$ done thanks haha $\endgroup$
    – Ran Greidi
    Commented Aug 15, 2021 at 15:18

6 Answers 6

6
$\begingroup$

Perfect recovery is one thing, niceness is another. Sampling above x2 Nyquist is sufficient for perfect recovery, after which we can FFT-upsample to make it look nice - which is more efficient than directly sampling at a higher rate (though it has its advantages).

$\endgroup$
2
$\begingroup$

You don't get a nice signal because you don't complete the D/A recovery process. After going through the DAC, you need to pass the signal from a lowpass filter which eliminates the extra frequency components.

Ideally the lowpass filter should be flat in a bandwidth equal to sampling frequency and zero outside. Since there is no such filter we have to increase the sampling frequency a little bit to avoid aliasing using non-ideal filters. This increase is not 20x and maybe(depending on the filter) 2.5x would be enough.

$\endgroup$
1
  • 1
    $\begingroup$ In real-world signal processing it's a bit stronger than "since there's no such filter". As a filter's response gets sharper its delay gets longer and its response gets longer. If it's an IIR filter (or lumped-constant analog filter) it needs more stages, if it's an FIR filter it needs more taps. Even putting aside the impact on hardware costs, it gets harder and harder to realize the filters in a practical arrangement. So it's not like you hit a brick wall at Nyquist -- it's more like things just get ever harder the closer you get to Nyquist. $\endgroup$
    – TimWescott
    Commented Aug 15, 2021 at 17:20
1
$\begingroup$

If I take this to be literally true, then a sine wave with only 2-3 samples per period looks very ugly even though it obeys this rule. It looks more like a triangle wave.

There must be a confusion, sampling at just higher than the Nyquist rate (which is twice the highest frequency present in the signal being sampled) gives you perfect reconstruction using Shannon's interpolation formula (sinc interpolation) without aliasing, the idea of it isn't just using those samples as the reconstructed signal, but to use the formula. Sampling above the Nyquist rate means you wont suffer for loss of information when when reconstructing and analyzing it.

$\endgroup$
1
  • $\begingroup$ sin interpolation is sufficient if you're trying to reconstruct a signal at a single frequency but you need a low pass filter for multiple frequencies with a highest frequency of $f_{max}$ $\endgroup$ Commented Jul 9, 2022 at 14:11
0
$\begingroup$

While the original Shannon/Nyquist sampling theorem did not deal with a sinusoid having frequency of exactly half of the sample rate (which would correspond to a pair of Dirac delta impulses directly on the folding frequency or "Nyquist"), the fact is that to get perfect reconstruction, you must sample at a rate strictly greater than twice the highest frequency component in the signal.

I'm on my smartphone at the moment but in some old post I go through, methodically, how one arrives at this result. It used to be part of the Wikipedia article on sampling, but now it isn't.

$\endgroup$
0
$\begingroup$

imagine if you had the exact number of sample points for the number of Hz, you hardly can recreate the waveforms of each cycle.

double the sample points for each cycle theoretically means getting the peak and trough of each cycle or 2 data points anywhere on a cycle.

a computer is only efficient at computing and not pattern recognition, thus nyquist theorem only gives adequate recovery not ideal reconstruction of signal

$\endgroup$
0
$\begingroup$

"a sine wave with only 2-3 samples per period looks very ugly even though it obeys this rule. It looks more like a triangle wave."

This is an old question but I still think it's worth it to point this out: the Nyquist sampling rate is enough to perfectly recreate a signal that is guaranteed to originally not have had any frequency component above (rate/2); if you look at those 2-3 samples per period, it may kinda look like a triangle, but a signal that was originally a triangle would surely contain harmonic frequencies higher that the main one. The only continuous signal that could be recreated by those 2-3 samples and would obey the mentioned rule is the original sinusoidal signal that was sampled.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.