Hi everyone,
I'am going to design a linear phse low pass FIR filter.
It seems that I'm defining something wrong.
lpf = designfilt('lowpassfir','FilterOrder',6,'CutoffFrequency',5000,'PassbandRipple',1,'DesignMethod','cls','ZeroPhase',true,'SampleRate',1e6);
IIR filter works fine but with considerable phase shift.
lpf = designfilt('lowpassiir','FilterOrder',3,'PassbandFrequency',5000,'PassbandRipple',1,'StopbandAttenuation',55,'DesignMethod','ellip','SampleRate',1e6);
I dont have any idea...

 채택된 답변

I do not see that you are doing anything wrong.
However I made some changes that might improve things —
lpf1 = designfilt('lowpassfir','FilterOrder',46,'CutoffFrequency',5000,'PassbandRipple',1,'DesignMethod','cls','ZeroPhase',true,'SampleRate',1e6);
↑ ← CHANGED
figure
freqz(lpf1.Coefficients,1,2^16,1E6)
lpf2 = designfilt('lowpassiir','FilterOrder',3,'PassbandFrequency',5000,'PassbandRipple',1,'StopbandAttenuation',55,'DesignMethod','ellip','SampleRate',1e6);
figure
freqz(lpf2.Coefficients, 2^16, 1E6)
These are two different filters with different characteristics.
The phase delay/distortion will likely disappear with fitlfilt rather than filter to filter the signal. Tha is true for FIR and IIR filters in MATLAB.
In general, FIR filters require a much higher order (and so are llss computationally efficient) than IIR filters to get the same response. Here, I increased the IIR filter order from 6 to 46.
.

댓글 수: 4

Dear Star Strider,
Thank you for your response.
Actually, I have to implement multiple filters on a hardware.
Using high-order filters occupies most of the available areas in my device.
Another problem that I have is that its phase margin should not exceed 2*pi/3.
And the last constraint is passband ripple, which should not exceed 0.01db.
Maybe, I should conduct try and error with parameters in IIR filters to find the best solution.
Thanks alot.
As always, my pleasure!
If you are doing this in hardware, consider using the DSP System Toolbox since it is designed to do just that. (I do not have it because I do not need it, so I have no experience with it. I have exploree it to some extent in the online Run feature on Answers, however not to the point of being proficient with it.)
The one type of filter that provides the best phase-neutral performance is the Bessel filter (besself). It cannot be implemented digitally, and can only be implemented in analog hardware.
.
I will look for both you mentioned.
Thank you for your asistance.
As always, my pleasure!
.

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

추가 답변 (0개)

카테고리

제품

릴리스

R2020a

질문:

2021년 9월 15일

댓글:

2021년 9월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by