DSPRelated.com
Forums

Regarding sampling.

Started by Ted January 4, 2007
einsteinhelpme@yahoo.com wrote:

> The Niquist theorem is based upon frequency domain analysis of > sampling. If you use as the sampling frequency twice the frequency of > the sine wave you will need an ideal reconstruction (low pass) filter > in order to recover it from its samples. It's impossible to implement > such a filter.
For a question that it is fairly common, and that you know it is fairly common, it is quite surprising how you failed to answer it. Not only what you say is *incorrect*, but you're really not answering the question at all. What the OP is asking has nothing to do with needing an ideal filter or not; it's not for practical reasons that the problem occurs. First of all, if you sample at exactly *twice* the frequency, no ideal filter would be able to recover the signal (if the signal is a sinusoid at exactly half the sampling frequency). Period. I mean, read again the OP: *all samples are 0* --- how could the most ideal of all ideal filters recover a signal from samples that are a constant value of 0 ??? That in practice you need some margin, in addition to the theoretical limit, of course; but that has nothing to do with the OP's question (mathematically, if you sample a 1000 Hz sinusoid at exactly 2000.0000000000000000000000000000000000000000000000000000001 Hz, you can reconstruct the signal *perfectly and uniquely* --- of course, mathematically only; no practical application would possibly be able to deal with that).
> You should normally use a much higher sampling frequency > (let's say five times or more the highest frequency of your wave).
This is ridiculous --- is 44.1 kHz five times the bandwidth of the audio signals on CDs?
> By the way, it would be nice if you search the group before you post. > Your question is fairly common. A valuable source of information is the > FAQ (just google "comp.dsp faq").
*sigh* this is just sooo ironic.... Carlos --
Carlos Moreno wrote:
> einsteinhelpme@yahoo.com wrote: > > > The Niquist theorem is based upon frequency domain analysis of > > sampling. If you use as the sampling frequency twice the frequency of > > the sine wave you will need an ideal reconstruction (low pass) filter > > in order to recover it from its samples. It's impossible to implement > > such a filter.
just to reiterate what Carlos said, not even an ideal filter will allow you to reconstruct if it's sampled at exactly twice the highest input frequency. there isn't sufficient information in the samples.
> ...if you sample at exactly *twice* the frequency, no > ideal filter would be able to recover the signal (if the signal is > a sinusoid at exactly half the sampling frequency). Period. I mean, > read again the OP: *all samples are 0* --- how could the most ideal > of all ideal filters recover a signal from samples that are a constant > value of 0 ??? > > That in practice you need some margin, in addition to the theoretical > limit, of course; but that has nothing to do with the OP's question > (mathematically, if you sample a 1000 Hz sinusoid at exactly > 2000.0000000000000000000000000000000000000000000000000000001 Hz, you > can reconstruct the signal *perfectly and uniquely* --- of course, > mathematically only; no practical application would possibly be > able to deal with that).
and you would need an absolute minimum (0.0000000000000000000000000000000000000000000000000000001 Hz)^-1 or 10000000000000000000000000000000000000000000000000000000 seconds of data to do it. i didn't count the zeros but it looks to me like more time than from the big bang to eternity. r b-j
Carlos Moreno wrote:

   ...

> That in practice you need some margin, in addition to the theoretical > limit, of course; but that has nothing to do with the OP's question > (mathematically, if you sample a 1000 Hz sinusoid at exactly > 2000.0000000000000000000000000000000000000000000000000000001 Hz, you > can reconstruct the signal *perfectly and uniquely* --- of course, > mathematically only; no practical application would possibly be > able to deal with that).
True, but it will take you as long to resolve that component as it would to resolve 0.00000000000000000000000000000000000000000000000000000005 Hz, and that is probably more seconds than you prefer to wait. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry Avins wrote:

>> That in practice you need some margin, in addition to the theoretical >> limit, of course; but that has nothing to do with the OP's question >> (mathematically, if you sample a 1000 Hz sinusoid at exactly >> 2000.0000000000000000000000000000000000000000000000000000001 Hz, you >> can reconstruct the signal *perfectly and uniquely* --- of course, >> mathematically only; no practical application would possibly be >> able to deal with that). > > True, but it will take you as long to resolve that component as it would > to resolve 0.00000000000000000000000000000000000000000000000000000005 > Hz, and that is probably more seconds than you prefer to wait.
Wait --- if we're talking in the strict mathematical sense, it does take you an infinity of time, in the non-causal sense (i.e., you need all the samples, from -oo to +oo to reconstruct). In the practical sense, things are as you (and Robert) point out; but then, notice that I did mention that no useful practical application would possibly be able to deal with such situation. Carlos --
Carlos Moreno wrote:
> Jerry Avins wrote: > >>> That in practice you need some margin, in addition to the theoretical >>> limit, of course; but that has nothing to do with the OP's question >>> (mathematically, if you sample a 1000 Hz sinusoid at exactly >>> 2000.0000000000000000000000000000000000000000000000000000001 Hz, you >>> can reconstruct the signal *perfectly and uniquely* --- of course, >>> mathematically only; no practical application would possibly be >>> able to deal with that). >> >> True, but it will take you as long to resolve that component as it >> would to resolve >> 0.00000000000000000000000000000000000000000000000000000005 Hz, and >> that is probably more seconds than you prefer to wait. > > Wait --- if we're talking in the strict mathematical sense, it does > take you an infinity of time, in the non-causal sense (i.e., you need > all the samples, from -oo to +oo to reconstruct). > > In the practical sense, things are as you (and Robert) point out; but > then, notice that I did mention that no useful practical application > would possibly be able to deal with such situation.
Robert and I wanted to drive home the often-overlooked point that it takes just as long to recognize the existence of a component at Fs/2-delta as it does to recognize one at delta. When delta is a very small frequency, 1/delta is a very long time. The long time at the lower limit is usually understood, but the same time at the upper limit is often overlooked. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Carlos Moreno wrote:
(someone wrote)

>> You should normally use a much higher sampling frequency >> (let's say five times or more the highest frequency of your wave).
> This is ridiculous --- is 44.1 kHz five times the bandwidth of the > audio signals on CDs?
Not too far off. As I understand it, the highest key on the piano is around 5kHz, and that isn't used all that often. Even with harmonics, you won't find much above 8.82kHz. It is one of the reasons digital audio works as well as it does. That said, a CD player should be able to reproduce a 20kHz sine. -- glen
glen herrmannsfeldt wrote:
> Carlos Moreno wrote: > (someone wrote) > >>> You should normally use a much higher sampling frequency >>> (let's say five times or more the highest frequency of your wave). > >> This is ridiculous --- is 44.1 kHz five times the bandwidth of the >> audio signals on CDs? > > Not too far off. As I understand it, the highest key on the piano > is around 5kHz, and that isn't used all that often. Even with > harmonics, you won't find much above 8.82kHz. It is one of the reasons > digital audio works as well as it does. > > That said, a CD player should be able to reproduce a 20kHz sine.
Forget piano or any other instrument. What is the frequency range that a 44.1 KHz CD can reproduce? There is a spec, and most CDs meet it. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
glen herrmannsfeldt wrote:

>>> You should normally use a much higher sampling frequency >>> (let's say five times or more the highest frequency of your wave). > >> This is ridiculous --- is 44.1 kHz five times the bandwidth of the >> audio signals on CDs? > > Not too far off.
Oh no, it is quite far off !!!
> As I understand it, the highest key on the piano > is around 5kHz, and that isn't used all that often.
You probably understand *the piano* well (I'm not sure about the exact numbers, but it sounds like it may be right), but this is entirely irrelevant: CDs were not created to record and reproduce single keystrokes of a piano. If you decide to record a single musical note being the lowest note of a Tuba, with 18dB/octave low-pass filter, that's your choice --- but it does not change the capabilities of the CD, and it certainly would not be acceptable as an argument in favor of the idea that the sampling rate is indeed about five times the bandwidth (the "that said" clarification actually makes it worse!!) Percussive instruments, for instance (drums, bells) have very high amounts of harmonics in the 10 to 20 kHz range. The thing is, as Jerry said, CDs reproduce a given bandwidth. Period. The sampling rate is much *much* less than five times the bandwidth. Carlos --
Jerry Avins wrote:

> glen herrmannsfeldt wrote: > >> Carlos Moreno wrote:
(snip)
>>> This is ridiculous --- is 44.1 kHz five times the bandwidth >>> of the audio signals on CDs?
>> Not too far off. As I understand it, the highest key on the piano >> is around 5kHz, and that isn't used all that often. Even with >> harmonics, you won't find much above 8.82kHz. It is one of the reasons >> digital audio works as well as it does.
(snip)
> Forget piano or any other instrument. What is the frequency range that a > 44.1 KHz CD can reproduce? There is a spec, and most CDs meet it.
I used to read stories about audiophiles who hated the non-musical sound of digital audio, and especially CDs. There was for a while renewed interest in direct to disk vinyl records to avoid that effect. (And also vacuum tube amplifiers.) I might believe that with some kinds of pure test tones one could hear the remaining non-linearities in the filters of CD players. I have a much harder time believing it for musical signals. Maybe that will help understand my post, even if you don't believe it. -- glen
glen herrmannsfeldt wrote:
> Jerry Avins wrote: > >> glen herrmannsfeldt wrote: >> >>> Carlos Moreno wrote: > (snip) >>>> This is ridiculous --- is 44.1 kHz five times the bandwidth >>>> of the audio signals on CDs? > >>> Not too far off. As I understand it, the highest key on the piano >>> is around 5kHz, and that isn't used all that often. Even with >>> harmonics, you won't find much above 8.82kHz. It is one of the reasons >>> digital audio works as well as it does. > (snip) > >> Forget piano or any other instrument. What is the frequency range that a >> 44.1 KHz CD can reproduce? There is a spec, and most CDs meet it. > > I used to read stories about audiophiles who hated the non-musical > sound of digital audio, and especially CDs. There was for a while > renewed interest in direct to disk vinyl records to avoid that > effect. (And also vacuum tube amplifiers.)
I never heard of those perceived shortcomings being substantiated on blind tests.
> I might believe that with some kinds of pure test tones one could hear > the remaining non-linearities in the filters of CD players. I have > a much harder time believing it for musical signals. > > Maybe that will help understand my post, even if you don't believe it.
I don't understand it. What is the relation between the highest fundamental that a piano can produce and the highest frequency that a CD can reproduce? For the low piano strings, seventh and eleventh harmonics, if not suppressed, contribute to "roughness" in the note. It's nearly impossible to make a struck string that displays fewer than five overtones. Neither vinyl nor CD reproduce all the overtones of upper piano strings. That's OK because we can't hear them anyhow. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������