Floating-Point to Fixed-Point Conversion of IIR Filters

6 views (last 30 days)
I am trying to run this official example https://fr.mathworks.com/help/dsp/ug/floating-point-to-fixed-point-conversion-of-iir-filters.html . But when I copy the first line
biquad = design(fdesign.lowpass('Fp,Fst,Ap,Ast',0.4,0.45,0.5,80),'ellip',FilterStructure='df1sos', SystemObject=true, UseLegacyBiquadFilter=true);
it triggers an error :
Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
I run this version of matlab
MATLAB Version: (R2020b) Update 7
MATLAB License Number:
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19044)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Version 9.9 (R2020b)
Control System Toolbox Version 10.9 (R2020b)
DSP System Toolbox Version 9.11 (R2020b)
Fixed-Point Designer Version 7.1 (R2020b)
Instrument Control Toolbox Version 4.3 (R2020b)
Parallel Computing Toolbox Version 7.3 (R2020b)
RF Toolbox Version 4.0 (R2020b)
Signal Processing Toolbox Version 8.5 (R2020b)
Statistics and Machine Learning Toolbox Version 12.0 (R2020b)
How can I run this example on my computer ?

Accepted Answer

Les Beckham
Les Beckham on 3 Jan 2023
Edited: Les Beckham on 3 Jan 2023
The Name=Value syntax for name/value pairs of function arguments only works in r2021a and above.
So, changing this:
biquad = design(fdesign.lowpass('Fp,Fst,Ap,Ast',0.4,0.45,0.5,80),'ellip',FilterStructure='df1sos', SystemObject=true, UseLegacyBiquadFilter=true);
to this:
biquad = design(fdesign.lowpass('Fp,Fst,Ap,Ast',0.4,0.45,0.5,80), 'ellip', 'FilterStructure', 'df1sos', 'SystemObject', 1, 'UseLegacyBiquadFilter', 1);
should get rid of the "Incorrect use of '=' operator" error. I'm not familiar with this filter design process so I don't know if no error means that it is working correctly.

More Answers (1)

Andy Bartlett
Andy Bartlett on 3 Jan 2023
Examples often depend on supporting files. To successfully run these examples, all the files needed by the example need to be on the MATLAB path. The help page for an example will have a big blue button labelled "Open Live Script." Clicking that button will make sure that copies of all the needed files are put on the current MATLAB path. Often the files are copied to a directory and the current directory is changed to that folder. These files can then be found by the commands in the example.
In contrast, if you do not click the big blue "Open Live Script" button, and copy commands from the help text and past them into MATLAB command window, then those commands can fail do to missing dependencies.
Please try clicking the "Open Live Script" button from the examples help page. Then try to repeat the individual commands, and see if that resolves the issues.
Stephane DAVID-GRIGNOT on 3 Jan 2023
I have found how to dowload the example folder from matlab online. However the error is still triggered even when operating in the example folder. What am I doing wrong ?
thank you again

Sign in to comment.


Find more on Get Started with DSP System Toolbox 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!