필터 지우기
필터 지우기

xcorr

조회 수: 2 (최근 30일)
Padma
Padma 2011년 10월 28일
Hi
Could you please tell me how to understand the delay from the output of the numbers in the below program being displayed? I know the concept of xcorr. I am new to matlab, please help me get through this.
fs=100 t = 0:1/fs:1; x = sin(2*pi*t); y = sin(2*pi*t+pi/10); plot(t,x,t,y) [c, lags] = xcorr(x,y)
Thanks in advance

채택된 답변

Wayne King
Wayne King 2011년 10월 28일
The frequency of your inputs is 1 Hz, or 2*pi radians per second
The phase lag is pi/10 radians, which corresponds to
pi/10*(1/(2*pi)) seconds. That is 5 sample points at your sampling frequency.
Look at c for c(101:110) which corresponds to lags 0 to 10. See that the maximum value occurs at lag 5, which corresonds to 0.05 seconds as expected.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by