Signal Processing - Cross-Correlation to obtain Lag times.
이전 댓글 표시
I have written code that produces a graph giving the xcorr coeff of two stochastic electromyogram signals: sEMGL and sEMGbR. % x=(sEMGL); y=(sEMGbR); [c,lags]=xcorr(x,y,'coeff'); figure (8); plot (c,lags) % My question is how to write code in Editor so that in the command window I can type 'time lag =' to obtain this scalar value in milliseconds. A secondary question is to find the derivative of each signal in order to calculate the rate of change in each signal: to evaluate whether the time lag between the signals varies in relation to the rate of change in each signal.
Please help. Kind regards, Trudy
채택된 답변
추가 답변 (1개)
Trudy
2011년 11월 3일
0 개 추천
댓글 수: 1
Wayne King
2011년 11월 3일
The sampling interval is the inverse of the sampling frequency. So in the example I gave, the sampling frequency is 1000 Hz. Each lag in the cross correlation sequence then corresponds to a time of 1/1000 seconds.
카테고리
도움말 센터 및 File Exchange에서 Correlation and Convolution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!