XCORR function to find the lag time between two signals

2 ビュー (過去 30 日間)
Patrico Ortega
Patrico Ortega 2019 年 2 月 20 日
編集済み: Honglei Chen 2019 年 2 月 20 日
Hello
I am using the XCORR function to find the lag time between two signals, but when processing the measured data the lag is always the same, physically it is not possible. I have noticed that the lags are whole numbers, is it possible to obtain correlation coefficients with lags with decimals?
Thank you
  1 件のコメント
Adam
Adam 2019 年 2 月 20 日
The correlation is only done at the sample rate defined so that is why lag is always integer. If you had a continuous signal then you would have a continuous lag value, but obviously that is not possible in a digitised signal. You can interpolate your signal by e.g. a factor of 10 though which will give you lags that would be the equivalent of beung 1 decimal place at the original scale.

サインインしてコメントする。

回答 (1 件)

Honglei Chen
Honglei Chen 2019 年 2 月 20 日
編集済み: Honglei Chen 2019 年 2 月 20 日
We probably need a bit more info to understand why the lag is always the same. But by default xcorr returns the delay in lags, that's why it's always a whole number. You can translate that lag to time by mulitplying it to the sampling time, and then you will start to see decimals.
HTH

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by