# Efficient frequency offset estimation of known signals

Let's say that my receiver will be receiving known data signals that range from the very simple (tone) to the complex (known data sequence that is modulated (PSK/QAM/OFDM/etc.)). What are the most computationally efficient ways to get a reasonably accurate estimate of the frequency offset?

• Have you tried plotting the I and Q results sample by sample against each other and looking at the rotation over time? That is, for every I(n) and Q(n) (n being the sample time number), plot those two values one on x axis the other on the y axis. Over time, you will notice they are rotating along the unit circle. The rate of rotation is your frequency offset. – Spacey Apr 6 '12 at 19:01
• @Mohammad I know that I can do it that way, I'm just not sure that it's a computationally efficient way of doing it. At the risk of beating a dead horse, the key, for me, is computational efficiency. – Jim Clay Apr 6 '12 at 19:10
• Not to say that there arent other methods, but I do not think that this way would necessarily be computationally intensive. Afterall, all you are doing it comparing I and Q values (that have to be computed anyway since you are demodulating I imagine), and just comparing the current I/Q values to a previous I/Q value some time back. Perhaps there is something I am not aware of per your project that is making this intensive computationally... how limited is your computing power for this task? – Spacey Apr 6 '12 at 19:21
• @Mohammad I suppose you're right- it's not that intensive. My particular situation is that I am looking at implementing packetization and sometimes demodulation of GSM (tone) and WiFi (PSK, OFDM) signals in an FPGA. I guess I was hoping that there was a clever way of doing the frequency offset estimation at the same time as doing the signal detection, which I will probably do using FFT-based correlations. – Jim Clay Apr 6 '12 at 19:32
• Hmm, well I searched around and I have heard of some methods that use auto-correlation to do pitch detection, (see here: dsp.stackexchange.com/questions/1317/…), ... and since you are doing cross-cors it might be worth looking at. (Cntrl-F for 'autocorrelation' and look at @Phonon's answer). – Spacey Apr 6 '12 at 20:17

## Time aligned

If the signals are time aligned, you can conjugate-multiply the received signal with the reference signal divided by its magnitude-squared. Essentially dividing by the complex reference signal.

Say the reference signal is $x(t)$, the frequency (i.e. time-varying phase) offset is $\theta(t)$ and noise is $N(t)$

Then the (time-aligned) received signal at complex baseband or Hilbert is $$r(t)= x(t) e ^{j\theta(t)} + N(t)$$

Multiplication by $$\frac{x^*(t)}{| x(t)|^2}$$ uncovers the frequency offset + noise. One can use an FFT or some such frequency estimator to recover the dominant frequency in $$f(t) = \frac{x^*(t)x(t)}{| x(t)|^2}e^{j\theta(t)} +\frac{x^*(t)}{| x(t)|^2}N(t) = e^{j\theta(t)} + N_2(t)$$

## Not Time-Aligned

If the signals are not time-aligned, then you've got a time and frequency search problem on your hand. With low SNR, this is essentially the problem solved by the cross-ambiguity function (CAF). If you've got several dB of margin you can take a shortcut.

If you have a reference signal with some AM variation; you can time-align first by AM detecting both signals and then correlating your input by the reference AM. If your reference signal doesn't have much amplitude variation, but its spectrum is "spikey" you might be able to correlate the magnitude spectra of the received and reference. This is the same trick applied in the frequency domain, rather than time domain.

With the exception of the CAF, these are all fairly cheap operations.

• I'm not quite following the "conjugate-multiply" method. I assume you are talking about multiplying the two sequences sample-by-sample, with one of them conjugated. Each product, then, would have a phase of n*fo + phi, where n is the sample number, fo is the offset frequency, and phi is the starting phase offset. Should I diff the phases to get the offset frequency phase increment? – Jim Clay Apr 7 '12 at 18:47
• Yes. If there is a constant phase offset, then the result from the conjugate-multiply operation will have linear phase. The slope of that line is the frequency offset, so differentiating will give you that. – Jason R Apr 8 '12 at 2:26
• It occurred to me that we multiply in the frequency domain to correlate/convolve in the time domain. By conjugate-multiplying in the time domain we are cross-correlating in the frequency domain. If we FFT the conjugate-multiply results we should have the frequency domain cross-correlation, right? The peak of that cross-correlation should indicate what the frequency offset is. – Jim Clay Apr 8 '12 at 21:46
• Yes. If the result from the conjugate-multiply has linear phase, then it is tone-like in nature. That will correspond to a thin peak in the frequency domain, as you noted. – Jason R Apr 9 '12 at 2:35
• Is the edited answer a bit clearer? – Mark Borgerding Apr 9 '12 at 3:23