DSPRelated.com
Forums

How to perform efficient sampling

Started by renaudin December 19, 2005
Why use multiple sampling rates? The most important reason is for
efficiency of calculation and/or memory. But what is the lowest sampling
rate possible? Well, the Nyquist theorem tells us that the sampling rate
must be at least twice the bandwidth of the signal. Therefore, for maximum
efficiency, you would like to do DSP processing at a rate which is a small
multiple of the signal bandwidth. 

Infact I have an oversampled signal and I want to efficiently decimate it
to come to the Nyquist sampling rate. 
 
The problem is matching the sampling rate to the bandwidth of the signal
at each stage of processing?

One hint is the use of Bernstein Inequality, which is applicable for a
sinosoid.

|d(x)/dt|<= 2*pi*A*f_max(i).................(1)

In expression-1, 'A' is amplitude dynamics of the oversampled signal. The
term on left hand side is the slope of the signal and f_max(i) is the
bandwidth of signal at one stage. 
 
Thanks for the ideas!
renaudin





"renaudin" <alsaeed86@gmail.com> wrote in message
news:v5SdnccdxoU1eTveRVn-sg@giganews.com...
> Why use multiple sampling rates? The most important reason is for > efficiency of calculation and/or memory. But what is the lowest sampling > rate possible? Well, the Nyquist theorem tells us that the sampling rate > must be at least twice the bandwidth of the signal. Therefore, for maximum > efficiency, you would like to do DSP processing at a rate which is a small > multiple of the signal bandwidth. > > Infact I have an oversampled signal and I want to efficiently decimate it > to come to the Nyquist sampling rate. > > The problem is matching the sampling rate to the bandwidth of the signal > at each stage of processing? > > One hint is the use of Bernstein Inequality, which is applicable for a > sinosoid. > > |d(x)/dt|<= 2*pi*A*f_max(i).................(1) > > In expression-1, 'A' is amplitude dynamics of the oversampled signal. The > term on left hand side is the slope of the signal and f_max(i) is the > bandwidth of signal at one stage. > > Thanks for the ideas! > renaudin
Hi, I'm sorry but I didn't catch the question in your post - seems like you were making statements. If you are wondering why oversample, here are a few reasons - your hardware used for sampling is not flexible enough to change sample rates to match your needs. - it is desirable to do some oversampling to allow for an easier anti-alias filter ahead of the ADC - oversampling and decimation in the digital domain allows for improvement in the SNR of the signal. Cheers Bhaskar
"renaudin" <alsaeed86@gmail.com> wrote in message 
news:v5SdnccdxoU1eTveRVn-sg@giganews.com...
> Why use multiple sampling rates? The most important reason is for > efficiency of calculation and/or memory. But what is the lowest sampling > rate possible? Well, the Nyquist theorem tells us that the sampling rate > must be at least twice the bandwidth of the signal. Therefore, for maximum > efficiency, you would like to do DSP processing at a rate which is a small > multiple of the signal bandwidth. > > Infact I have an oversampled signal and I want to efficiently decimate it > to come to the Nyquist sampling rate. > > The problem is matching the sampling rate to the bandwidth of the signal > at each stage of processing? > > One hint is the use of Bernstein Inequality, which is applicable for a > sinosoid. > > |d(x)/dt|<= 2*pi*A*f_max(i).................(1) > > In expression-1, 'A' is amplitude dynamics of the oversampled signal. The > term on left hand side is the slope of the signal and f_max(i) is the > bandwidth of signal at one stage.
Generally the problem is that you don't know "A" or "f" or that the signal is a sinusoid - for which the expression applies. It won't work for a composite signal. For example, what if there are 3 sinusoids of similar frequency all with amplitude A. That could look the same as a single sinusoid of amplitude A at 3x the frequency - at a point where the maximum slopes of the 3 sinusoids are aligned. But, if you know the dynamic range of the signal then you might imply something from the maximum slope I guess - because the maximum composite amplitude is known. I don't really know. As you said: The problem is matching the sampling rate to the bandwidth of the signal at each stage of processing. Assuming that the signal is oversampled to begin with there are a couple of approaches you might take in reducing the sample rate: 1) Check the effective bandwidth with a Fourier Transform and go from there. 2) Lowpass filter the data prior to decimation or as part of a normal decimation process. Decimation by a factor of 2 might look like this: Lowpass filter to something below fs/4. Decimate by 2. Result, bandwidth less than the *new* fs/2. Look at half-band filters for this purpose. Only compute the outputs at the new, lower, sample rate. Fred
> >"renaudin" <alsaeed86@gmail.com> wrote in message >news:v5SdnccdxoU1eTveRVn-sg@giganews.com... >> Why use multiple sampling rates? The most important reason is for >> efficiency of calculation and/or memory. But what is the lowest
sampling
>> rate possible? Well, the Nyquist theorem tells us that the sampling
rate
>> must be at least twice the bandwidth of the signal. Therefore, for
maximum
>> efficiency, you would like to do DSP processing at a rate which is a
small
>> multiple of the signal bandwidth. >> >> Infact I have an oversampled signal and I want to efficiently decimate
it
>> to come to the Nyquist sampling rate. >> >> The problem is matching the sampling rate to the bandwidth of the
signal
>> at each stage of processing? >> >> One hint is the use of Bernstein Inequality, which is applicable for a >> sinosoid. >> >> |d(x)/dt|<= 2*pi*A*f_max(i).................(1) >> >> In expression-1, 'A' is amplitude dynamics of the oversampled signal.
The
>> term on left hand side is the slope of the signal and f_max(i) is the >> bandwidth of signal at one stage. > >Generally the problem is that you don't know "A" or "f" or that the
signal
>is a sinusoid - for which the expression applies. It won't work for a >composite signal. For example, what if there are 3 sinusoids of similar
>frequency all with amplitude A. That could look the same as a single >sinusoid of amplitude A at 3x the frequency - at a point where the
maximum
>slopes of the 3 sinusoids are aligned. >But, if you know the dynamic range of the signal then you might imply >something from the maximum slope I guess - because the maximum composite
>amplitude is known. I don't really know. > >As you said: >The problem is matching the sampling rate to the bandwidth of the signal
at
>each stage of processing. > >Assuming that the signal is oversampled to begin with there are a couple
of
>approaches you might take in reducing the sample rate: > >1) Check the effective bandwidth with a Fourier Transform and go from
there.
>2) Lowpass filter the data prior to decimation or as part of a normal >decimation process. > >Decimation by a factor of 2 might look like this: > >Lowpass filter to something below fs/4. Decimate by 2. Result,
bandwidth
>less than the *new* fs/2. Look at half-band filters for this purpose.
Only
>compute the outputs at the new, lower, sample rate. > >Fred >
************************************************************************** Thanks for the ideas, 1. We can find out the effective Bandwidth with a Fourier Transform but this methode requires a lot of computation. 2.Lowpass filter the data prior to decimation process will change its natural Bandwidth, which I donot want to be change. ** I am Searching for a simple and efficient methode to calculate/estimate the natural Bandwidth of a signal. Looking forward for the discussion and ideas. Renaudin
renaudin wrote:
...
> 1. We can find out the effective Bandwidth with a Fourier Transform but > this methode requires a lot of computation.
I didn't understand your orginial question. It seems now that you have a signal which you think is oversampled, but you don't know by how much.
> ** I am Searching for a simple and efficient methode to calculate/estimate > the natural Bandwidth of a signal. > > Looking forward for the discussion and ideas.
An FFT-based approach wouldn't be the worst idea for this. Since you don't know to what frequency your signal is bandlimited, you need some sort of filter bank to estimate the energy of high frequency bands of your signal. FFT would be an efficient way to compute this. Depending on the required accuracy of the bandwidth estimate, a bunch of IIR bandpass filters could be cheaper. Regards, Andor
abariska@student.ethz.ch wrote:
> renaudin wrote: > ... > >>1. We can find out the effective Bandwidth with a Fourier Transform but >>this methode requires a lot of computation. > > > I didn't understand your orginial question. It seems now that you have > a signal which you think is oversampled, but you don't know by how > much. > > >>** I am Searching for a simple and efficient methode to calculate/estimate >>the natural Bandwidth of a signal. >> >>Looking forward for the discussion and ideas. > > > An FFT-based approach wouldn't be the worst idea for this. Since you > don't know to what frequency your signal is bandlimited, you need some > sort of filter bank to estimate the energy of high frequency bands of > your signal. FFT would be an efficient way to compute this. Depending > on the required accuracy of the bandwidth estimate, a bunch of IIR > bandpass filters could be cheaper.
The /potential/ bandwidth of the signal is half the sample rate. How much is gained by knowing the actual bandwidth *at a particular time*? Analyzing the signal source is the only way to know by how much the maximum possible bandwidth is less than the potential bandwidth. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
renaudin wrote:
> > > >"renaudin" <alsaeed86@gmail.com> wrote in message > >news:v5SdnccdxoU1eTveRVn-sg@giganews.com... > >> Why use multiple sampling rates? The most important reason is for > >> efficiency of calculation and/or memory. But what is the lowest > sampling > >> rate possible? Well, the Nyquist theorem tells us that the sampling > rate > >> must be at least twice the bandwidth of the signal. Therefore, for > maximum > >> efficiency, you would like to do DSP processing at a rate which is a > small > >> multiple of the signal bandwidth. > >> > >> Infact I have an oversampled signal and I want to efficiently decimate > it > >> to come to the Nyquist sampling rate. > >> > >> The problem is matching the sampling rate to the bandwidth of the > signal > >> at each stage of processing? > >> > >> One hint is the use of Bernstein Inequality, which is applicable for a > >> sinosoid. > >> > >> |d(x)/dt|<= 2*pi*A*f_max(i).................(1) > >> > >> In expression-1, 'A' is amplitude dynamics of the oversampled signal. > The > >> term on left hand side is the slope of the signal and f_max(i) is the > >> bandwidth of signal at one stage. > > > >Generally the problem is that you don't know "A" or "f" or that the > signal > >is a sinusoid - for which the expression applies. It won't work for a > >composite signal. For example, what if there are 3 sinusoids of similar > > >frequency all with amplitude A. That could look the same as a single > >sinusoid of amplitude A at 3x the frequency - at a point where the > maximum > >slopes of the 3 sinusoids are aligned. > >But, if you know the dynamic range of the signal then you might imply > >something from the maximum slope I guess - because the maximum composite > > >amplitude is known. I don't really know. > > > >As you said: > >The problem is matching the sampling rate to the bandwidth of the signal > at > >each stage of processing. > > > >Assuming that the signal is oversampled to begin with there are a couple > of > >approaches you might take in reducing the sample rate: > > > >1) Check the effective bandwidth with a Fourier Transform and go from > there. > >2) Lowpass filter the data prior to decimation or as part of a normal > >decimation process. > > > >Decimation by a factor of 2 might look like this: > > > >Lowpass filter to something below fs/4. Decimate by 2. Result, > bandwidth > >less than the *new* fs/2. Look at half-band filters for this purpose. > Only > >compute the outputs at the new, lower, sample rate. > > > >Fred > > > ************************************************************************** > > Thanks for the ideas, > > 1. We can find out the effective Bandwidth with a Fourier Transform but > this methode requires a lot of computation. > > 2.Lowpass filter the data prior to decimation process will change its > natural Bandwidth, which I donot want to be change. > > ** I am Searching for a simple and efficient methode to calculate/estimate > the natural Bandwidth of a signal. > > Looking forward for the discussion and ideas. > > Renaudin
(Disclaimer : I'm a newbie) If I was you, i'd go for a FFT. Define a trigger amount of data you can do without (like for example 1%, however I wouldn't know how to determine that with a sound), and look for the real and imaginary parts from the top (i mean the highest frequencies) until you went through the trigger amount of data you can get rid of. then, just cut these parts and perform an Inverse FFT (and don't forget to calculate whats the new sampling frequency)
Michel Rouzic wrote:
> Define a trigger amount of data you can > do without (like for example 1%, however I wouldn't know how to > determine that with a sound)
OK, i think I know, but i'm not sure if it would be valid, and i'd risk doin that only in the polar form with the magnitude part. Calculate the sum of all the samples in the magnitude part, and then count down from the top until the sum of the samples you went through divided by the sum of all the magnitude samples equals the trigger percentage
"renaudin" <alsaeed86@gmail.com> wrote in message 
news:y_-dnU6TlqAYHzfeRVn-jg@giganews.com...
>
> 1. We can find out the effective Bandwidth with a Fourier Transform but > this methode requires a lot of computation. > > 2.Lowpass filter the data prior to decimation process will change its > natural Bandwidth, which I donot want to be change. > > ** I am Searching for a simple and efficient methode to calculate/estimate > the natural Bandwidth of a signal. > > Looking forward for the discussion and ideas. > > Renaudin
Well, the lowpass filter in (2) should not change the signal much. If it does then you have no business decimating - unless aliasing is OK for you. In view of how particular your application seems to be, I'd imagine aliasing is not OK. Maybe the way to proceed is to calculate the Fourier coefficients from the high end down and stop when the magnitude becomes "important". Goertzel algorithm? Fred
Jerry Avins wrote:
> abariska@student.ethz.ch wrote: > > renaudin wrote: > > ... > > > >>1. We can find out the effective Bandwidth with a Fourier Transform but > >>this methode requires a lot of computation. > > > > > > I didn't understand your orginial question. It seems now that you have > > a signal which you think is oversampled, but you don't know by how > > much. > > > > > >>** I am Searching for a simple and efficient methode to calculate/estimate > >>the natural Bandwidth of a signal. > >> > >>Looking forward for the discussion and ideas. > > > > > > An FFT-based approach wouldn't be the worst idea for this. Since you > > don't know to what frequency your signal is bandlimited, you need some > > sort of filter bank to estimate the energy of high frequency bands of > > your signal. FFT would be an efficient way to compute this. Depending > > on the required accuracy of the bandwidth estimate, a bunch of IIR > > bandpass filters could be cheaper. > > The /potential/ bandwidth of the signal is half the sample rate. How > much is gained by knowing the actual bandwidth *at a particular time*?
I think that the OP wants to reduce the data rate from a (highly?) oversampled signal. It is my reading of his question that he wants to do this on a frame by frame basis, determine the maximum bandwidth for each frame, and adjust the sample rate accordingly.
> Analyzing the signal source is the only way to know by how much the > maximum possible bandwidth is less than the potential bandwidth.
I think the OP is faced with a signal with varying bandwidth, otherwise a frame-by-frame analysis makes no sense. Regards, Andor