求帮我用matlab实现以下的DSP滤波器的实验,a.Design linear-phase lowpass filters with the cutoff-frequency ωc = π/3 using the Parks-McClellan method for filter orders M = 20,50 and 150.The MATLAB Signal Processing Toolbox function remez
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/25 01:47:50
求帮我用matlab实现以下的DSP滤波器的实验,a.Design linear-phase lowpass filters with the cutoff-frequency ωc = π/3 using the Parks-McClellan method for filter orders M = 20,50 and 150.The MATLAB Signal Processing Toolbox function remez
求帮我用matlab实现以下的DSP滤波器的实验,
a.Design linear-phase lowpass filters with the cutoff-frequency ωc = π/3 using the Parks-McClellan method for filter orders M = 20,50 and 150.The MATLAB Signal Processing Toolbox function remez() can be used to implement the Parks-McClellan method.
b.Note that you will not be able to specify the ideal passband and stopband cutoff frequencies exactly in the remez() function.Try specifying a few different passband and stopband cutoff frequencies that vary in how close they are to the ideal lowpass filter,and see what effect this has on the actual frequency responses.
c.How do the resulting filter frequency responses compare to those obtained from the truncation and window methods?
求帮我用matlab实现以下的DSP滤波器的实验,a.Design linear-phase lowpass filters with the cutoff-frequency ωc = π/3 using the Parks-McClellan method for filter orders M = 20,50 and 150.The MATLAB Signal Processing Toolbox function remez
a部分:
wn=1/3;% 归一化截止频率
wdel=1/15;% 过渡带宽
f=[0,wn-wdel/2,wn+wdel/2,1];
m=[1,1,0,0];
for i=1:3
switch i
case 1
N=20;% 滤波器阶数
case 2
N=50;
case 3
N=150;
end
b=remez(N,f,m);% FIR滤波器设计
figure(i);
freqz(b,1,512);
title(['Filter order N= ',num2str(N)])
end
b部分:
N=50;% 滤波器阶数
wn=1/3;% 归一化截止频率
for i=1:4
wdel=1/15/i;
f=[0,wn-wdel/2,wn+wdel/2,1];
m=[1,1,0,0];
b=remez(N,f,m);% FIR滤波器设计
figure(4);
subplot(2,2,i);
[H,w]=freqz(b,1,512);
mag=abs(H);
plot(w/pi,20*log10(mag/max(mag)));
xlabel('Normalized Frequency');
ylabel('Magnitude (dB)');
title(['Transition bandwidth wdel= ',num2str(wdel)]);
grid on;
end
从这四个图可以看出,在滤波器阶数相同的情况下,过渡带宽越小,则通带波纹越大,阻带衰减越小.
c部分:这几种方法都是从不同的意义上对给定理想频率特性的逼近,窗函数法为时域逼近法,频率采样法为频域逼近,本题为最优化设计.
最优化逼近的特点是:逼近误差均匀分布(往往是牺牲通带波纹),相同指标下滤波器所需阶数低.(通过以下程序可以比较:)
wn=1/3;% 归一化截止频率
wdel=1/15;% 过渡带宽
f=[wn-wdel/2,wn+wdel/2];
m=[1,0];
devs=[0.05,0.01];
c_1=kaiserord(f,m,devs) % 窗函数法需要67阶
c_2=remezord(f,m,devs) % remez法只需44阶