📄 autofft.m
字号:
function r=autofft(x,L)
% Computation of the autocorrelation sequence
% r(l) using the FFT algorithm
% L is the length of r(l), l=0,1,...,L-1.
% The mean value is removed from the signal
% r(l)=(1/Lx)sum(x[k]x[k-l])
%
% Programmed by: Dimitris Manolakis, 10/4/93
%
%-----------------------------------------------------------
% Copyright 2000, by Dimitris G. Manolakis, Vinay K. Ingle,
% and Stephen M. Kogon. For use with the book
% "Statistical and Adaptive Signal Processing"
% McGraw-Hill Higher Education.
%-----------------------------------------------------------
Lx=length(x);
Nfft=Lx+L;
n2=round((log(Nfft)/log(2))+0.5);
Nfft=2^n2;
x=x-mean(x);
X=fft(x,Nfft);
X2=X.*conj(X);
x2=real(ifft(X2));
r=x2(1:L)/Lx;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -