FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
5990 Discussions

Problem Using FIR ip core 9.0

Honored Contributor II


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? 


0 Kudos
3 Replies
Honored Contributor II

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.
Honored Contributor II


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! 

Honored Contributor II

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?