bessel_0.m

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

M
21
字号
function s=bessel_0(x)
% s=bessel_0(x)
% Zero-order Bessel function of the first kind.
% For each element of x, x(i),
% s(i)=1+sum from k=1 to inf {[((x(i)/2)^k)/k!]^2}.
% x can be any real vector, but not a matrix.
% The sum stops when the terms become negligible.
% This algorithm is due originally to J. F. Kaiser.
%
% See also: window
N=length(x);
s=ones(1,N);
for i=1:N,
   term=1;
   n=0;
   while (term>1.e-8*s),
      n=n+2;
      term=term*((x(i)/n).^2);
      s(i)=s(i)+term;
   end
end

⌨️ 快捷键说明

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