figure
subplot(5,1,1);plot(i,x1); subplot(5,1,2);plot(i,x2); subplot(5,1,3);plot(i,x3); subplot(5,1,4);plot(i,x); subplot(5,1,5);plot(i,y);
得到的图形为:
10-110-110-150-520-200.010.020.030.040.050.060.070.080.090.100.010.020.030.040.050.060.070.080.090.100.010.020.030.040.050.060.070.080.090.100.010.020.030.040.050.060.070.080.090.100.010.020.030.040.050.060.070.080.090.1
得到的参数如下 >> b b =
Columns 1 through 11
0.0003 0 -0.0019 0 0.0057 0 -0.0095 0 0.0095 0 -0.0057 Columns 12 through 15
0 0.0019 0 -0.0003 >> a a =
Columns 1 through 11
1.0000 1.7451 4.9282 6.1195 9.8134 9.2245 10.4323 7.5154 6.4091 3.4595 2.2601 Columns 12 through 15
0.8470 0.4167 0.0856 0.0299
25
>> n n = 7 >> wn wn =
0.4284 0.6693
所以计算得到的传递函数为:
h(n)?[0.0003?0.0019z?2?0.0057z?4?0.0095z?6?0.0095z?8?0.0057z?10?0.0019z?12
?0.0003z?14]/[1?1.7451z?1?4.9285z?2?6.1195z3?9.8134z?4?9.2245z?5?10.4323z?6??7.5154z?7?6.4091z?8?3.4595z?9?2.2601z?10?0.8470z?11?0.4167z?12?0.0856z?13?0.0299z?15]
其单位响应及零级点分布:
num=[0.0003 0 -0.0019 0 0.0057 0 -0.0095 0 0.0095 0 -0.0057 0 0.0019 0 -0.0003]
den=[ 1.0000 1.7451 4.9282 6.1195 9.8134 9.2245 10.4323 7.5154 6.4091 3.4595
2.2601 0.8470 0.4167 0.0856 0.0299] [z,p,k]=tf2zp(num,den); subplot(2,1,1);
zplane(z,p);grid; w=[0:1:512]*pi/512; H=freqz(num,den,w);
n=0:50; %绘制冲激响应曲线 x=[n==0];
h=filter(num,den,x); subplot(2,1,2); stem(n,h);grid; title('冲击响应'); xlabel('n'); ylabel('h(n)');
得到图形为:
26
1Imaginary Part0.50-0.5-1-3-2-10Real Part冲击响应1230.40.2h(n)0-0.2-0.40510152025n3035404550
Rp=1; Rs=40;
Wn=[0.3 0.45 0.65 0.75]; A=[0 1 0]; xp=(10^(Rp/20)-1)/(10^(Rp/20)+1); xs=10^(-Rs/20);
dev=[xs xp xs]; [n,fo,ao,w]=remezord(Wn,A,dev,2); b=remez(n,fo,ao,w);
[h,w]=freqz(b,1,1024,2);
figure:plot(w,20*log10(abs(h)));
title('等波纹最优带通滤波器幅频特性'); xlabel('频率'); ylabel('幅度'); grid;
得到图形如下:
27
等波纹最优带通滤波器幅频特性200-20幅度-40-60-80-10000.10.20.30.40.5频率0.60.70.80.91
答:FIR系统只有零点,因此FIR系统不像IIR系统那样易于取得比较好的通带与阻带衰减特性,要取得好的衰减特性,滤波器的阶次要求更高,既N更大。本实验中设计的等波纹最优FIR带通滤波器要符合相应的滤波特性,最少需n=31阶。
FIR数字滤波器可以很容易实现严格的线性相位特性。实际应用中,像语音处理、图像处理以及数据传输要求线性相位,任意幅度,FIR滤波器满足要求。同时FIR数字滤波器的单位抽样响应是有限长的,因而滤波器一定是稳定的,只须经过一定的延时,任何非因果的有限长序列都变成因果的有限序列。
28