The problem of autocorrelation function

According to a differential equation in matlab, the time series x(t) is obtained. To obtain the autocorrelation result of the following figure, xs(t)=x(t-s), s is also a variable, how to write a program in matlab.

답변 (1개)

Image Analyst
Image Analyst 2021년 9월 5일

0 개 추천

Isn't it just
autoCorrelation = xcorr(x, x);
but that seems so obvious so I'm wondering if this is your homework problem and you have to not use the MATLAB function and write your own version of it. If so, read the following link:
If it's not homework, xcorr() should work for you.

댓글 수: 5

wenxin liu
wenxin liu 2021년 9월 5일
편집: wenxin liu 2021년 9월 5일
Thank you,it's not my homework.It is a question when I read the article.However, what I cannot understand is. I use t∈(0,5e-5) to solve the differential equation to obtain the time series x(t). At the same time, s∈(0,5e-5), x(t-s) has two variables. I can’t do anything about it
wenxin liu
wenxin liu 2021년 9월 5일
And, I used xcorr(a,b) at the beginning, but the relationship between the variable s and t made the result of the second time delay sequence x(ts) not normally obtained. After that, I used the Fourier transform: ifft (fft(x(t)*exp(-i*2pi*s/t))), but both s and t change. I don't know how to do it. what should I do?
Image Analyst
Image Analyst 2021년 9월 5일
What differential equation? Your first sentence of your original post about differential equation has nothing to do with the rest of the post about correlation. You don't even show any differential equation, just an equation for correlation.
And how did you define your (badly-named) "a" and "b"?
What is the time difference between two samples?
wenxin liu
wenxin liu 2021년 9월 6일
Sorry, please forgive my mistake.
Here are my steps:
Step 1: I solve the differential equations (1,2) through ode45(), and get E(t),N(t)
Step 2: Let x(t)=E(t); then perform equation 3.xcorr(x(t),x(t-s)).
But s is also a variable with scope, it belongs to (0,5e-9). So I don't know what to do.
wenxin liu
wenxin liu 2021년 9월 6일

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2021년 9월 5일

댓글:

2021년 9월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by