Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Decimation design

There are 10 messages in this thread.

You are currently looking at messages 0 to 10.


Decimation design - seb - 2004-03-27 16:55:00

Hello,

I am looking for good advices about my design.

I am working with an ADC which work beetween 1kHz and 2kHz but the
application need data sampled beetween 10 Hz and 2 kHz. So i decide to
make decimation in order to get the sample frequence beetween 10Hz and
1 kHz. But in order to do it in the rigth way i make pre-filtering in
order to avoid aliasing.

So the decimation factor could be as high as 100 (1kHz to 10 Hz). So i
need to store 100 FIR filter, one for 2-decimation , one for
3-decimation and so on.
I need 100 FIR filter and the one use to obtain the 10 Hz has an order
of 700 (wp = 5 Hz, ws = 10 Hz) !!!

I am sure there are some more elegant solution.....
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Jerry Avins - 2004-03-27 17:44:00



seb wrote:

> Hello,
> 
> I am looking for good advices about my design.
> 
> I am working with an ADC which work beetween 1kHz and 2kHz but the
> application need data sampled beetween 10 Hz and 2 kHz. So i decide to
> make decimation in order to get the sample frequence beetween 10Hz and
> 1 kHz. But in order to do it in the rigth way i make pre-filtering in
> order to avoid aliasing.
> 
> So the decimation factor could be as high as 100 (1kHz to 10 Hz). So i
> need to store 100 FIR filter, one for 2-decimation , one for
> 3-decimation and so on.
> I need 100 FIR filter and the one use to obtain the 10 Hz has an order
> of 700 (wp = 5 Hz, ws = 10 Hz) !!!
> 
> I am sure there are some more elegant solution.....

Are you saying that you need 2 KHz signals, but your ADC only works up 
to 2 KHz? That can't be done. The analog input to the ADC must not 
contain any frequencies as high as half the sample rate?

What did you plan to decimate? I don't understand the rest of what you 
want to do at all.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - seb - 2004-03-28 10:24:00

Jerry Avins <j...@ieee.org> wrote in message news:<406603e3$0$3044$6...@news.rcn.com>...
> seb wrote:
> 
> > Hello,
> > 
> > I am looking for good advices about my design.
> > 
> > I am working with an ADC which work beetween 1kHz and 2kHz but the
> > application need data sampled beetween 10 Hz and 2 kHz. So i decide to
> > make decimation in order to get the sample frequence beetween 10Hz and
> > 1 kHz. But in order to do it in the rigth way i make pre-filtering in
> > order to avoid aliasing.
> > 
> > So the decimation factor could be as high as 100 (1kHz to 10 Hz). So i
> > need to store 100 FIR filter, one for 2-decimation , one for
> > 3-decimation and so on.
> > I need 100 FIR filter and the one use to obtain the 10 Hz has an order
> > of 700 (wp = 5 Hz, ws = 10 Hz) !!!
> > 
> > I am sure there are some more elegant solution.....
> 
> Are you saying that you need 2 KHz signals, but your ADC only works up 
> to 2 KHz? That can't be done. The analog input to the ADC must not 
> contain any frequencies as high as half the sample rate?
> 
> What did you plan to decimate? I don't understand the rest of what you 
> want to do at all.
> 
> Jerry


Hello,

The ADC i use can not sampled below 1 kHz but the application need
signal samped for 10 Hz to 2 kHz. So when i need the input signal to
be sampled at 1.5 kHz, i need nothing but just configure the ADC to
work at 1.5 kHz. However, when i need 500 Hz, i configured the ADC to
work at 1 kHz and decimate by 2. When i need 254 Hz, i configured the
ADC to work at 1016 Hz and decimate by 4. When i need 11 Hz, i
configured the ADC to work at 1100 Hz and decimate by 100. And so on.

So i need 100 FIR filter, one for each decimation factor.

Think for advices
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Jerry Avins - 2004-03-28 11:40:00

seb wrote:

> Jerry Avins <j...@ieee.org> wrote in message news:<406603e3$0$3044$6...@news.rcn.com>...
> 
>>seb wrote:
>>
>>
>>>Hello,
>>>
>>>I am looking for good advices about my design.
>>>
>>>I am working with an ADC which work beetween 1kHz and 2kHz but the
>>>application need data sampled beetween 10 Hz and 2 kHz. So i decide to
>>>make decimation in order to get the sample frequence beetween 10Hz and
>>>1 kHz. But in order to do it in the rigth way i make pre-filtering in
>>>order to avoid aliasing.
>>>
>>>So the decimation factor could be as high as 100 (1kHz to 10 Hz). So i
>>>need to store 100 FIR filter, one for 2-decimation , one for
>>>3-decimation and so on.
>>>I need 100 FIR filter and the one use to obtain the 10 Hz has an order
>>>of 700 (wp = 5 Hz, ws = 10 Hz) !!!
>>>
>>>I am sure there are some more elegant solution.....
>>
>>Are you saying that you need 2 KHz signals, but your ADC only works up 
>>to 2 KHz? That can't be done. The analog input to the ADC must not 
>>contain any frequencies as high as half the sample rate?
>>
>>What did you plan to decimate? I don't understand the rest of what you 
>>want to do at all.
>>
>>Jerry
> 
> 
> 
> Hello,
> 
> The ADC i use can not sampled below 1 kHz but the application need
> signal samped for 10 Hz to 2 kHz. So when i need the input signal to
> be sampled at 1.5 kHz, i need nothing but just configure the ADC to
> work at 1.5 kHz. However, when i need 500 Hz, i configured the ADC to
> work at 1 kHz and decimate by 2. When i need 254 Hz, i configured the
> ADC to work at 1016 Hz and decimate by 4. When i need 11 Hz, i
> configured the ADC to work at 1100 Hz and decimate by 100. And so on.
> 
> So i need 100 FIR filter, one for each decimation factor.
> 
> Think for advices

