need help with cross correlation output. not out putting the correct position.

2 ビュー (過去 30 日間)
Raymond Ng
Raymond Ng 2017 年 12 月 8 日
編集済み: Raymond Ng 2017 年 12 月 8 日
Hello, I have a cross correlation code written that uses findpeaks to locate positions of the high correlated signals in the waveform. My problem is when I plot my EQ output my results are completely random (visually where the highly correlated signals (very obviously seen) are not aligned. Where did I go wrong? Manually checking is not always an option since this is a piece of a much larger code where I have several hundreds 'D' data and thousands of 'T' templates to cross correlate.
D= DATA(1x360000)
T=D(2001:5000); %some small signal
nt1=length(T);
for i= nt1:(nt-nt1)
cc(i)=(max(xcorr(T,D(i:i+nt1-1), 1, 'coeff')));
end
[pks,loc]=findpeaks(cc,'MinPeakDistance',300,'MinPeakHeight',.5);
clear EQ
count=0;
for eqpk=(1:length(loc))
count=count+1;
EQ{count}=D((loc(eqpk)-100: loc(eqpk)+200));
end

回答 (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