📄 polefilt.m
字号:
% MATLAB SIMULATION OF NSA FS-1016 CELP v3.2
% COPYRIGHT (C) 1995-99 ANDREAS SPANIAS AND TED PAINTER
% This Copyright applies only to this particular MATLAB implementation
% of the FS-1016 CELP coder. The MATLAB software is intended only for educational
% purposes. No other use is intended or authorized. This is not a public
% domain program and distribution to individuals or networks is strictly
% prohibited. Be aware that use of the standard in any form is goverened
% by rules of the US DoD. Therefore patents and royalties may apply to
% authors, companies, or committees associated with this standard, FS-1016. For
% questions regarding the MATLAB implementation please contact Andreas
% Spanias at (602) 965-1837. For questions on rules,
% royalties, or patents associated with the standard, please contact the DoD.
%
% ALL DERIVATIVE WORKS MUST INCLUDE THIS COPYRIGHT NOTICE.
%
% ******************************************************************
% POLEFILT
%
% PORTED TO MATLAB FROM CELP 3.2a C RELEASE
% 6-22-94
%
% ******************************************************************
%
% DESCRIPTION
%
% Direct form IIR, all-pole filter
%
% DESIGN NOTES
%
% Recursive all-pole in-place time-domain filter.
% The transfer function 1/A(z) is implemented
% in a direct form realisation.
%
% N -i
% H(z) = 1 / SUM a(i)z with a(0) = +1.0
% i=0
%
% NOTE: a(0) is not used for the actual computing,
% as can easily be seen in the following flow graph.
%
% x(t) ->---+------->--------(z0)-----> y(t)
% | |
% +-------< -a1 ----z1
% | |
% +-------< -a2 ----z2
% | |
% : :
% | |
% +-------< -aN ----zN
%
% VARIABLES
%
% INPUTS
% a - N+1 tap weights
% n - Filter order, N
% z - Filter memory
% xy - Input sequence
% len - Input sequence length
%
% OUTPUTS
% z - Filter memory
% xy - Output sequence
%
% INTERNALS
% t - Sequence index value
% ar - Weighted sum accumulator
%
% ******************************************************************
function [ z, xy ] = polefilt( a, n, z, xy, len )
if a(1) ~= 1.0
fprintf( 'polefilt: bad coefficients\n');
end
for t = 1:len
z(1) = xy(t) - sum( z(2:n+1) .* a(2:n+1) );
z(2:n+1) = z(1:n);
xy(t) = z(1);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -