![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172207/image.png)
Optimal FIR Filter Design Procedure for the Parks–McClellan Algorithm
조회 수: 1 (최근 30일)
이전 댓글 표시
This code for calculating frequency/phase response works fs=8000;
f=[ 0 0.15 0.25 0.4 0.5 1]; % Edge frequencies
m=[ 0 0 1 1 0 0]; % Ideal magnitudes
w=[ 39 10 39 ]; % Error weight factors format long
b=remez(25,f,m,w) % (25+1) taps Parks-McClellan algorithm and Remez exchange
freqz(b,1,512,fs); % Plot the frequency response
axis([0 fs/2 -80 10])
But this doesn't work when i change the filter specification to:
fs=8000;
f=[ 0 0.01750 0.01875 0.06750 0.06755 0.1250]; % Edge frequencies
m=[ 0 0 1 1 0 0]; % Ideal magnitudes
w=[ 1220 1 1220 ]; % Error weight factors format long
b=remez(134,f,m,w) % (134+1) taps Parks-McClellan algorithm and Remez exchange
freqz(b,1,512,fs); % Plot the frequency response
axis([0 fs/2 -80 10])
댓글 수: 0
답변 (1개)
Satyajeet Sasmal
2015년 11월 19일
Hi Zehaib
For your second filter specification, setting the axis limits to [0 fs/2 -80 10] forces your y-axis to be limited from -80 db to 10 db. Whereas, your Magnitude vs Frequency graph for the second case requires your magnitude to in the order of 2.4k db to 3k db (see image below)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/172207/image.png)
Figure 1 is the second filter in your case.
Hope this answers your question.
-Satya
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!