lacf1.m

来自「分数阶Fourier变换程序」· M 代码 · 共 56 行

M
56
字号
function lacf = lacf1(x, mlag)% lacf1 -- Compute samples of the (type I) local acf.%%  Usage%    lacf = lacf1(x, mlag)%%  Inputs%    x      signal vector.  lacf1 assumes that x is sampled at the Nyquist%           rate and uses sinc interpolation to oversample by a factor of 2.%    mlag   maximum lag to compute.  must be <= length(x). %           (optional, defaults to length(x))%%  Outputs%    lacf  matrix containing the local acf of signal x.  If x has%          length N, then lacf will be mlag by 2N. Since lacf is symmetric,%          it is only computed for positive lags.% Copyright (C) -- see DiscreteTFDs/CopyrightN = size(x,1);if (size(x,2)>2)  error('Maximum of two columns in x.')enderror(nargchk(1, 2, nargin));if (nargin < 2)  mlag = N;endif (mlag > N)  error('mlag must be <= length(x)')endif (size(x,2)==1)  x = sinc_interp(x);  x = [x;0];  y = x;else  y = x(:,2);  x = x(:,1);  x = sinc_interp(x);  x = [x;0];  y = sinc_interp(y);  y = [y;0];endN = length(x);% create the local acf for positive taulacf = zeros(mlag, N);for t = 1:N,  mtau = min(t, N-t+1);  mtau = min(mtau, mlag);  lacf(1:mtau,t) = x(t:t+mtau-1) .* conj(y(t:-1:t-mtau+1));end

⌨️ 快捷键说明

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