Suppose that we have some peaks of a signal and we know the time lag between dominant peaks. How is it possible to remove the extra peaks by applying time lag ? Lets say it in MATLAB
[corr]=xcorr(signal,signal); [val1 ind1]=max(corr); corr(ind1:length(corr))=0; % symetric properties of correlation [val2 ind2]=max(corr); lag=ind1-ind2; [pks ind]=findpeaks(signal);
Actually, I would like to remove the spurious peaks by using time-lag but maybe some dominant peaks a little less or more than exact time-lag.