# Sampling frequency for 20Mhz input signal

Discussion in 'General Electronics Chat' started by screen1988, Jun 29, 2013.

Not open for further replies.
1. ### screen1988 Thread Starter Member

Mar 7, 2013
310
3
I want to ask about sampling frequency. If input signal is 20Mhz, what is the sampling frequency that I need.
I know Nyquist's Sampling Theorem. The sampling frequency has to be higher than 40Mhz. What sampling frequency should I choose? 44.1Mhz or 80Mhz, 160Mhz...
This is a theoretical question that I would like to know. At present, I am learning Sampling Theorem.

2. ### LDC3 Active Member

Apr 27, 2013
920
160
As you know the sampling frequency determines the Nyquist frequency. It also determines the resolution of the signal. A 41MHz sampling frequency has less resolution then a 80MHz sampling frequency. An ADC for 45MHz is easily to construct than an 80MHz ADC, which is reflected in the cost. Also, you would need twice as much memory to double the resolution.
Since this is only theoretical, why not use 1GHz so you can see when the frequency varies by 2MHz.

screen1988 likes this.
3. ### screen1988 Thread Starter Member

Mar 7, 2013
310
3
Hi, I am a bit confused. According to Nyquist's Sampling Theorem the sampling frequency needed is only a bit higher than two times the highest frequency of the signal. If this is met the orignal signal can be recovered exactly without distorsion. Then why we need to sample at high frequencies?
I think maybe it is related to quantization. If the resolution increases then the precision also increases in quantization. Am I right?

4. ### wmodavis Well-Known Member

Oct 23, 2010
737
150
IMO, it kind of depends on what you want to pay and what a 'cost vs benefit' analysis shows you. And you have talked of neither.

Nor have you even stated what you are trying to achieve other than sampling. You can even sample at less than Nyquist suggests.

You did state you are "learning Sampling Theorem". What are you learning? What effect is there by higher or lower sampling frequencies?

5. ### LDC3 Active Member

Apr 27, 2013
920
160
If you remain in the time domain, that is correct. But usually the signal is converted to the frequency domain by an FFT transformation. The problem then becomes more apparent. Take a pure 38.6MHz signal. If you take 5 samples at 40MHz, you can recreate the waveform with some error of accuracy. The more samples you take at 40MHz, the error decreases. Unfortunately, this is not true after converting to the frequency domain. The transformation requires at least one full wavelength and have a power of 2 samples (it can be done with other amounts, but requires more calculations). The 38.6Mhz signal sampled at 40MHz shows up as several frequencies since 40MHz is not a harmonic of the signal. You can then convert this back to the time domain and your signal is different than the original.
Also, the phase difference between two sine waves is usually ignored.

PS: Ooops, that should be 18.6MHz, 38.6MHz.

Last edited: Jun 29, 2013
6. ### screen1988 Thread Starter Member

Mar 7, 2013
310
3
Thanks. Can you explain in more details. I am a beginer and not quite understand.
I think you meant a sinusoidal signal at 38.6MHz. Is that right?
I wonder why the sampling frequency is 40MHz not 80MHz (based on Sampling Theorem).
That is a bit strange to me but I have the feeling.

7. ### screen1988 Thread Starter Member

Mar 7, 2013
310
3
I said that this is theoretical means that I don't actually do it. I only want to understand about this.
My question is: According to sampling theorem the sampling frequency is at least two times higher than the highest frequency of the signal. Then why we need to sample signal at such high frequencies, often 8 times the highest frequency of the signal in ADCs?

8. ### LDC3 Active Member

Apr 27, 2013
920
160
In the real world, sampling a signal (composed of several pure sine waves) always has some error with it. The timing of the sampling probably has the least error. The voltage level on the line varies due to capacitance and noise, so your samples are never dead on. So when you re-create the waveform that these points represent, you can never get a sum of sine waves to go through all the points perfectly. The higher the sampling frequency, the more points you have for a given time period, which means less error in the re-created waveform.

screen1988 likes this.
9. ### LDC3 Active Member

Apr 27, 2013
920
160
Yes I meant a sinusoidal signal at 18.6MHz (not 38.6MHz, I guess you didn't see my correction at the bottom).

10. ### MrChips Moderator

Oct 2, 2009
12,623
3,451
The Nyquist Theorem states that the sampling frequency must be at least twice the highest frequency in your signal.

If the maximum frequency in the signal is 160MHz then your sampling frequency must be at least 320MHz.

If your signal is a square wave, you cannot faithfully digitize it because a square wave has infinite frequencies.

To sample a 160MHz square wave with a 320MHz sampling frequency you have use a low pass filter to remove all frequencies greater than 160MHz.

That is the sampling theorem in a nutshell.

11. ### crutschow Expert

Mar 14, 2008
13,473
3,361
Sometimes a sampling frequency is selected that is significantly higher than twice the highest signal frequency to simplify the anti-alias filter. Any noise or signal above twice the sample rate will be sub-sampled and end up as a lower apparent frequency in the passband. Thus you need to filter any noise or signal above the Nyquist frequency. If the sample frequency is low and the signal frequency is near the Nyquist frequency, then a high order of analog filter could be needed for this. If the sample frequency is higher, than you can filter the frequencies between the signal of interest and the Nyquist frequency with digital filtering. A low order of analog filter can then handle the frequencies above the Nyquist frequency.

12. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
783
As LDC3, wmodavis & crutschow point out, there are attendant problems with arbitrarily applying sampling theorem to a physical problem without a consideration of what one wants to achieve in terms of fidelity of reproduction of the original input.

I suspect assuming one can easily recover the original signal from the sampled signal containing frequency components up to the Nyquist frequency is an oversimplification. Even when anti-aliasing filtering has been suitably implemented. For instance, how does one in practice, faithfully recover the entire original signal from a sampled signal when the original signal includes frequency components up to the Nyquist frequency? What sort of post-sampling filter or signal processing specification is required to achieve said recovery?

13. ### gccorbyn New Member

Feb 17, 2016
1
0
Assuming your input is a sinusoidal, when you increase the input frequency to something close to the Nyquist limit, the output becomes triangular in shape. This is not a problem with a sine wave as it is easy to create a reconstruction filter which removes the higher frequency components and gives something extremely close to the original signal. However, if the input is not sinusoidal, it is not possible to reconstruct the signal faithfully because simply removing the higher frequencies will not reconstruct the amplitude irregularities. A square wave is the perfect example. A rule of thumb which works fairly well is sampling at twice the rate will allow the frequency component to be reconstructed but sampling will need to be increased to five times the rate in order to allow both the frequency and amplitude components to be reconstructed.

I'm afraid it's a case of suck it and see.