MATLAB: How to control the individual products and accumulators of the DFILT object in Signal Processing Blockset 6.9 (R2009a)

Signal Processing Toolbox

I can set the properties for my DFILT object, but I do not have access to each accumulator and multiplier input and output of a FIR and IIR filter, needed to assign their attributes, e.g., bit width and type of rounding. I can assign the attributes all at once. However, for optimal design, I may want to have some of the internal accumulators and multipliers of different sizes or do a different rounding.

Best Answer

You can start with a DFILT object "Hd" that has a filter structure and coefficients and then use:
realizemdl(Hd)
to get a Simulink model in which you can control individual adders and gains. The following is an example:
[b,a] = butter(5,.5);
Hd = dfilt.df1(b,a);
%#1 Default syntax:
realizemdl(Hd);
%#2 Using parameter/value pairs:
realizemdl(Hd, 'Blockname', 'My Filter', 'OptimizeZeros', 'on');