MATLAB: How to mask a Bandpass Filter block from the DSP System Toolbox R2014b

DSP System Toolbox

I would l like to mask an algorithm that contains a Bandpass Filter block. The cutoff frequencies of the Bandpass Filter block need to be controlled by the masked parameters of the masked subsystem it is inside of. However when I try to do this I receive an error:
The variable fStop is not defined in the MATLAB workspace.

Best Answer

It is not currently possible to use masked variables inside of the Bandpass Filter block in the DSP System Toolbox R2014b.
To work around this limitation use the following steps:
Remove the Bandpass Filter block and replace the block with a Discrete FIR Filter block.
Inside of the Mask Initialization code perform the same filter design operation that the bandpass filter block was previously performing for us.
Then use the coefficients mask variable generated in the Mask Initialization code as the coefficient of the Discrete FIR Filter block
Please see the attached model for an example
In order to get a starting point for generating the required filter used the fdatool and generated MATLAB code as discussed in the following documentation page: