Why does the filter generated using the Filter Design HDL Coder have limited dynamic range for the output?

3 views (last 30 days)
I am trying to generate a Fixed-Point IIR filter using the FDATOOL and the Filter Design HDL Coder. While the filter's output meets the frequency characteristics, the output dynamic range is poorly used. I am using 16-bit inputs and 16-bit outputs. Yet the highest magnitude output value is approximately 1005, indicating that not even 10 out of the 16 output bits are used. I have set the input fraction length to 15 and the world length to 16. I would like to get the filter output to use the entire dynamic range.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This behavior results from the input settings of the filter selected through FDATOOL. Since the input fraction length is set to 15 while the word length is set to 16, the range of input values is limited. You can observe this by looking at the Scope blocks under the Filter subsystem in "gs_filter.mdl". Changing the value of the Amplitude in the Sine Wave block beyond a certain value has no effect on the input to the filter (at the output of the Convert block).
The Convert block has an output scaling value of 2^-15. This results from the input fraction length setting for the filter through FDATOOL. To resolve this issue try to change these settings based on the filter input. Based on your application you will have to select the setting to balance precision and dynamic range.

More Answers (0)

Categories

Find more on Floating-Point to Fixed-Point Conversion in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!