フィルターのクリア

Increasing xcorr() resolution

4 ビュー (過去 30 日間)
Patrick Tamellini
Patrick Tamellini 2011 年 4 月 27 日
Hello,
Is there a wa y to increase the "resolution" of xcorr?
Something like zero padding for the fft()
Thanks,
Patrick

採用された回答

Daniel Shub
Daniel Shub 2011 年 4 月 28 日
Zero padding will increase the frequency resolution (i.e., reduce the spacing between frequency components), but does not affect the temporal resolution (the time between samples). The resample function increases the temporal resolution, but does not affect the frequency resolution.
a = [0, 0, 1, 0, 1, 0, 0];
b = [0, 0, 1, 1, 1, 0, 0];
upFactor = 10;
aUp = resample(a, upFactor, 1);
bUp = resample(b, upFactor, 1);
[r, lags] = xcorr(a, b, 'coeff');
[rUp, lagsUp] = xcorr(aUp, bUp, 'coeff');
lagsUp = lagsUp/upFactor;
plot(lags, r, 'b', lagsUp, rUp, 'r');
It you do not want a normalized cross-correlation, you will need to scale rUp.

その他の回答 (0 件)

カテゴリ

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