Find position of smaller waveform within a longer noise waveform.

조회 수: 2 (최근 30일)
Philip
Philip 2012년 4월 18일
I am searching for a short waveform within a longer noisy waveform. What is the best way to find the location within the longer waveform of the best fitting match to the short waveform? I have played with xcorr and conv and look for position of maximum value, but translating from the position in the xcorr result to the position in the long waveform is causing me problems. I also have problems if the amplitude in the long waveform varies widely from position to position.
  댓글 수: 4
Thomas
Thomas 2012년 4월 18일
Can you show what you have done so far?
Philip
Philip 2012년 4월 18일
% vmatch is short waveform
% v is longer noisy waveform containing vmatch
tmp=xcorr(vmatch,v);
[maxxc,maxitmp]=max(tmp);
t_start=max(length(v),length(sbvmatch))-maxitmp;

댓글을 달려면 로그인하십시오.

답변 (1개)

Roshin Kadanna Pally
Roshin Kadanna Pally 2012년 4월 19일
You can try the following:
Normalize your sequences as shown below:
v = (v - mean(v))/std(v,1);
Make the two sequences of equal length by zero padding and use:
[C,lag] = xcorr(v,vmatch,'unbiased')

카테고리

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