Seb,

I don't know what you want to accomplish, but it's not hard to guess
that there might be an easier way to accomplish it. For example, when
you need 254 samples per second, you can simply take samples at the 1016
rate and keep only every fourth one without any filter at all. Of
course, a waveform that you sample 254 times per second may have no
components as high as 508 Hz. If hither frequencies are present, you
must either filter them out before hand, or sample at a higher rate and
then decimate with filtering.

If you describe what you want to do in addition to some of the steps you
think you need in doing it, you can get better help.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Ronald H. Nicholson Jr. - 2004-03-28 14:51:00

In article <4066ffe9$0$3040$6...@news.rcn.com>,
Jerry Avins  <j...@ieee.org> wrote:
>, or sample at a higher rate and then decimate with filtering.

That is what it sounds like he wants to do.  But his sampling rate is a
variable 1X to 100X higher than the data rate he wants.  And his comments
make it sound like simple subsampling will cause aliasing.  Whether he
cares about any aliasing in the original sampling is not part of his
question.

A set of multistage decimating filters of various factors might be a
good solution, unless he really needs exact prime number scale factors.


IMHO. YMMV.
-- 
Ron Nicholson   rhn AT nicholson DOT com   http://www.nicholson.com/rhn/ 
#include <canonical.disclaimer>        // only my own opinions, etc.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Jerry Avins - 2004-03-28 20:50:00

Ronald H. Nicholson Jr. wrote:

> In article <4066ffe9$0$3040$6...@news.rcn.com>,
> Jerry Avins  <j...@ieee.org> wrote:
> 
>>, or sample at a higher rate and then decimate with filtering.
> 
> 
> That is what it sounds like he wants to do.  But his sampling rate is a
> variable 1X to 100X higher than the data rate he wants.  And his comments
> make it sound like simple subsampling will cause aliasing.  Whether he
> cares about any aliasing in the original sampling is not part of his
> question.
> 
> A set of multistage decimating filters of various factors might be a
> good solution, unless he really needs exact prime number scale factors.
> 
> 
> IMHO. YMMV.

I can guess several possible scenarios, but if I know what he wants, I
can be more specific. There's no point in us conversing with each other.
I suspect that his needs can be met with half a dozen filters or fewer.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Bhaskar Thiagarajan - 2004-03-29 12:27:00

"seb" <g...@yahoo.fr> wrote in message
news:2...@posting.google.com...
> Hello,
>
> I am looking for good advices about my design.
>
> I am working with an ADC which work beetween 1kHz and 2kHz but the
> application need data sampled beetween 10 Hz and 2 kHz. So i decide to
> make decimation in order to get the sample frequence beetween 10Hz and
> 1 kHz. But in order to do it in the rigth way i make pre-filtering in
> order to avoid aliasing.
>
> So the decimation factor could be as high as 100 (1kHz to 10 Hz). So i
> need to store 100 FIR filter, one for 2-decimation , one for
> 3-decimation and so on.
> I need 100 FIR filter and the one use to obtain the 10 Hz has an order
> of 700 (wp = 5 Hz, ws = 10 Hz) !!!
>
> I am sure there are some more elegant solution.....

Here is a much simpler way to handle your various decimations.
You design *one* half band filter. Use this filter for every decimation by 2
step.
So if you need a decimation by 8, you'd repeat the decimation by 2 three
times using the same filter.
You *might* need a 'cleanup' filter at the end of your decimation but I
don't know the requirements of your final decimated signal.
If there are cases where your decimation isn't a multiple of 2, then you can
handle those as special cases and create filters for them.
There are possibly even more elegant ways, but without knowing your exact
requirements it's hard to provide alternatives.

Cheers
Bhaskar


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Jim Thomas - 2004-03-29 13:56:00

Bhaskar Thiagarajan wrote:
> Here is a much simpler way to handle your various decimations.
> You design *one* half band filter. Use this filter for every decimation by 2
> step.
> So if you need a decimation by 8, you'd repeat the decimation by 2 three
> times using the same filter.
> You *might* need a 'cleanup' filter at the end of your decimation but I
> don't know the requirements of your final decimated signal.
> If there are cases where your decimation isn't a multiple of 2, then you can
> handle those as special cases and create filters for them.
> There are possibly even more elegant ways, but without knowing your exact
> requirements it's hard to provide alternatives.

