mfilt.firtdecim to dsp.FIRDecimator
3 views (last 30 days)
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.
Jyothis Gireesh on 18 Sep 2019
Please make use of the following code snippet to set the above mentioned properties in dsp.FIRDecimator object.
Hd = dsp.FIRDecimator('Numerator',cfir,...
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
dsp.FIRDecimator - https://www.mathworks.com/help/dsp/ref/dsp.firdecimator-system-object.html
Cast fi objects - https://www.mathworks.com/help/fixedpoint/ug/casting-fi-objects.html