Sampling Theorem

Thread Starter

cooded

Joined Jul 20, 2007
29
If a bandlimited sinusoidal signal say of maximum frequency 2 khz is sampled with a sampling frequency of 4khz then what will be the frequency of the sampled signal? Also what should be the cutoff frequency of low pass filter to reconstruct original signal?Please can you provide details of calculations.

Regards
 

Papabravo

Joined Feb 24, 2006
21,159
The answer to the first part of your question is that the sequence of samples will contain the same frequency content as the original signal. So it it was a pure tone at a single frequency that information will be contained in the sample sequence. If there are multiple frequencies in the original the same frequency content will be in the sample sequence.

The second question is a little bit harder. Are you talking about an analog LPF or a digital FIR filter with a low pass characteristic. Normally, the reconstruction can be handled in more than one way and you need to be more specific. In high-end audio applications the cutoff is as close to 0.5*fs as possible and as steep as possible. For 16/44.1 data our cutoff is at about 0.48*fs with about 305 dB rolloff
 

Thread Starter

cooded

Joined Jul 20, 2007
29
Hello..
So the answer to the 1st part of the question is 4 khz...and the filter which i want to use is a simple analog low pass filter.
 

t06afre

Joined May 11, 2009
5,934
Your question can not answered. As the answer can be anything. It is a trick question related to the nyquist frequency. If you sample a 2Khz sine wave with zero phase, and f sample=4 KHz. If start is at t==0. You will get zero out. As the phase change you will get a triangle wave growing (amplitude) as the phase get closer to 90 deg. The frequency will be 1Khz. You will not be able to reconstruct your 2 Khz wave in any way
Edit: I read your question wrong. I read it as you sampled a 2 KHz wave with 4Khz. But I let it stay
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,159
No the sampling frequency will not show up in the output. If the input can have any frequency from 0 Hz. to 2,000 Hz. then those are the only frequencies that can show up in the output.

Using a sequence of samples, and a ZERO ORDER HOLD into an analog low pass filter with a corner at 2kHz will introduce some distortion. Weather you notice it or not depends on possessing a set of golden ears.

http://en.wikipedia.org/wiki/Zero-order_hold

There is a mild rolloff at the Nyquist, but allegedly, only the golden ears can hear it.

Also: since you know the original signal is band limited there would be nothing wrong with putting your corner frequency higher than 2kHz, and equally there would be nothing wrong with adding emphasis, with a second order filter for example, to compensate for the ZOH rolloff.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,159
Your question can not answered. As the answer can be anything. It is a trick question related to the nyquist frequency. If you sample a 2Khz sine wave with zero phase, and f sample=4 KHz. If start is at t==0. You will get zero out. As the phase change you will get a triangle wave growing (amplitude) as the phase get closer to 90 deg. The frequency will be 1Khz. You will not be able to reconstruct your 2 Khz wave in any way
Edit: I read your question wrong. I read it as you sampled a 2 KHz wave with 4Khz. But I let it stay
The OP did say he was using a 4kHz sampling frequency to sample a band-limited 2 kHz input. I think he wants to know about a filter for the output after he converts it back to the analog domain.
 

gootee

Joined Apr 24, 2007
447
No the sampling frequency will not show up in the output. If the input can have any frequency from 0 Hz. to 2,000 Hz. then those are the only frequencies that can show up in the output.

Using a sequence of samples, and a ZERO ORDER HOLD into an analog low pass filter with a corner at 2kHz will introduce some distortion. Weather you notice it or not depends on possessing a set of golden ears.

http://en.wikipedia.org/wiki/Zero-order_hold

There is a mild rolloff at the Nyquist, but allegedly, only the golden ears can hear it.

Also: since you know the original signal is band limited there would be nothing wrong with putting your corner frequency higher than 2kHz, and equally there would be nothing wrong with adding emphasis, with a second order filter for example, to compensate for the ZOH rolloff.
I hesitate, a little, to post this here, and don't want to appear to be (or actually be) hijacking the thread. The following mini-rant isn't aimed at any of the posts in this thread. They just reminded me of a concern I have had. And maybe it's no longer a potential problem and I am simply ignorant of the current state of the art. So I hope that someone can bring me up to date and maybe calm my fears.

