Community
cancel
Showing results for
Did you mean:
Highlighted
Valued Contributor III
695 Views

## Problem Using FIR ip core 9.0

Hello,

I'm trying to implement a band pass filter using FIR Compiler IP Core (ver. 9.0).

My input is a 24 bit signal.

My output should also be 24 bit.

I'm getting 36 bits output from the wizard.

I dont want to distort the signal and I understand that some of the MSB \LSB should be cut with the wizard in order to create 24 bit output.

During simulations I found out that some of the MSB bits are changing simultaneously

i.e. the signal is attanuated. I can restore the signal by truncating this "problematic" MSBs (which is equals to amplifying the output signal).

However, if I change the coefficients set, the number of "problematic" MSBs changes, so that different truncation should be applicated. I need to know how the coefficients sets affect on the output bits so I could find out what should be the correct truncation for every coefficients sets I use.

Can somebody help me plz?

10x!
3 Replies
Highlighted
Valued Contributor III
7 Views

For any filter you need to target unity gain at some ref point. For LPF this ref point is the dc. For HPF it is the .5(Nyquist). For bandpass filter, the best way is to compute the mean power(rms) of filter response within the band then inverse of that should be your filter gain. e.g. if this mean power turns out to be .9 then 1/.9 should be your gain. i.e. multiply coeffs by 1/.9 Whats left is how to scale it for hardware. If your coeffs are 16 bits signed then scale up as follows:

coeff = round(2^15*coeff);

then truncate 15 LSBs and hence any remaining MSBs plus saturation logic.

To get mean power you need to do fft on coeffs or use freqz.
Highlighted
Valued Contributor III
7 Views

Hi,

thank you.

I didn't quite understand how this formula can help me decide how many MSBs and LSBs I need to cut...

and I tried your method and my FIR still attenuates the signal.

Can I please get an example of a Band Pass Filter settings?

thank you very much!

asaf
Highlighted
Valued Contributor III
7 Views

post your coeffs and I will have a look at them. Tell me how many bits are you using for them and will scale it?