Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Help requested with FIR/IIR filters please

Hi,

I am presently using the FIR filter ip wizard in my project and have found that I am using a lot of resources and power to acheive my requirements. I have been told that IIR filters are much less hungry in both power and logic resources.

I would like to try an IIR filter but I havent found an easy way of implementing it yet.

Please could anyone give me some advice?

My sample rate is 200MSPS (fixed) , and I require the following filters:

500kHz

1MHz

2MHz

3MHz

4MHz

5MHz

7.5MHz

10MHz

I am comfortable doing the 5 highest frequencies using a coefficient value of 64. However, I have found that to implement the lower frequency filters, I require upto approximately 500 coefficients. This uses an excessive amount of power and resources.

I am using a Cyclone III EP3C120.

Thanks.

Dave

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    i'm not sure you'll get an IIR up to 200 MHz in a CIII, unfortunately.

    a down sampling FIR won't meet your requirements? 200 MHz / 50 kHz = 400, you can build a 400 tap filter with 1 multiplier (assuming signed 18x18-bit multiplication), or 800 taps with 2 multipliers.

    you could also try a CIC filter which is commonly used in cases with very large changes in sample rate.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi,

    My sample rate is 200MSPS (fixed) , and I require the following filters:

    500kHz

    1MHz

    2MHz

    3MHz

    4MHz

    5MHz

    7.5MHz

    10MHz

    --- Quote End ---

    Your filter(s) spec is not clear:

    First what is your filter input frequency content and input sampling rate?

    second: do you mean 10MHz,7.5MHz etc. as cutoff points or required sampling frequency? Do you mean one variable filter or multiband filter or several filters each with its cutoff?

    Third: are you concerned about non-linear phase?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I understand, that input sampling rate is one of the few clear specifications (200 MSPS). Downsampling seems to be an obvious first step. But input frequency content and intended filter characteristic must be known to decide about a suitable decimation filter. I guess, that a CIC filter (order and downsampling factor depend on...) is an economic way. After downsampling a FIR filter gets much more handy, but IIR is an option as well. The latter is preferable for lower resource count, if only basic filter specifications have to be met.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    First of all thanks for the help and sorry about the poor spec.

    My sample rate is 200MSPS / 200MHz.

    I am dealing with pipolar data which is filtered with a 40MHz low pass analog filter prior to digitization.

    The data is then 'rectified' prior to this filter which is as follows

    The filter is a low pass filter with a choice of different corner frequencies

    500kHz

    1MHz

    2MHz

    3MHz

    4MHz

    5MHz

    7.5MHz

    10MHz

    at the moment I'm using one wizard generated FIR to do the job with eight different sets of coefficients.

    After filtration the data is displayed on a screen and it is kind of nice to be able to see the wave in fine detail (the envelope is important) so ideally we did not want to drop the sample rate unless we had to.

    Thanks 'thepancake', I sort of thought that IIR might not be the answer for my sample rate. I guess that FIRs run faster because the next output sample only depends on previous input samples and therefore can be easily pipelined? IIRs on the other hand depend on the output as well as the input so dont pipeline so well? Please correct me if i'm wrong.

    Thanks 'Kaz', sorry about the spec. I hope thats cleared up now. I think I would prefer 'linear phase' if I understand the term correctly. I need to measure the time to from the start to certain points on the rectified / filtered envelope and I have noticed that the FIR filter has a nice fixed delay through it no matter what cutoff frequency I select.

    Thanks 'FVM' I am a bit of a beginner when it comes to DSP so I'll look at the CIC filter as you suggest. I would love to use IIR for one reason. The delay through the filter is very short. I guess I'll never get one to run at 200MHz.

    So far it looks as if i need to compromise a bit, maybe using a 60 tap FIR but after variable decimation. If I set the filter to run at 200MSPS, 100MSPS, 50MSPS i can choose say four cutoffs to be 10MHz, 7.5MHz, 5MHz, 4MHz at 200MSPS. I guest this would give me 5MHz, 3.75MHz, 2.5MHz, 2MHz at 100MSPS, etc etc. This would not be ideal because it would mean dropping the display resolution. Does this seem a good idea? or does anyone know better.

    Thanks again for the help its very useful

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    A starting point would be to directly decimate the input signal to 100Msps without overheads i.e. by just discarding every other sample. Since your analogue signal is filtered down to 40MHz then 100Msps is enough without any sampling rule violation. This should not affect the information content.

    Thus you can do all filtering at 100Msps. Any further decimation has to take into account the aliasing that may result. So you can't just go down without prior filter.

    You may also consider using one set of coefficients(maximum) then decimate the set to get your corner frequency
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you're right about the FIR running fast because of the easy pipelining.

    regarding linear phase, it will give you the most accurate wave shape which seems useful in your application. a consequence of linear phase is the undesirable delay you mention that does not happen with a (minimum phase) IIR filter. that said you could design a minimum phase FIR (less delay) but the wave shape would not be preserved as well as a linear phase FIR. you can also build a near-linear phase IIR which would have a similar delay to the FIR, but would preserve the wave shape.