mfilt.firtdecim to dsp.FIRDecimator

8 visualizzazioni (ultimi 30 giorni)
Alan Jayson
Alan Jayson il 11 Set 2019
Risposto: Alan Jayson il 20 Set 2019
I’ve used “mfilt.firtdecim” to generator a fir decimation by 2 cic compensation filter (At least 10 years) that import into Filter Designer app.
Want to set CoeffWordLength, InputWordLength, InputFracLength, OutputWordLength, OutputFracLength, AccumFracLength & OverflowMode.
I’m looking to dsp.FIRDecimator to do the same job but it not clear to me how to do that.
If anybody could point me in the right direction, I would appreciate it.
Alan

Risposte (3)

Jyothis Gireesh
Jyothis Gireesh il 18 Set 2019
Please make use of the following code snippet to set the above mentioned properties in dsp.FIRDecimator object.
Hd = dsp.FIRDecimator('Numerator',cfir,...
'CustomCoefficientsDataType',numerictype([],32,24),'CoefficientsDataType','Custom',...
'FullPrecisionOverride',false,...
'CustomOutputDataType',numerictype([],32,0),'OutputDataType','Custom',...
'CustomAccumulatorDataType',numerictype([],32,0),'AccumulatorDataType','Custom',...
'OverflowAction','Saturate');
Since there is no name-value pair to set the customize the numerictype of the input you may have to typecast the input before passing it as input to the "Hd" object. You may make use of the following syntax to achieve the typecasting
inSignalConverted = fi(inSignal,numerictype(1,32,0));
Please go through the following documentation links on dsp.FIRDecimator and casting fixed point objects if you need any clarifications on the same

Alan Jayson
Alan Jayson il 18 Set 2019
dsp.FIRDecimator object (Hd) can't go into the Filter Designer application (There's an error), only DFILT/MFILT objects work like "mfilt.firtdecim" in the Filter Designer application (Import Filter object).
If MATHWORKS is going to kill "mfilt.firtdecim" I hope they make a converter.
  1 Commento
Jyothis Gireesh
Jyothis Gireesh il 20 Set 2019
Hi Alan,
I replaced the "mfilt.firtdecim" code with the corresponding code in dsp.FIRDecimator. But I was unable to replicate the error you mentioned above. Could you give further clarification regarding 'dsp.FIRDecimator object (Hd) can't go into the Filter Designer application'?
I am also attaching the edited code for your reference.

Accedi per commentare.


Alan Jayson
Alan Jayson il 20 Set 2019
Hi Jyothis,
Here's a picture of the screen with the error on the code that you attached.
After "filterDesigner(firdecim)" Filter Designer open you must import the object into Filter Designer (That's when you get the error, running the m code doesn't import the object).
Alan

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by