滤波器设计指标如下:
- clc;
- clear;
- close all;
- warning off;
-
- %use the windows function
- N = 25; %阶数,可以用过渡带来计算
- wc = 1/6; %wc是过渡带中心,要除以pi
- hn = fir1(N-1,wc,'low',Bartlett(N));
- %要求a
- disp('the cofficient of windows is');
- hn'
- figure;
- plot(hn,'b-o');
- title('the cofficient of windows');
-
- %要求b
- figure;
- freqz(hn,1);
得到滤波器系数如下:
the cofficient of windows is
ans =
-0.0000
-0.0160
-0.0305
-0.0391
-0.0381
-0.0251
0.0000
0.0352
0.0761
0.1172
0.1523
0.1758
0.1841
0.1758
0.1523
0.1172
0.0761
0.0352
0.0000
-0.0251
-0.0381
-0.0391
-0.0305
-0.0160
-0.0000
A28-11