# phase offset extraction using matched filter

I'm looking for an application of detecting the drift of a received signal carrier frequency from ADC clock of the receiver (in case of no drift, ADC clock should be optimally an integer multiple of signal's carrier frequency), which can be observed as a varying offset component of the instantaneous phase. one proposed solution that I found was to use a matched filter to extract the variable offset. Yet I didn't find any supporting description to understand the mechanism. did anyone come across such an implementation?

This is a common implementation for carrier recovery and tracking.

A matched performs a correlation of the received sequence with the expected sequence as given by:

$$\sum_{n=0}^{N-1}r[n]x^*[n]$$

Which states a correlation over N samples is performed by multiplying and accumulating the time-aligned received sequence $$r[n]$$ with the (complex conjugate of for complex signals) the expected ideal sequence $$x[n]$$. Note how any phase shift on $$r[n]$$ would result in the same phase shift on the result (any phase introduced on the ADC sampling clock would be translated to $$r[n]$$ directly as the sampled received signal):

$$\sum_{n=0}^{N-1}r[n]e^{j\theta}x^*[n] = e^{j\theta}\sum_{n=0}^{N-1}r[n]x^*[n]$$

Often a frequency offset is involved (which is a phase linearly changing with time), in which case we need to be aware of the resolution bandwidth of the matched filter, which is how the magnitude of the correlation result reduces as a function of frequency offset. For example If the matched filter is on constant magnitude coefficients (such as a moving average filter), the correlation magnitude will go down as a Sinc function with the first null at $$1/T$$ Hz where $$T$$ is the time length in seconds of the correlation.

But given the correlation result provides the carrier phase as shown above, if there is a small frequency offset, we can measure that precisely with successive results of the matched filter output given we will be observing a change of phase with a change in time (which is frequency given by $$d\phi/dt$$).

This is demonstrated below with captured data for live GPS signals where the matched filter (in this case for satellite SV24) is providing a sliding correlation over the 1 ms long GPS course-acquisition code, resulting in the spikes every 1 ms in the plots below indicating when the code aligns with the received signal. However the correlation is going up and down from to the underlying phase rotation due to a frequency offset.

This rotation is clearer on an IQ plot of the same result above, plotting the magnitude and phase on a complex polar plot:

By evaluating the angle over time of the correlation peaks, the frequency offset was determined in this case to be 38 Hz, and after correction the same above plots appear as follows, revealing the GPS data message (we see from the IQ plot that a small residual phase error exists that could also be removed):

• Thanks Dan, how is the 38Hz is determined? is there a block diagram for this method of carrier synchronization? Jun 21 '20 at 6:00
• @MenoNoyb See dsp.stackexchange.com/questions/17297/… Jun 21 '20 at 12:20