kaiord.m

来自「数字信号处理源代码」· M 代码 · 共 23 行

M
23
字号
function N = kaiord(Fp, Fs, Rp, Rs, FT)
% Computation of the length of a linear-phase
% FIR multi-band filter using Kaiser's formula
% 
% Rp is the passband ripple
% Rs is the stopband ripple
% Fp is the passband edge in Hz
% Fs is the stopband edge in Hz
% FT is the sampling frequency in Hz.  
% If none specified default value is 2
% N is the estimated FIR filter order
if nargin == 4,
	FT = 2;
end
if length(Fp) > 1,
	TBW = min(abs(Fp(1) - Fs(1)), abs(Fp(2) - Fs(2)));
else
	TBW = abs(Fp - Fs);
end
num = -20*log10(sqrt(Rp*Rs))-13;
den = 14.6*TBW/FT;
N = ceil(num/den);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?