Info

This question is closed. Reopen it to edit or answer.

Set constraints when running minimizecoeffwl or maximizestopband in Fixed Point Toolbox

1 view (last 30 days)
Hello Everybody,
I designed a filter (double precision) with the fdesign and design functions and now I need to translate it to fixed point. To do so, I'm playing with minimizecoeffwl and maximizestopband functions. However, every time I run them, in addition to optimize the coefficients, they also set other parameters (InputWordLength, OutputWordLength, ProductWordLength, AccumWordLength) to default (16 bit) which is not what I need. Is there a way to avoid that?
Thanks in advance!
  1 Comment
Bob
Bob on 21 Apr 2014
I have a very similar problem. After specifying a reduced bitlength, minimizecoeffwl() overwrites it with 16. Seems like this is an important feature of the fixed point toolbox. How can we make it work?
-----
h1 = design(d1, 'equiripple');
set(h1, 'arithmetic','fixed', 'FilterInternals','SpecifyPrecision', ... 'InputWordLength',10, 'InputFracLength',10, ... 'OutputWordLength',10, 'OutputFracLength',10);
h1
q1 = minimizecoeffwl(h1, 'NTrials',3)
-----
h1 =
FilterStructure: 'Direct-Form FIR'
Arithmetic: 'fixed'
Numerator: [1x65 double]
PersistentMemory: false
CoeffWordLength: 16
CoeffAutoScale: true
Signed: true
InputWordLength: 10
InputFracLength: 10
FilterInternals: 'SpecifyPrecision'
OutputWordLength: 10
OutputFracLength: 10
ProductWordLength: 31
ProductFracLength: 34
AccumWordLength: 36
AccumFracLength: 34
RoundMode: 'convergent'
OverflowMode: 'wrap'
q1 =
FilterStructure: 'Direct-Form FIR'
Arithmetic: 'fixed'
Numerator: [1x65 double]
PersistentMemory: false
CoeffWordLength: 5
CoeffAutoScale: true
Signed: true
InputWordLength: 16
InputFracLength: 15
FilterInternals: 'FullPrecision'

Answers (0)

Community Treasure Hunt

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

Start Hunting!