天天看點

【濾波器設計】根據設計名額使用matlab定制濾波器

濾波器設計名額如下:

【濾波器設計】根據設計名額使用matlab定制濾波器
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

【濾波器設計】根據設計名額使用matlab定制濾波器

繼續閱讀