filters.m

来自「英文书《Digital Signal Processing with Examp」· M 代码 · 共 21 行

M
21
字号
function y=filters(b,a,x)
% y=filters(b,a,x)
% 
% Same as Matlab "filter" function except b and a both have
% N rows, representing N filter sections in cascade.
%
% If N=1, the filter has only one section.
% If a=1, the filter is an FIR filter with no feedback weights.
%
% x is assumed to be a vector. If so, y is the filtered version of x.
% If not, see the description of the Matlab "filter" function.
[N,n]=size(b);
[M,m]=size(a);
if(N~=M)
   error('The b and a arrays must have the same # rows.');
end
input=x;
for i=1:N,
   y=filter(b(i,:),a(i,:),input);
   input=y;
end

⌨️ 快捷键说明

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