The digital audio stuff has been bothering me ever since CDs first appeared: All electrical engineers learned about sampling, and the Nyquist frequency (and Laplace, Fourier, z-transforms, etc). But didn't anyone else's professors tell them (or didn't they realize on their own) that while 2x the highest frequency component is the theoretical _minimum_ lossless sampling frequency, one would be much better off if they used something more like 10x the highest frequency component?!

The fact that we even have to worry that there "might" be some deficiency in the result, such that the golden-ears can "allegedly" hear the difference, seems to be a rather-scathing indictment of using a 2x sampling rate, already, unless one simply doesn't care at all about ever wanting to be able to try to claim "high fidelity".

Am I wrong? Or were the bean-counters too much in charge, when 44 kHz was selected?

I haven't been following the digital audio technology, for quite a long time. Please tell me they're not still using a 44 kHz sampling rate (or, if you think you can, try to convince me that 44 kHz is "good enough".).

Cheers,

Tom
 

thatoneguy

Joined Feb 19, 2009
6,359
I haven't been following the digital audio technology, for quite a long time. Please tell me they're not still using a 44 kHz sampling rate (or, if you think you can, try to convince me that 44 kHz is "good enough".).

Cheers,

Tom
Nyquist Frequency

44.1 kHz Will faithfully reproduce frequencies from DC to 20kHz, provided enough bits are sampled. CD Audio uses 16 bits, which provides 65,536 discrete audio levels, roughly 16 μV "steps". With good DACs, there is essentially zero distortion of audio frequencies reproduced from PCM encoded audio (CDs), greater dynamic range, and a lower noise floor compared to any other method of recording (Other than DVD-Audio).

Most human hearing rolls off past around 16kHz, lower as age increases. Very few people can tell the difference between 15 bit and 16 bit encoding.
 

gootee

Joined Apr 24, 2007
447
Nyquist Frequency

44.1 kHz Will faithfully reproduce frequencies from DC to 20kHz, provided enough bits are sampled. CD Audio uses 16 bits, which provides 65,536 discrete audio levels, roughly 16 μV "steps". With good DACs, there is essentially zero distortion of audio frequencies reproduced from PCM encoded audio (CDs), greater dynamic range, and a lower noise floor compared to any other method of recording (Other than DVD-Audio).

Most human hearing rolls off past around 16kHz, lower as age increases. Very few people can tell the difference between 15 bit and 16 bit encoding.
OK. Even if I would accept that we don't care about the "very few" people who could hear the high frequency tones that are being lost, we need to keep in mind that music and sound in general are not just tones. What about fast-rising edges? What is the slew-rate limited to by only being able to reproduce up to 20 kHz? I came up with:

slew rate max of sine (in volts per microsecond) =

[(2 x Pi) x (freq in Hz) x (amplitude in volts)] / 1,000,000

which, for a 1 Volt amplitude at 20 kHz, would be about 0.126 V/us. I sure hope that's incorrect, because it is abysmally slow. (What is the max output voltage amplitude of a CD decoder, before any external amplification takes place?)

Or, you could think in terms of the Fourier components of a square wave and see at what frequencies a square wave becomes significantly distorted. A square wave is composed of a fundamental sine at the repetiton frequency plus its odd harmonics. Obviously, then, a 7 kHz square wave would be reproduced as a pure sine wave, since even the very first odd harmonic at 21 kHz would not be available. Could anyone hear the difference? Apparently not. But what about somewhat lower frequency square waves? And what about the unfaithful rounding-off of other fast-rising edges, such as snare rim shots, the plucking of strings, the attack and decay times of _every_ imstrumnt and sound, actually. They are _all_ changed (slowed or rounded), to some degree, by the 20 kHz limitation. Can we hear the difference? I don't know.

But I wonder why my analog Harmon Kardon HK560, bought new in 1978, had a frequency response that went to over 200 kHz, if it wasn't going to matter.

On the bright side, I guess now we don't have to worry about the THD@20kHz spec, since there won't BE any harmonics of 20 kHz.

Cheers,

Tom
 
Last edited:

thatoneguy

Joined Feb 19, 2009
6,359
If you have good speakers on your computer, 5.1 w/sub (I run a receiver, sounds great), what do you rate non-HD youtube audio quality as?

Youtube flash is 22kHz sampling, 96KBit/s data for audio. An Audio CD runs at around 180KB/s. Even in HD, Youtube uses variable bit rate and heavy audio compression, which is the audio equivalent of photographic JPEG compression (lossy). It was high enough quality that record labels downsample it further to promote sales of CDs, and any higher quality versions of music are removed from the site.

The typical output of a CD player DAC is a 1V p-p signal. The quality of the DAC plays a big role in how faithful the CD reproduction seems. Some audiophiles go to the extent of using the fiber digital out to a custom made/higher end external DAC, which then connects to the receiver.

CDs have better response both in low and high frequencies compared to vinyl, which DOES change the sound, but for those used to the slight distortion, CDs sound "unnatural".

With distortion analyzers, the difference shown in nearly all areas is that CD is better than vinyl. For those who like the tube "sound" and spend $1000 on speaker cables, vinyl will probably always sound better, and no amount of fact will change that.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,159
The Wadia 860/861 DAC has an analog output that can be varied in discrete steps up to 4 V P-P so it can be used in a variety of amplifier/preamplifier combinations.

The SACD which seems to be declining in popularity is sampled at 88.2 kHz and I can't hear the difference
FLAC and WMA are 24/96 and do not appear noticeably superior to me.
We are experimenting with 32/192 and that amount of data for 45 minutes will absolutely gobsmack ya
 
Last edited:

gootee

Joined Apr 24, 2007
447
If you have good speakers on your computer, 5.1 w/sub (I run a receiver, sounds great), what do you rate non-HD youtube audio quality as?

Youtube flash is 22kHz sampling, 96KBit/s data for audio. An Audio CD runs at around 180KB/s. Even in HD, Youtube uses variable bit rate and heavy audio compression, which is the audio equivalent of photographic JPEG compression (lossy). It was high enough quality that record labels downsample it further to promote sales of CDs, and any higher quality versions of music are removed from the site.

The typical output of a CD player DAC is a 1V p-p signal. The quality of the DAC plays a big role in how faithful the CD reproduction seems. Some audiophiles go to the extent of using the fiber digital out to a custom made/higher end external DAC, which then connects to the receiver.

CDs have better response both in low and high frequencies compared to vinyl, which DOES change the sound, but for those used to the slight distortion, CDs sound "unnatural".

With distortion analyzers, the difference shown in nearly all areas is that CD is better than vinyl. For those who like the tube "sound" and spend $1000 on speaker cables, vinyl will probably always sound better, and no amount of fact will change that.
Don't worry. I'm not of the audiophool religion.

Your last two paragraphs are very encouraging! You had me convinced and ready to go on my merry way with new-found happiness until you mentioned that distortion analyzers show that CDs are better than vinyl in "nearly all" areas. I haven't yet read the article you linked. But if it's not in there, do you have any details about the comparisons?

Thanks for taking the time for that reply.

Cheers,

Tom
 

Thread Starter

cooded

Joined Jul 20, 2007
29
guys....ok let me rephrase my question this way...sine wave of 2khz. sampling pulses of frequency 4khz(nyquist satisfied.). What will be the frequency of the sampled wave.(should be 4 khz right?)
 

thatoneguy

Joined Feb 19, 2009
6,359
guys....ok let me rephrase my question this way...sine wave of 2khz. sampling pulses of frequency 4khz(nyquist satisfied.). What will be the frequency of the sampled wave.(should be 4 khz right?)
If you mean after a DAC, when the sine wave is reconstructed, it will be a 2kHz sinewave.

For the filter, either digital and/or analog low pass for any frequency above 2kHz should be strongly attenuated if the sampling rate is fixed at 4kHz. This prevents any aliasing from appearing at the output.
 

t06afre

Joined May 11, 2009
5,934
guys....ok let me rephrase my question this way...sine wave of 2khz. sampling pulses of frequency 4khz(nyquist satisfied.). What will be the frequency of the sampled wave.(should be 4 khz right?)
No the frequency would be 1Khz or nothing depending on the phase of the signal. Like I have said in my previous posting. And the wave would be something like a square wave. But such questions like this are only of academic interest. They have nothing to do with real world applications.
Why are you asking about this?
 

Papabravo

Joined Feb 24, 2006
21,159
Let me repeat. Regardless of the sampling frequency, if the original signal is band limited then only frequencies within the limited band can appear in the output after reconstruction by what ever means.
 

Thread Starter

cooded

Joined Jul 20, 2007
29
Let me repeat. Regardless of the sampling frequency, if the original signal is band limited then only frequencies within the limited band can appear in the output after reconstruction by what ever means.
ok thats for the reconstruction part...and i understood it and agree with you. But assume that we are not going to reconstruct the signal..we are just going to sample it and check what the freq. of the sampled signal is. so right now all i want to know is what will be the freq. of the sampled signal at the out put of the sampler.

@t06afre : I have an exam on 13th of feb. Wanted to get the concepts right.
 

Papabravo

Joined Feb 24, 2006
21,159
The answer is still the same. The sampling frequency will not show up in the sample sequence. You cannot manufacture something that is not there. You can do a DFT on the sequence to extract the frequency content and you will see that the sampling frequency is not there. I don't know how to be plainer than that.
 
Top