# Costas loop

A Costas loop is a phase-locked loop (PLL) based circuit which is used for carrier frequency recovery from suppressed-carrier modulation signals (e.g. double-sideband suppressed carrier signals) and phase modulation signals (e.g. BPSK, QPSK). It was invented by John P. Costas at General Electric in the 1950s.[1][2] Its invention was described[3] as having had "a profound effect on modern digital communications". The primary application of Costas loops is in wireless receivers. Its advantage over other PLL-based detectors is that at small deviations the Costas loop error voltage is ${\displaystyle \sin(2(\theta _{i}-\theta _{f}))}$ as compared to ${\displaystyle \sin(\theta _{i}-\theta _{f})}$. This translates to double the sensitivity and also makes the Costas loop uniquely suited for tracking Doppler-shifted carriers, especially in OFDM and GPS receivers.[3]

## Classical implementation

Costas loop working in the locked state.

In the classical implementation of a Costas loop,[4] a local voltage-controlled oscillator (VCO) provides quadrature outputs, one to each of two phase detectors, e.g., product detectors. The same phase of the input signal is also applied to both phase detectors, and the output of each phase detector is passed through a low-pass filter. The outputs of these low-pass filters are inputs to another phase detector, the output of which passes through a noise-reduction filter before being used to control the voltage-controlled oscillator. The overall loop response is controlled by the two individual low-pass filters that precede the third phase detector, while the third low-pass filter serves a trivial role in terms of gain and phase margin.

The above figure of a Costas loop is drawn under the "locked" state, where the VCO frequency and the incoming carrier frequency have become the same due to the Costas loop process. The figure does not represent the "unlocked" state.

## Mathematical models

### In the time domain

Time domain model of BPSK Costas loop

In the simplest case ${\displaystyle m^{2}(t)=1}$. Therefore, ${\displaystyle m^{2}(t)=1}$ does not affect the input of the noise-reduction filter. The carrier and voltage-controlled oscillator (VCO) signals are periodic oscillations ${\displaystyle f_{ref,vco}(\theta _{ref,vco}(t))}$ with high-frequencies ${\displaystyle {\dot {\theta }}_{ref,vco}(t)}$. The block ${\displaystyle \bigotimes }$ is an analog multiplier.

A linear filter can be described mathematically by a system of linear differential equations:

${\displaystyle {\begin{array}{ll}{\dot {x}}=Ax+bu_{d}(t),&u_{LF}=c^{*}x.\end{array}}}$

where ${\displaystyle A}$ is a constant matrix, ${\displaystyle x(t)}$ is a state vector of the filter, ${\displaystyle b}$ and ${\displaystyle c}$ are constant vectors.

The model of a VCO is usually assumed to be linear:

${\displaystyle {\begin{array}{ll}{\dot {\theta }}_{vco}(t)=\omega _{vco}^{free}+K_{vco}u_{LF}(t),&t\in [0,T],\end{array}}}$

where ${\displaystyle \omega _{vco}^{free}}$ is the free-running frequency of the VCO and ${\displaystyle K_{vco}}$ is the VCO gain factor. Similarly, it is possible to consider various nonlinear models of VCO.

Suppose that the frequency of the master generator is constant ${\displaystyle {\dot {\theta }}_{ref}(t)\equiv \omega _{ref}.}$ Equation of VCO and equation of filter yield

${\displaystyle {\begin{array}{ll}{\dot {x}}=Ax+bf_{ref}(\theta _{ref}(t))f_{vco}(\theta _{vco}(t)),&{\dot {\theta }}_{vco}=\omega _{vco}^{free}+K_{vco}c^{*}x.\end{array}}}$

The system is non-autonomous and rather tricky for investigation.

### In the phase-frequency domain

Equivalent phase-frequency domain model of Costas loop
VCO input for phase-frequency domain model of Costas loop

In the simplest case, when

{\displaystyle {\begin{aligned}f_{ref}{\big (}\theta _{ref}(t){\big )}=\cos {\big (}\omega _{ref}t{\big )},\ f_{vco}{\big (}\theta _{vco}(t){\big )}&=\sin {\big (}\theta _{vco}(t){\big )}\\f_{ref}{\big (}\theta _{ref}(t){\big )}^{2}f_{vco}\left(\theta _{vco}(t)\right)f_{vco}\left(\theta _{vco}(t)-{\frac {\pi }{2}}\right)&=-{\frac {1}{8}}{\Big (}2\sin(2\theta _{vco}(t))+\sin(2\theta _{vco}(t)-2\omega _{ref}t)+\sin(2\theta _{vco}(t)+2\omega _{ref}t){\Big )}\end{aligned}}}

