3
$\begingroup$

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.

enter image description here

$\endgroup$
  • 4
    $\begingroup$ The code does not work standalone since it requires "signal" to have a certain value. Right now no one knows what "signal" is, how the desired peaks look like and how the undesired peaks look like. This makes it very difficult to give you an informed answer. Please update your question and include code to define "signal" or add some plots where you mark which peaks you want and which not. Ideally, you do both. Put some effort in your questions, please. $\endgroup$ – jan Nov 27 '13 at 11:22
  • $\begingroup$ Dear jan I cannot update photo because My reputationis not enough.sorry The signal is LP residual and I want to extract Glottal closure from it. $\endgroup$ – amir ghasemi Nov 27 '13 at 13:50
  • 2
    $\begingroup$ Upload the photo to imgur and post the link and someone will edit it into the question for you. $\endgroup$ – jonsca Nov 28 '13 at 0:05
  • $\begingroup$ How many samples length of one peak? If the length of peak is a few samples, you can use some nonlinear filtering (median?) $\endgroup$ – SergV Nov 28 '13 at 5:07
  • $\begingroup$ Every peak may has 1 or more samples. but I want to remove the spurious peaks by time-lag. $\endgroup$ – amir ghasemi Nov 29 '13 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.