필터 지우기
필터 지우기

mfilt.firtdecim to dsp.FIRDecimator

조회 수: 2 (최근 30일)
Alan Jayson
Alan Jayson 2019년 9월 11일
답변: Alan Jayson 2019년 9월 20일
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

답변 (3개)

Jyothis Gireesh
Jyothis Gireesh 2019년 9월 18일
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 2019년 9월 18일
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
Jyothis Gireesh
Jyothis Gireesh 2019년 9월 20일
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.

댓글을 달려면 로그인하십시오.


Alan Jayson
Alan Jayson 2019년 9월 20일
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

카테고리

Help CenterFile Exchange에서 Digital Filter Design에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by