The standard engineering assumption is that the filter removes the upper sideband frequency from the input but leaves the lower sideband without change. Thus it is assumed that the VCO input is ${\displaystyle \varphi (\theta _{ref}(t)-\theta _{vco}(t))={\frac {1}{8}}\sin(2\omega _{ref}t-2\theta _{vco}(t)).}$ This makes a Costas loop equivalent to a phase-locked loop with phase detector characteristic ${\displaystyle \varphi (\theta )}$ corresponding to the particular waveforms ${\displaystyle f_{ref}(\theta )}$ and ${\displaystyle f_{vco}(\theta )}$ of the input and VCO signals. It can be proved that filter outputs in the time and phase-frequency domains are almost equal.[5][6][7]

Thus it is possible[8] to study the simpler autonomous system of differential equations

{\displaystyle {\begin{aligned}{\dot {x}}&=Ax+b\varphi (\Delta \theta ),\\\Delta {\dot {\theta }}&=\omega _{vco}^{free}-\omega _{ref}+K_{vco}c^{*}x,\\\Delta \theta &=\theta _{vco}-\theta _{ref}.\end{aligned}}}.

The Krylov–Bogoliubov averaging method allows one to prove that solutions of non-autonomous and autonomous equations are close under some assumptions. Thus, the Costas loop block diagram in the time domain can be asymptotically changed to the block diagram on the level of phase-frequency relations.

The transition to the analysis of an autonomous dynamical model of the Costas loop (in place of the non-autonomous one) allows one to overcome the difficulties related to modeling the Costas loop in the time domain, where one has to simultaneously observe a very fast time scale of the input signals and slow time scale of signal's phase. This idea makes it possible[9] to calculate core performance characteristics - hold-in, pull-in, and lock-in ranges.

## Frequency acquisition

 Costas loop before synchronization Costas loop after synchronization
 Carrier and VCO signals before synchronization VCO input during synchronization Carrier and VCO signals after synchronization

The classical Costas loop will work towards making the phase difference between the carrier and the VCO become a small, ideally zero, value.[10][11][12] The small phase difference implies that frequency lock has been achieved.

## QPSK Costas loop

The classical Costas loop can be adapted to QPSK modulation for higher data rates.[13]

Classical QPSK Costas loop

The input QPSK signal is as follows

${\displaystyle m_{1}(t)\cos \left(\omega _{\text{ref}}t\right)+m_{2}(t)\sin \left(\omega _{\text{ref}}t\right),m_{1}(t)=\pm 1,m_{2}(t)=\pm 1.}$

Inputs of low-pass filters LPF1 and LPF2 are

{\displaystyle {\begin{aligned}\varphi _{1}(t)&=\cos \left(\theta _{\text{vco}}\right)\left(m_{1}(t)\cos \left(\omega _{\text{ref}}t\right)+m_{2}(t)\sin \left(\omega _{\text{ref}}t\right)\right),\\\varphi _{2}(t)&=\sin \left(\theta _{\text{vco}}\right)\left(m_{1}(t)\cos \left(\omega _{\text{ref}}t\right)+m_{2}(t)\sin \left(\omega _{\text{ref}}t\right)\right).\end{aligned}}}

After synchronization, the outputs of LPF1 ${\displaystyle Q(t)}$ and LPF2 ${\displaystyle I(t)}$ are used to get demodulated data (${\displaystyle m_{1}(t)}$ and ${\displaystyle m_{2}(t)}$). To adjust the frequency of the VCO to the reference frequency, signals ${\displaystyle Q(t)}$ and ${\displaystyle I(t)}$ are limited and cross-multiplied:

${\displaystyle u_{d}(t)=I(t)\operatorname {sgn}(Q(t))-Q(t)\operatorname {sgn}(I(t)).}$

Then the signal ${\displaystyle u_{d}(t)}$ is filtered by the loop filter and forms the tuning signal for the VCO ${\displaystyle u_{\text{LF}}(t)}$, similar to BPSK Costas loop. Thus, QPSK Costas can be described[14] by a system of ordinary differential equations:

{\displaystyle {\begin{aligned}{\dot {x}}_{1}&=A_{\text{LPF}}x_{1}+b_{\text{LPF}}\varphi _{1}(t),\\{\dot {x}}_{2}&=A_{\text{LPF}}x_{2}+b_{\text{LPF}}\varphi _{2}(t),\\{\dot {x}}&=A_{\text{LF}}x+b_{\text{LF}}{\big (}c_{\text{LPF}}^{*}x_{1}\operatorname {sgn}(c_{\text{LPF}}^{*}x_{2})-c_{\text{LPF}}^{*}x_{2}\operatorname {sgn}(c_{\text{LPF}}^{*}x_{1}){\big )},\\{\dot {\theta }}_{\text{vco}}&=\omega _{\text{vco}}^{\text{free}}+K_{\text{VCO}}{\Big (}c_{\text{LF}}^{*}x+h_{\text{LF}}{\big (}c_{\text{LPF}}^{*}x_{1}\operatorname {sgn}(c_{\text{LPF}}^{*}x_{2})-c_{\text{LPF}}^{*}x_{2}\operatorname {sgn}(c_{\text{LPF}}^{*}x_{1}){\big )}{\Big )}.\\\end{aligned}}}

