DSPRelated.com
Forums

multirate implementation problem

Started by praveen June 26, 2003
Hello,
How to implement Multirate filtering on a DSP. My problem is how to
have a flow in my code, How should the loop of the code be. This
because my data is coming at a higher rate (4 MHz) and i am
downsampling to slower rate (i.e 500 kHz). so there is no continous
flow.

Any suggestion or reference will be great
with regards
praveen
praveen wrote:
> > Hello, > How to implement Multirate filtering on a DSP. My problem is how to > have a flow in my code, How should the loop of the code be. This > because my data is coming at a higher rate (4 MHz) and i am > downsampling to slower rate (i.e 500 kHz). so there is no continous > flow.
I schedule these sorts of jobs by checking that I have enough data in the input buffer to bother with, and enough space in the output buffer to save the results. If those two conditions are met, I call the processing function that transforms the input data into output data. It runs until it either uses all the input data it has, or it runs out of space to store the output data. You'll need separate routines to acquire the input data and issue the output data. These are often done as part of an interrupt service routine. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (703) 779-7770 The sooner you get behind, the more time you'll have to catch up
Design an FIR filter, with a sample rate of 4 Mhz and cutoff of 250
kHz.  Every 8th new sample, calculated the FIR output ( but keep
buffering the inputs every sample ).  

There, now you have a continuous flow at 500 kHz.

Regards,

Robert

www.gldsp.com

praveenkumar1979@rediffmail.com (praveen) wrote:

>Hello, >How to implement Multirate filtering on a DSP. My problem is how to >have a flow in my code, How should the loop of the code be. This >because my data is coming at a higher rate (4 MHz) and i am >downsampling to slower rate (i.e 500 kHz). so there is no continous >flow. > >Any suggestion or reference will be great >with regards >praveen
( modify address for return email ) www.numbersusa.com www.americanpatrol.com
Kind of crude description of an approach:

// number of input samples avail is increased as the samples arrive
(possibly in ISR),
// and is decremented as they are used up in loop below.

while(1)
    if (number of input samples avail >= 8)
    {
        generate 1 sample out;
        reduce number of input samples avail by 8;
    }



Dirk

Dirk A. Bell
DSP Consultant

"praveen" <praveenkumar1979@rediffmail.com> wrote in message
news:ff8a3afb.0306260428.611aee6f@posting.google.com...
> Hello, > How to implement Multirate filtering on a DSP. My problem is how to > have a flow in my code, How should the loop of the code be. This > because my data is coming at a higher rate (4 MHz) and i am > downsampling to slower rate (i.e 500 kHz). so there is no continous > flow. > > Any suggestion or reference will be great > with regards > praveen