基于MATLAB的FIR低通滤波器程序加权系数

来源:百度知道 编辑:UC知道 时间:2024/05/04 09:32:43
如下程序为利用切比雪夫一致逼近法设计的低通滤波器 问下哪个参数是加权系数啊
clear; %清空workspace
fsamp=8000; %采样频率
fp=0.6*fsamp/2; %通带截止频率
rp=0.01; % 通带允许
fs=0.7*fsamp/2; % 阻带截止频率
rs=0.1;
ff= [fp fs];
mags=[1 0];
devs=[rp rs];

if nargin == 3,
fsamp = 2;
end
ff = ff/fsamp; % 规格采样频率
if any(ff > 1/2),
error('Band-edge frequencies must be less than the Nyquist frequency.');
end
if any(ff < 0),
error('Band-edge frequencies must be positive.');
end
%把向量变成列向量
ff = ff(:);
mags = mags(:);
devs = devs(:);

[mf,nf] = size(ff);
[mm,nm] = size(mags);
[md,nd] = size(devs);
nbands = mm;

if length(mags) ~= length(devs)
error('A and DEV must be vectors of the same length.')
end

if mf ~= 2*(nbands-1)
error('Length of F

我不太清楚你说的加权是指什么.这个程序基本分两个部分,一个是判伪,一个是阶数、频率范围、幅频特性、采样率设定。阶数、频率范围、采样率应该没什么加权可言,只剩幅频特性了。我看你的幅频特性设计是安排传输函数零点位置达到的吧,那对切比雪夫特性的影响也就在零点位置上了,对应到你的程序中应该是AA矩阵中值的设定。你可以改变AA中的值,应该能看出变化。
以上只是一点拙见,有错请见谅,本人也不是专业滤波器设计。