• 0
Ahmed Alfadhel

FIR compiler Amplitude

Question

Hi, 

I used FIR filter for my system, and I imported the coefficients form Matlab using FDA tool. 

In matlab (FDA tool), I set the stop band to - 80 dB and the pass band to 0 dB, as indicated in the first attached picture.

But when I opened the coefficients file in Vivado by FIR IP block and checking the frequency response of the filter, the situation was different, as shown in the second attached picture. In fact, the stop band is 50 dB ! and pass band is 125 dB ! I think these are wrong values. How to modify these values in order to be the same as of FDA matlab tool ?

Thanks.

56k FDA.PNG

ampiltude Vivado.JPG

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 1
Posted (edited)

My first guess is that the tool needs to know the position of the decimal point of your number format. It's off by 20 bits (=> 1048576 => 120 dB).

Fixed point knows only integers, so it's a matter of interpretation.

Edited by xc6lx45

Share this post


Link to post
Share on other sites
  • 1
Posted (edited)

Well, I'm not familiar with this particular tool. But at a quick glance, I think you need to set "Quantization" to e.g. "quantize only". Then the field "Coefficient fractional bits" becomes enabled.

If it doesn't fall into place easily, start with a simple example, e.g. import a 0 0 256 0 0 FIR with 8 fractional bits and you should see 0 dB across the frequency response.

 

Hint: for an order-of-magnitude cross-check you can get the DC gain of a FIR filter by summing its coefficients. In your example, this should be around 0.0001 for ~ -80 dB @ 0 Hz

And PS: one possible explanation (this is a long shot) is that you designed for 12 bit coefficients and exported in 32 bits => +20

Edited by xc6lx45

Share this post


Link to post
Share on other sites
  • 0

Hi @xc6lx45,

Could you please, tell me from which tab to reach the decimal point position settings? 

I checked all the tabs, but I couldn't find it.

Kindly, see the attached picture.

thank you for your reply.

FIR_compiler.JPG

Share this post


Link to post
Share on other sites
  • 0

Hi @xc6lx45,

I am grateful for your helpful explanations. 

Could you pls, tell me why there is an error when I set the "Quantization" to any other option other than "Integer Coefficients" ? 

Kindly, see the attached picture.

photo_2019-06-04_21-29-26.jpg

Share this post


Link to post
Share on other sites
  • 0

I must admit I didn't read the manual of that tool... but "Coefficient fractional Bits" should do the required scaling (my guess: "20" for the correct value, given your 120 dB peak gain)

I'd try to re-run the wizard with new, default settings to get rid of the error.

Have you checked your input file, are there very large numbers (such as 32-bit-ish, like 2e9)? It may be that the tool uses 32 bits internally and needs some headroom (guessing,..), try to export to a lower range. For example, sign bit + 1 integer bit + 16 fractional bits (18 total) would seem reasonable.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now