在MATLAB环境下设计高通、低通、带通、带阻四种滤波器的程序

需要给出完整的程序,越详细越好.谢谢了... 追加50分
2024-12-15 10:47:08
推荐回答(2个)
回答1:

窗函数设计低通滤波器:
fp=1000;
fc=1200;
as=100;
ap=1;
fs=22000;
wp=2*fp/fs;
wc=2*fc/fs;
N=ceil((as-7.95)/(14.36*(wc-wp)/2))+1;
beta=0.1102*(as-8.7);
window=Kaiser(N+1,beta);
b=fir1(N,wc,window);
freqz(b,1,512,fs);

高通滤波器:
fs=22000;
Wp=2*5000/fs;
Ws=2*4800/fs;
Ap=1;
As=100;
N=ceil(8*pi/(Wp-Ws))+1;
N=N+mod(N+1,2)+1;
Wc=(Wp+Ws)/2/pi;
h=fir1(N,Wc,'high');
omega=linspace(0,pi,512);
freqz(h,1,omega);

带通滤波器:
fs=22000;
Wp1=2*1200/fs;
Wp2=2*3000/fs;
Wc1=2*1000/fs;
Wc2=2*3200/fs;
Ap=1;
As=100;
W1=(Wp1+Wc1)/2;
W2=(Wp2+Wc2)/2;
wdth=min((Wp1-Wc1),(Wc2-Wp2));
N=ceil(11*pi/wdth)+1;
b = fir1(N,[W1 W2]);
freqz(b,1,512,fs)

回答2:

悬赏还挺多的,但我不会,可惜