I suppose that having a filter for all the primes less than 100 would 
treat all the cases.  In other words, filters to decimate by 2,3,5,7,11, 
...  97.  There are only 25 primes less than 100.  Then when you want to 
decimate by N, factor N into primes and decimate by those filters.

You could also calculate the required filter coefs on the fly as 
required, and write a decimator and a coef generator that take N as an 
argument.

-- 
Jim Thomas            Principal Applications Engineer  Bittware, Inc
j...@bittware.com  http://www.bittware.com          (703) 779-7770
The secret to enjoying your job is to have a hobby that's even worse
   - Calvin's Dad
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - seb - 2004-03-29 19:27:00

Jim Thomas <j...@bittware.com> wrote in message news:<1...@corp.supernews.com>...
> Bhaskar Thiagarajan wrote:
> > Here is a much simpler way to handle your various decimations.
> > You design *one* half band filter. Use this filter for every decimation by 2
> > step.
> > So if you need a decimation by 8, you'd repeat the decimation by 2 three
> > times using the same filter.
> > You *might* need a 'cleanup' filter at the end of your decimation but I
> > don't know the requirements of your final decimated signal.
> > If there are cases where your decimation isn't a multiple of 2, then you can
> > handle those as special cases and create filters for them.
> > There are possibly even more elegant ways, but without knowing your exact
> > requirements it's hard to provide alternatives.
> 
> I suppose that having a filter for all the primes less than 100 would 
> treat all the cases.  In other words, filters to decimate by 2,3,5,7,11, 
> ...  97.  There are only 25 primes less than 100.  Then when you want to 
> decimate by N, factor N into primes and decimate by those filters.
> 
It is a very good idea.

> You could also calculate the required filter coefs on the fly as 
> required, and write a decimator and a coef generator that take N as an 
> argument.

But i am afraid about calculate filter on the fly. I know there is
some code to compute equiripple FIR filter (Remez Exchange algorithm)
but i do not know if this code is good and not bugged.

Think.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Decimation design - Ray Andraka - 2004-03-31 01:07:00

Actually, with successive decimation by 2 the earlier filters (which are the
higher rate ones, and therefore the more expensive ones in terms of processing)
can be less stringent.  Goodman and Carey published a paper in the 70's on a set
of halfband decimation filters and a procedure for using them in such a way as
to make the higher rates ones simpler.  We are talking about filters with less
than 19 taps here folks, and half of those taps are 0.  The first filter can be
a simple moving average filter, and in fact for wide decimation ratios, a CIC
filter fits the bill there very nicely.  The advantage of a CIC decimating
filter is that the shape of the filter referred to the output sample rate is
pretty much independent of the decimation ratio for decimation ratios greater
than about 10.

Typically, you'd use a CIC followed possibly by some number of half-band filters
and then a FIR clean-up filter that corrects any 'droop' in the passband and
sharpens up the transition.  the CIC is normally selected to have its first null
at several times the cut-off of the composite filter.  It is a bit tougher when
your minimum decimation is only 2 because of the shape of the CIC.



Bhaskar Thiagarajan wrote:

> "seb" <g...@yahoo.fr> wrote in message
> news:2...@posting.google.com...
> > Hello,
> >
> > I am looking for good advices about my design.
> >
> > I am working with an ADC which work beetween 1kHz and 2kHz but the
> > application need data sampled beetween 10 Hz and 2 kHz. So i decide to
> > make decimation in order to get the sample frequence beetween 10Hz and
> > 1 kHz. But in order to do it in the rigth way i make pre-filtering in
> > order to avoid aliasing.
> >
> > So the decimation factor could be as high as 100 (1kHz to 10 Hz). So i
> > need to store 100 FIR filter, one for 2-decimation , one for
> > 3-decimation and so on.
> > I need 100 FIR filter and the one use to obtain the 10 Hz has an order
> > of 700 (wp = 5 Hz, ws = 10 Hz) !!!
> >
> > I am sure there are some more elegant solution.....
>
> Here is a much simpler way to handle your various decimations.
> You design *one* half band filter. Use this filter for every decimation by 2
> step.
> So if you need a decimation by 8, you'd repeat the decimation by 2 three
> times using the same filter.
> You *might* need a 'cleanup' filter at the end of your decimation but I
> don't know the requirements of your final decimated signal.
> If there are cases where your decimation isn't a multiple of 2, then you can
> handle those as special cases and create filters for them.
> There are possibly even more elegant ways, but without knowing your exact
> requirements it's hard to provide alternatives.
>
> Cheers
> Bhaskar

--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930     Fax 401/884-7950
email r...@andraka.com
http://www.andraka.com

 "They that give up essential liberty to obtain a little
  temporary safety deserve neither liberty nor safety."
                                          -Benjamin Franklin, 1759


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.