Forum Discussion
Hi Chee,
thanks for your reply.
My filter is working fine in Matlab. What I am trying to figure out is how to use the FIR II IP correctly: I.e. how to select the 24bit output range from the filter which gives me maximum dynamic without overflow.
The DC (zero Hz) gain of the filter equals the sum of the filter taps (SUM(h(n)). If SUM(h(n)) = 1 then filter has gain=1 at DC. This is the case for my filter.
In FIR II I have this setup:
24bit input
24bit coefficients
Number of coefficients: 26
With these numbers in FIR II the full output range is 53.
I assume this is based on: 24 + 24 + ceil(log2(26)) = 24 + 24 + 5 = 53. Is this correct?
I notice in FIR II that if one enables the auto-scale the center tap is scaled to 2^23 when using 24bit filter taps. SUM(h(n)) then typical gets larger than 2^24.
In my case the sum of the filter coefficients after the FIR II auto scaling is approximately: +29E6
Assuming a range for both + and - values this adds 2 bits. (26bit : +/- 33E6)
Based on these numbers the 24bit output range with max resolution without overflow is:
MSB to remove: 3 (5-2)
LSB to remove: 26 (53-3-24)
Is this the correct understanding of the FIR II IP filter?
BR
AD
- CheepinC_altera6 years ago
Regular Contributor
Hi AD, Thanks for your update and clarification that your filter is working fine in Matlab. Would you mind to share with me the FIR design of your in Matlab together with steps to simulate the unity gain? This would be helpful for us to further look into how to port to FIR IP accordingly. Also, please help to share us a simple Quartus design which you mentioned simulating 1/16 gain in Modelsim. Thank you. Best regards, Chee Pin