# Nyquist Sampling Rate Question

1. Sep 11, 2011

### frenzal_dude

They say you can fully recover a signal if you sample it at twice the bandwidth (Nyquist rate). But how is it possible to be able to fully recover the signal since you are missing all the information about the signal between successive samples?

For example if you sample cos(2*pi*B*t) at 2B, you'd get samples which if you connected them together you'd end up with a triangular zig zag type of function, how would you know how to draw them up between the samples?

2. Sep 11, 2011

### yungman

I don't know the definition of Nyquist, but I spend three years working for LeCroy, the company that made transient recorders and digital scopes. We design ADCs and we tested it in Nyquest freq. Which the input is a sine wave half the clocking freq. The reason that you can recover the full sine wave is because as long as you are just slightly off of half freq, every time you sample, you sample a slightly offset point.

Say your half clocking frequency is faster than the input frequency by 1/360. Let your first sample of the input sine wave is at 0 deg. Since you are faster by 1/360, the next sample is at 180.5 degree of the input sine wave, the next one will be on 1 degree of the sine wave. From this you see if I take 360 sample, I will have recover the whole input sine wave into 360 points. You literally "walk" along the sine wave point by point.

That is the most harsh test on an ADC, so many ADC failed. One time I tried out an ADC from Analog Devices, an 8 bit ADC and it failed, I saw missing codes all over using the Nyquist test. They were red faced.

On the ADC test, we actually take the code from the ADC and strobe it right back into a proven DAC and regenerate the analog waveform. In the Nyquist test, it looks like two sine waves in opposite phase displace on the scope. This really test the ADC because each point swing to the opposite extreme.

Yes, if the event occure only one time and the width is only two clock period wide, you will not get all the detail information. You will not miss the event, but not the detail waveform. It is only through a continuous frequency input that you can recover all the information.

3. Sep 11, 2011

### fleem

Its not twice the bandwidth, its twice the highest frequency of the channel. And, of course, this assumes noise isn't an issue. So imagine a sine wave of that frequency (or less) being sampled at twice that highest frequency. Two samples per wave (or more) is enough to find the frequency and phase of the wave. Since any time domain signal can be broken down to separate sine waves of different frequency and phase, that sample rate is sufficient to recover the signal -- assuming noise isn't in your way.

4. Sep 11, 2011

### skeptic2

What you would see with this example is an amplitude modulated sinewave with the frequency of the modulation 1/360 the frequency of the signal. In fact if the sampling frequency were exactly twice the sinewave frequency, the resulting waveform would depend upon the phase relationship between the sinewave and sampling frequency. It is conceivable that if the sample happened to fall on the crossover point every time, you wouldn't get much of anything. Fleem, how would you recover the original signal from that or from yungman's slight oversampling example? It's not enough to recover frequency and phase, you also need to recover amplitude.

Last edited: Sep 11, 2011
5. Sep 11, 2011

### frenzal_dude

What about if you sampled a zigzag wave which had the exact same sample values as the corresponding sine wave?
You could know the frequency and phase, but how would you know if it was saw tooth, rect, or a zigzag etc function?

6. Sep 11, 2011

### fleem

The zig-zag (triangle, sawtooth, whatever) wave possesses much higher frequency components than a sine wave of the same frequency. You'd need to sample it at twice the highest frequency component that you want to recover. If you tried to send a zig-zag wave through a channel where the zig-zag's fundamental frequency was the highest available in the channel, then only the fundamental energy of that wave (a sine wave) would come out the other end of the channel.

7. Sep 11, 2011

### AlephZero

You can only fully recover a bandwidth-limited signal from the sampled data.

In other words, if the "original" analog signal had any frequency content above the Nyquist frequency, that information will be lost, or more precisely it will be aliased into frequencies below the Nyquist frequency if you didn't filter it out before you sampled the signal.

8. Sep 11, 2011

### skeptic2

