# Phase of matched filter for chirp signals

I am using the following system: Ultrasonic chirp signals with central frequency 100kHz are being transmitted using ultrasonic sensor. After the transmission through the medium(air/solid/liquid/combination) they are being received with hydrophone. The system is being controled by DSP and signal generation and acquisition is obtained via DAC and ADC. After reception we are performing demodulation and then complex matched filtering. Our aim is to detect the time of arrival between transmission and reception. So far I have been only observing the peak of absolute value of matched filter output as the moment that corresponds to time of arrival, but if I am correct the phase of the matched filter output can also be used. My question is, should the phase of matched filter output be zero at the moment of the peak in the absolute value of matched filter output?

For a constant frequency signal, with no frequency offset between transmitter and receiver, the phase of a complex correlation, at the correlation peak, is the phase difference between the received signal and the reference signal used for the matched filter. It need not be 0. And that is for the actual correlation peak, which may have to be obtained by interpolation between the two samples that surround the peak.

I haven't worked out the math for a chirp. I would not rely on the phase of the complex correlation being 0 at the correlation peak.

• And as far as peak of matched filter output is concerned, should it be right at the position of reference signal within the received, if I just consider received signal as a delayed version of the reference signal (for example in Matlab)? – Deanna77 Jun 25 '20 at 12:29
• The peak output of the the matched filter (aka correlation filter) occurs when the all the received samples of the copy of the desired signal are shifted into the filter. Thus at the of the received chirp in your case. – Andy Walls Jun 25 '20 at 13:03

As explained in the comments for previous versions of this question, a matched filter alone (using the cross-correlation specifically which can be done efficiently with FFT's) should be used with caution for purposes of estimating time delay. The reason why has been detailed in this other post linked below along with a robust least-square solution for estimating the average delay when the sounding signal properly occupies the complete spectral bandwidth of the channel.

A Delay Between Two Filtered Chaotic Signals

For non-dispersive channels the simpler approach using the cross-correlation (matched-filter) can be done in which case the following relationship can be used for efficient FFT implementation:

$$XCORR = \text{ifft}(\text{fft}(t(n))\text{fft}^*(r(n)))$$

Where (*) represents the complex conjugate. This is to say that the circular cross-correlation between the signals $$t(n)$$ and $$r(n)$$ is equal to the inverse FFT of the complex conjugate product of their FFT's.

The phase of the result would provide a precise delay measurement if a single frequency was used since time delay is the negative derivative of phase with respect to frequency. At any given frequency the period is $$2\pi$$ radians, thus the phase for any given tone is modulo with the delay according to:

$$\theta = 2\pi \tau f$$

Where $$\tau$$ is the delay and $$f$$ is the frequency of the tone.

Given the OP is using a chirp, a frequency domain measurement of the channel transfer function could then provide delay from phase given the above relationship (and for a non-dispersive channel we would see a linear phase result versus frequency). This is in fact the reason why in my first paragraph that for all cases when the phase is not linear, a simple matched filter result cannot be effectively used to determine the time delay of the channel since the delay is variable versus frequency. This frequency domain result specifically can be used to determine that variability and therefore the practicality of time of arrival measurements for the given channel.