Get autocorrelation function (ACF) two various ways
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello!
I would like to find ACF from signal
first_step=0;
step_t=0.01;
last_step=1;
N_=101;
t=first_step:step_t:last_step;
y= 10*sin(2*pi*30*t) ;
and since I have signal I do:
AutoCorr_func=autocorr(y,N_-1 );% need 101 points
which gives me this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162051/image.jpeg)
also assuming that ACF is an integral of multiplying two function (one is original signal, another - signal with shifted argument to tau) My second way:
tau=0.1;
y1= 10*sin(2*pi*30*(t+tau)) ;
Y=y1.*y;
AutoCorr_func = cumtrapz(Y,t);
which gives me another result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162052/image.jpeg)
and both seems to be wrong. What is incorrect in my actions? How to do it right? Thank you!
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Generation and Preprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!