I agree with both fleem and AlephZero in their latest posts. However in my post #4, the sampling rate would be twice or higher than the highest frequency component yet I believe it still would not be possible to recover the original waveform.

9. Sep 11, 2011

### fleem

One caveat of the Nyquist frequency is that you must take many samples. If you're sampling a sine wave and you only take two samples a half-wave apart, certainly you could not recover the sine wave. Nyquist says that you need more samples, but you can recover it eventually as long as the sample rate is twice the sine wave's frequency. You cannot recover it eventually if the sample rate is less than that.

10. Sep 11, 2011

### olivermsun

If the sampling rate is higher than 2x the highest frequency, then you will eventually sample all phases of the waveform.

11. Sep 11, 2011

### skeptic2

So how would you distinguish between a sample of a sinewave at f sampled at 2(f + f/360) and an amplitude modulated sinewave modulated with a sinewave at f/360 and sampled at 2f.

12. Sep 11, 2011

### olivermsun

Can you clarify? Is the second case a carrier sine wave at f modulated by an f/360 sine wave, all sampled at 2f?

13. Sep 11, 2011

### Dickfore

14. Sep 11, 2011

### skeptic2

yes

"The message you have entered is too short. Please lengthen your message to at least 4 characters."

yes!

15. Sep 11, 2011

### Dickfore

Let's say you have a zig-zag function with frequency B and amplitude A. Since it is a periodic function, you may decompose it in Fourier series. But, the expansion is:
$$f(t) = \frac{8 A}{\pi^{2}} \, \sum_{n = 0}^{\infty}{\frac{(-1)^{n}}{(2 n + 1)^{2}} \, \sin{\left[(2 n + 1) \pi \, B \, t\right]}}$$
But, this series contains all frequency components of the form:
$$f_{n} = \left(n + \frac{1}{2} \right) B, \; n = 0, 1, 2, \ldots$$
albeit with ever decreasing amplitudes that behave as $\sim 1/f^{2}_{n}$. Thus, this signal is not band limited and, strictly speaking, the Nyquist Theorem does not apply to it.

Last edited: Sep 11, 2011
16. Sep 11, 2011

### yungman

Actually you can recover the frequency component of the wave form that is close to sampling frequency or beyond if the input waveform is repetitive!!! We do these tests also.

With sampling frequency test, you get one point per cycle and same analogy, if you are off by 1/360, you walk on the sine wave 1 degree at a time and take 360 cycle to plot the whole sine wave. Same idea that for twice the sampling freq that you take one point every other cycle and still can plot out the sine wave.

This is all in theory, the limitation is the ability for the input chain to pass the signal( bandwidth limit), the ADC aperture uncertainty(the window of sampling).

17. Sep 11, 2011

### skeptic2

I think you are assuming that you know the frequency of the signal before you sample it. If you sample a signal with a frequency of f at f + f/360, the resulting waveform I think will be the same as if signal was f/360. How would you know which one it was?

18. Sep 11, 2011

### yungman

That's how we test. I don't know the detail at the time, it was 1981!!! After three years, that's enough ADCs for me and I never looked back since!!!!:rofl:

19. Sep 11, 2011

### olivermsun

So first of all the sampling needs to be at strictly greater than 2f to sample all phases of the carrier at all. Secondly, the upper sideband created by the amplitude modulation moves frequency content above f, so the sampling theorem is violated here even if the sampling is slightly above 2f.

20. Sep 11, 2011

### skeptic2

Strictly speaking yes, however it would be very difficult to construct a filter that would leave the carrier alone but filter out the upper side band that close to it. Still without knowing the exact frequency before making the measurement, how would you know which you were looking at.

The digital scopes I've used did not switch in low pass filters with a roll off at half the sampling rate for every sampling rate. One always had to be careful to make sure that he wasn't looking at a waveform generated by the aliasing of the sampling rate and the waveform.

21. Sep 11, 2011

### olivermsun

You wouldn't, but the reconstruction is based on the assumption that you have properly band-limited content.