Here ${\displaystyle A_{\text{LPF}},b_{\text{LPF}},c_{\text{LPF}}}$ are parameters of LPF1 and LPF2 and ${\displaystyle A_{\text{LF}},b_{\text{LF}},c_{\text{LF}},h_{\text{LF}}}$ are parameters of the loop filter.

## References

1. ^ Costas, John P. (1956). "Synchronous communications". Proceedings of the IRE. 44 (12): 1713–1718. doi:10.1109/jrproc.1956.275063.
2. ^ Costas, John P. (August 2002) [1956]. "Synchronous Communications". Proceedings of the IEEE. 90 (8): 1461–1466. doi:10.1109/JPROC.2002.800876.
3. ^ a b Taylor, D. (August 2002). "Introduction to 'Synchronous Communications', A Classic Paper by John P. Costas". Proceedings of the IEEE. 90 (8): 1459–1460. doi:10.1109/jproc.2002.800719.
4. ^ Feigin, Jeff (January 1, 2002). "Practical Costas loop design" (PDF). RF Design: 20–36. Archived from the original (PDF) on February 11, 2012. Retrieved February 17, 2010.
5. ^ Leonov, G. A.; Kuznetsov, N. V.; Yuldashev, M. V.; Yuldashev, R. V. (August 2012). "Differential equations of Costas loop" (PDF). Doklady Mathematics. 86 (2): 723–728. doi:10.1134/s1064562412050080.
6. ^ Leonov, G. A.; Kuznetsov, N. V.; Yuldashev, M. V.; Yuldashev, R. V. (2012). "Analytical method for computation of phase-detector characteristic" (PDF). IEEE Transactions on Circuits and Systems Part II. 59 (10): 633–637. doi:10.1109/tcsii.2012.2213362.
7. ^ Leonov, G. A.; Kuznetsov, N. V.; Yuldashev, M. V.; Yuldashev, R. V. (2015). "Nonlinear dynamical model of Costas loop and an approach to the analysis of its stability in the large" (PDF). Signal Processing. Elsevier. 108: 124–135. doi:10.1016/j.sigpro.2014.08.033.
8. ^ Kuznetsov, N. V.; Leonov, G. A.; Neittaanmaki, P.; Seledzhi, S. M.; Yuldashev, M. V.; Yuldashev, R. V. (2012). "Nonlinear mathematical models of Costas Loop for general waveform of input signal". IEEE 4th International Conference on Nonlinear Science and Complexity, NSC 2012 – Proceedings. IEEE Press (6304729): 75–80. doi:10.1109/NSC.2012.6304729. ISBN 978-1-4673-2703-9.
9. ^ Kuznetsov, N. V.; Leonov, G. A.; Seledzhi, S. M.; Yuldashev, M. V.; Yuldashev, R. V. (2017). "Nonlinear model of the optical Costas loop: pull-in range estimation and hidden oscillations". IFAC-PapersOnLine. ELSEVIER. 50: 3325–3330. doi:10.1016/j.ifacol.2017.08.514. ISSN 2405-8963.
10. ^ Costas 1956 states, "The local oscillator must be maintained at proper phase so that the audio output contributions of the upper and lower sidebands reinforce one another. If the oscillator phase is 90° away from the optimum value, a null in audio output will result, which is typical of detectors of this type. The actual method of phase control will be explained shortly, but for the purpose of this discussion, maintenance of correct oscillator phase shall be assumed."
11. ^ Using a loop filter with an integrator allows a steady-state phase error of zero. See PID controller § Integral term.
12. ^ Best, Roland E. (1997). Phase-Locked Loops (third ed.). New York: McGraw-Hill. pp. 44–45. ISBN 0-07-006051-7.
13. ^ US patent 4,085,378, Carl R. Ryan & James H. Stilwell, "QPSK demodulator", published 1976-11-26, assigned to Motorola Solutions Inc.
14. ^ Best, R. E.; Kuznetsov, N. V.; Leonov, G. A.; Yuldashev, M. V.; Yuldashev, R. V. (2016). "Tutorial on dynamic analysis of the Costas loop". Annual Reviews in Control. ELSEVIER. 42: 27–49. arXiv:1511.04435. doi:10.1016/j.arcontrol.2016.08.003.