I have 2(adsbygoogle = window.adsbygoogle || []).push({}); PERFECTdata of the transmitter and receiver. From 2 data, I can calculate the delay estimation:

Fs = 8e6; % sample rate

...

for i = 1:2

[cc_correlation,lag] = xcorr(signal2(i), signal1);

[cc_maximum, cc_time] = max(abs(cc_correlation));

cc_estimation = abs(length(signal1) - cc_time);

delay(i) = cc_estimation/Fs;

end

Then I have the matrix of delays are 11 microseconds and 13.875 microseconds.

The expectation in nanosecond from this function because from the sampling rate, I can see the period time T=1/Fs=125ns. Therefore, the delay should be innanosecond,not microsecondas I had.

When I call the matlab function above:

[cc_maximum, cc_time] = max(abs(cc_correlation));

It returns the values which are called cc_maximum, and another value cc_time. It is sample data.

What did I do wrong for this algorithm?

My professor also said:"you don’t have function, you have sample version of the function, the xcorr is a waveform of continuous function, they have a maximum in the current of time. When you work with a sample, the waveform you have entire function tell the value of the function you have discrete time"

and I still do not understand what his mean?

I hope someone can help me out.

Thank you.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# What is preventing me from achieving better accuracy for this delay?

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads - preventing achieving better | Date |
---|---|

Why don't Marinas have GFCI protection to prevent Electrical Shock Drowning? | Jun 19, 2017 |

Eval op amp achieves +/- power from single power supply? | Mar 14, 2017 |

How to prevent increasing current above a certain level? | Aug 31, 2015 |

Folk belief about preventing lightning damage | May 8, 2015 |

What prevents abrupt voltage change in a capacitor? | Aug 30, 2014 |

**Physics Forums - The Fusion of Science and Community**