mfilt.firtdecim to dsp.FIRDecimator

8 visualizaciones (últimos 30 días)
Alan Jayson
Alan Jayson el 11 de Sept. de 2019
Respondida: Alan Jayson el 20 de Sept. de 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

Respuestas (3)

Jyothis Gireesh
Jyothis Gireesh el 18 de Sept. de 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 el 18 de Sept. de 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 comentario
Jyothis Gireesh
Jyothis Gireesh el 20 de Sept. de 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.

Iniciar sesión para comentar.


Alan Jayson
Alan Jayson el 20 de Sept. de 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

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by