Digital filter using code
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi
I am trying to design a simple low pass digital filter (IIR or FIR) with the following characteristics. I would like to plot the filters response and calculate its transfer function.
Order(N) = 2
Band pass frequency (normalized)(wp)= 0.1
Band pass attenuation(ap) = 0dB(or as close as possible)
Stop band frequency (sf) = 0.4
Stop band attenuation (as) = at least -30dB
I have tried several methods but with such a low order I am finding it difficult to achieve these characteristics.
I would like to try and achieve this using Matlab code only, although I have tried using the digital filter design toolbox but still could not achieve the filter characteristics.
Any help would be greatly appreciated.
Thanks
댓글 수: 2
Wayne King
2013년 12월 20일
Please tell us which version of MATLAB you are using? When you say "digital filter design toolbox" do you mean the old MathWorks' Filter Design Toolbox?
답변 (1개)
Wayne King
2013년 12월 20일
편집: Wayne King
2013년 12월 20일
It's going to be difficult to get a good lowpass filter with such a low order (even IIR)
FIR:
d = fdesign.lowpass('N,Fp,Ap,Ast',2,0.1,0.5,30);
Hd = design(d);
fvtool(Hd)
% requires DSP System Toolbox -- this gets you very close but you have to increase order bit
d = fdesign.lowpass('N,Fp,Fst,Ast',4,0.1,0.4,30);
Hd = design(d);
If you enter:
measure(Hd)
You get
Passband Edge : 0.1
3-dB Point : 0
6-dB Point : 0
Stopband Edge : 0.4
Passband Ripple : 0.73383 dB
Stopband Atten. : 29.9978 dB
Transition Width : 0.3
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!