?? autocorr.m
字號:
% Program 5-1
% autocorr.m
%
% Autocorrelation function of a sequence
%
% Programmed by M.Okita and H.Harada
%
function [out] = autocorr(indata, tn)
% ****************************************************************
% indata : input sequence
% tn : number of period
% out : autocorrelation data
% ****************************************************************
if nargin < 2
tn = 1;
end
ln = length(indata);
out = zeros(1,ln*tn);
for ii=0:ln*tn-1
out(ii+1) = sum(indata.*shift(indata,ii,0));
end
%******************************** end of file ********************************
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -