# Basic sampling question

#### joniengr

##### Full Member level 3 Hi,

I have a analog signal of 50 KHz and I need to sample it using ADC in such a way that I can see the magnitude of all frequencies with the resolution of 1 Hz. What should be the sampling frequency. Some signal tutorials says that at least twice the highest frequency of the analog signal but I guess it might need more than twice the highest frequency on the signal.

#### stenzer

##### Full Member level 4 Hi,

the sample frequency should be at least two times higher than the expected measured frequency of interest. By using an ADC with a sample frequency of 100 kHz you are able to evaluate the frequency spectrum from DC to 50 kHz.

Usually someone would use an ADC with a higher sample frequency as 50 kHz is pretty low. But the low (100 kHz) sample frequency might also be an cost issue due to a required high amplitude resolution.

I assume you are evaluating the frequency spectrum by a FFT, thus your frequency resolution depends on your sample period (number of consecutive samples) and your sample frequency. For a sample frequency of 100 kHz (sample rate is 10 µs) you would need at least consecutive 10000 samples.

greets

#### wwfeldman ... analog signal of 50 KHz and I need to sample it using ADC in such a way that I can see the magnitude of all frequencies with the resolution of 1 Hz.
all what frequencies?
is your signal a square wave and you want to see the constituent frequencies from Fourier analysis?
or is it a sine wave and you want to distinguish between 49,999 Hz and 50,000 Hz and 50,001 Hz?
or do you mean something else?

#### KlausST

##### Super Moderator
Staff member Hi,

To be exact: "at least" twice is not correct, you need "more than" twice.

But twice "of what"?
Twice of the maximum frequency of interest.
When you say you have a frequency of 50kHz, then usually there are overtones.
Overtone frequencies can be very high...so you have to decide up to which (overtone) frequency you are interested in..

Klaus

#### FvM

##### Super Moderator
Staff member An ADC with a useful 0 - 50 kHz bandwidth and full suppression of possible aliasing signals will e.g. use 120 kHz sampling rate and a steep anti-aliasing filter with a transition betwen 50 and 60 kHz. This also answers the overtone question.

The original question however doesn't clearly specify the input signal. If it doesn't occupy the 0 - 50 kHz baseband but only a small band around 50 kHz, you might use bandpass sampling with a much lower rate. Consider that Shannon/Nyquist rate doesn't refer to signal frequency rather than total bandwidth.

Frequency solution can be estimated as 1/sample length.

#### vGoodtimes this is the classic bad interview question. you can justify sampling rates above or below 100ksps. but I think the interviewer wants something like 2.2x. but if the cost of the adc is low, you could justify using higher rates to make an analog filter easier and then use a digital filter.

the time associated with the number of samples analyzed is what determines frequency resolution.

#### KlausST

##### Super Moderator
Staff member Hi,

or is it a sine wave and you want to distinguish between 49,999 Hz and 50,000 Hz and 50,001 Hz?
Interesting idea.
Theoretically ... for a limited range like 49,000Hz up to 50,000Hz .. when you just want to determine the frequency...you could use undersampling. Then even a sampling frequency of 2kHz could be sufficient. Theoretically.

And for 1Hz resolution you need a measurement window of 1/f_res = 1/ 1Hz = 1s. Independent of sampling frequency.

Klaus

#### joniengr

##### Full Member level 3 Hi,

The frequency of input signal is un-known. There are several frequencies present in the signal and the highest frequency of the signal is 50 kHz. The question is what should be the sampling frequency of the ADC so that from digital output one can get the amplitude (magnitude) of all frequencies between 1 Hz and 50 kHz. The frequency resolution has to be 1 Hz.

#### FvM

##### Super Moderator
Staff member Has been answered in post #5 - #7.

#### joniengr

##### Full Member level 3 Hi again, I am not sure if I describe my question properly.

I am also wondering about the band-width and sampling rate of oscilloscope. I guess if oscilloscope has band-width of 200 MHz then the sampling rate it has is around 1 Gsps which is relation of factor of five between the highest frequency i.e. band-width and the sampling rate. If we apply sampling theory then with 1 Gsps we can capture up to 500 MHz.

#### KlausST

##### Super Moderator
Staff member Hi,

A couple of things:
* There are undersampling systems with much higher analog bandwidth than sampling rate.
* analog bandwidth is determined at it's -3dB border. So if the -3dB is at 200MHz, then there still is signal at 500MHz.

Klaus

#### FvM

##### Super Moderator
Staff member Parameters of a sampling oscillocope don't have much to do with the original question of this thread or Nyquist/Shannon theorem. It's about the requirements for complete reconstruction of a sampled analog signal. The purpose of digital oscilloscope isn't signal reconstruction. It's measurement of an arbitrary signal, mostly in time domain. A steep anti-aliasing filter would be almost unsuitable due to the caused waveform distortion, instead an oscillocope implements a soft bandwidth limiting.

Beyond sampling theory, an excess sampling rate is necessary for single shot recordings with smooth waveform representation.