Why is my fixed-point digital filter block outputting all zeros in Signal Processing Toolbox 6.9 (R2008a)?

1 view (last 30 days)
I designed a fixed-point filter with FDATOOL. I then realized it as a Digital Filter block in Simulink via the "Realize Model" pushbutton in the "Realize Model" pane. However, when I pass an input signal through this filter block, the output is all 0's. If I choose the "Build model with basic elements" checkbox when realizing the model, this issue does not occur.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Oct 2013
The conversion of floating-point filters to fixed-point filters is not a simple task. Often the problem lies with scaling issues. The Simulink Fixed Point toolbox contains a Fixed-Point Tool that attempts to alleviate these issues. You can reach it by going to "Tools -> Fixed-Point -> Fixed-Point Tool…". To use this tool, follow these instructions:
1. In the Fixed-Point Tool, set the model's "Data type override:" to "True doubles" and its "Logging mode" to "Minimums, maximums and overflows".
2. Run the model by clicking on the "Run simulation and store Active results" pushbutton. You will have to manually stop the model if the stop time is set to Inf.
3. Click the "Propose fraction lengths" pushbutton in the Fixed-Point Tool.
4. Accept or reject each proposed fraction length in the middle pane of the Fixed-Point Tool. Before accepting, note that the entries in the proposed fraction length column (ProposedFL) are editable. The initially proposed fraction length is the largest possible value that does not produce overflow with the current data, thus providing maximum resolution while avoiding overflows. Extra head room can optionally be incorporated using the "Percent safety margin" parameter setting on the Fixed-Point Tool.
5. Click the "Apply accepted fraction lengths" button on the Fixed-Point Tool to apply accepted fraction lengths back into the model. Each accepted fraction length is modified on the relevant block's dialog. In order to allow the accepted fraction lengths to take effect in the model, note that block's fixed-point settings cannot be set to inherited modes such as "Same as input" or "Inherit via internal rule", but rather must be set to an explicit mode such as Binary point scaling.
6. After autoscaling, set Data type override back to Use local settings and run the model again. The fixed-point results are now similar to those we observed using floating-point.
Refer to the product documentation and related examples for additional information.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!