First, determine the passband cutoff frequency and the stopband cutoff frequency of the Chebyshev high-pass digital filter. Call cheb1ord(), cheb1ap(), zp2tf(), lp2hp(), and bilinear() to obtain the low-pass digital filter model. Use freqz() to view the filter’s amplitude-frequency characteristics and lsim() to observe the signal filtering effect. %%qiebixuefu gaotong shuzi lvboqi sheji%%cheb1ord();cheb1ap();zp2tf();lp2hp();%%freqs();bilinear();freqz();lsim();%%%%%%%%%%%clear allclose all;clc;%%%%%%%%%%%%%%%
Sampling frequency fs1=10000; %%1.0e4;%%
Passband cutoff frequency: HzwP1=[2400]; %%stopband cutoff frequency: HzwS1=[2000];%%
Normalized frequency: wP2=wP1*2*pi;wS2=wS1*2*pi;%%
Maximum allowable ripple in the passband: dBrP1=2;%%
Minimum attenuation in the stopband: dBrS1=60;%%%%%%%%%%%
Calculate the minimum order [n1,wn1]=cheb1ord(wP2,wS2,rP1,rS1,'s'); %%simulate filter [z1,p1,k1]=cheb1ap(n1,rP1);[num1,den1]=zp2tf(z1,p1,k1);[num2,den2]=lp2hp(num1,den1,wS2);w0=1000*2*pi:10:6000*2*pi;[h1,w1]=freqs(num2,den2,w0);<figure(1);plot(w1/2/pi,abs(h1));<code>grid on;title('Amplitude Characteristics.');<figure(2);plot(w1/2/pi,unwrap(angle(h1)));<code>grid on;title('Phase Characteristics.');%%%%%%%%%%%%%%%%%%deltaTime=1/fs1; %%5.0e-5;[numD,denD]=bilinear(num2,den2,fs1);t1=0:deltaTime:40;Len=length(t1);noise1=2.0*rand(1,Len);noise2=noise1-mean(noise1);x1=5*sin(2*pi*3000*t1)+5*sin(2*pi*1500*t1)+noise2;sys1=tf(numD,denD,deltaTime);[y2,t2]=lsim(sys1,x1,t1);<figure(3);plot(t2,y2);<code>grid on;title('Digital Filter Output');y3=fftshift(fft(y2));y4=fftshift(fft(x1));<figure(4);w4=1./deltaTime*[-Len/2+1:1:Len/2]/Len;<code>plot(w4,abs(y3));grid on;title('Digital Filter Output Spectrum');<figure(5);plot(w4,abs(y4));<code>grid on;title('Original Signal Spectrum');disp('End.');</figure(5);</figure(4);</figure(3);</figure(2);</figure(1);