Simulink Biquad Filter and HDL Coder

4 vues (au cours des 30 derniers jours)
sascha rubow
sascha rubow le 29 Mar 2017
Hello,
in my Model i use a Biquad Filter from the DSP System Toolbox with the Coefficient Source: Input port(s). At the Port Num i need to give it a M by 3 Matrix, Port Den a M by 2 Matrix and g a M+1 Vektor. If is use any M>1 HDL Coder gives me an Error Message from the Matrix Source Block: Matrices are not supported at Simulink block interfaces. So, does anyone have an Idea how to get the Biquad Filter Working with a M bigger then 1?
Thanks

Réponse acceptée

John O'Sullivan
John O'Sullivan le 30 Mar 2017
The restriction on matrix signals is not specific to the Biquad Filter, it is and Simulink HDL Coder wide restriction.
As each of the sections (M) of the biquad filters are chained together in series, you can achieve the same result by chaining together multiple (M) single section Biquad Filters, each of which will only require a vector input.
Note that each of the single stage Biquad filters would requires 2 scaling values to be specified, one scaling value at the input, and one at the output, meaning a input to g of vector size 2. This results in 2*M values of g specified for the full set of biquad filters. In your previous implementation input and output scaling values of the back-to-back sections are combined, hence why M+1 g values are required for the multi-section biquad filter implemented using a single block. These additional scaling values can be set to 1, i.e. the output g value for each Biquad Filter which is connected to the input of another Biquad Filter.
The disadvantage of this approach is that M cannot be configured at simulation run time.

Plus de réponses (0)

Catégories

En savoir plus sur Code Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by