Matlab根据滤波器系数画出幅频特性曲线

一、调用freqz函数

matlab提供了计算幅频特性曲线的函数freqz()。调用方式如下:

 b = [0.001888514102853,0.005778213198786,0.006836972088162,0.003833819972729,0.0009801046804866,8.261556068962e-005];  %分子多项式系数
 a=[1,   -2.979063913912,      3.5158909383,   -1.971236513463, 0.4848532960132, -0.03104388539604];   %分母多项式系数
[H,w] = freqz(b,a);   %调用freqz()函数

二、画出幅频特性曲线

figure
subplot(211);
plot(abs(H));
title('幅频特性曲线');
subplot(212);
plot(angle(H));
title('相频特性曲线');

你可能感兴趣的:(信号处理)