I have two sensors which are placed around 30 to 40 cm apart , both of them measure the same signal say 'lambda signal'. so there is a delay in the measurement of the signal from the second sensor. During the travel there is some noise added to the signal. What are the procedure that I can use to calculate the time delay between them. According to my knowledge if I cross correlate both signals, the peak gives me the delay value of the second, but this is not working. Is there any other methods to find the time delay between eachother. Please guide me as I am new to signal processing.![Part of the signals][1]![Another part signal][2]

link: https://docs.google.com/open?id=0BzT9Q3HfpmDKZERPSGJoTEFyTzA link : https://docs.google.com/open?id=0BzT9Q3HfpmDKeVhMSnZLa3BfMjQ Thanks in advance. Naveen

  • 3
    $\begingroup$ What do you mean when exactly you say that cross correlation is "not working" ? Do you get a peak or not ? If you get a peak does it not correspond to the time difference ? $\endgroup$
    – Paul R
    Jul 11, 2012 at 11:18
  • $\begingroup$ @paul thanks for your immediately reply, I do get the peak but it is not corresponding to the time difference between them.As I am new to this community I cannot attach the pictures of the same. $\endgroup$
    – navi
    Jul 11, 2012 at 11:21
  • 1
    $\begingroup$ If you put the images back into your question as links someone can edit them in for you so they display. $\endgroup$
    – jonsca
    Jul 11, 2012 at 11:47
  • 1
    $\begingroup$ 1) It's necessary to remove the /edit part in the end of each link in order to access them; 2) Even so, the documents look blank to me. $\endgroup$ Jul 11, 2012 at 13:07
  • 2
    $\begingroup$ @naveenbsrinivasa Oh, I didn't realize they were on Google Docs, well they need to be in a graphics format (jpg/png/etc) to display inline. $\endgroup$
    – jonsca
    Jul 11, 2012 at 13:17

1 Answer 1


Comment: As a new user I am not allowed to add a comment to your question - hence this approach.

You mention that you do get a peak from the cross-correlation but that the lag estimation is incorrect. This implies that you know the correct result - is from a calibration signal or ..? And what is the lag roughly?

Could you explain what the signals look like (sinusoidals for example)? Also what is the SNR, sequence length, sampling frequency? Have you filtered the signals before sampling - if so how?

If the offset is incorrect it might be related to insufficient time resolution. Using a sampling frequency $f_s$ means that your time resolution is $T_\mathrm{s}=\frac{1}{f_\mathrm{s}}$. If this time resolution is not sufficiently small you may get an estimate that does not agree with your expectations.

There may be other techniques but this depends on the signals you have - and also if you for example know that the lag is always a fraction of a period time of a periodic signal. Some more details could help with this.

  • $\begingroup$ as both signal share like properties, like the shape of both are almost same ,if I get a exact time lag I could overlap each other ,in result roughly only one signal could be seen. And the signals are not sinus they are randomly generated signals as they represent the amount of oxygen in the exhaust gas. $\endgroup$
    – navi
    Jul 11, 2012 at 12:50
  • $\begingroup$ And the other issues about sampling frequency, the lag you expect etc.? $\endgroup$
    – Lars1
    Jul 11, 2012 at 16:29
  • $\begingroup$ depending on the frequency both have the same measuring frequency around 50hz. and the delay is not the fraction of the frequency, the delay keeps on changing as you throttle. so for analysis we consider only part by part say for every 10 seconds what is the delay and so on. $\endgroup$
    – navi
    Jul 11, 2012 at 17:01
  • $\begingroup$ What is the delay roughly expected to be? $\endgroup$
    – Lars1
    Jul 11, 2012 at 19:03
  • $\begingroup$ depends around 5 samples to 15 samples. In which region you are searching $\endgroup$
    – navi
    Jul 11, 2012 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.