I'm currently working with BPSK carrier phase and frequency recovery in GNU Radio. I have been able to use Costas loop and Frequency locked loop (four carrier acquisition) which are based on the control_loop class (this class implements a PLL). Until now, I never needed to configure the control_loop class since the wrapper classes (Costas and FLL) do this by default. As it can be seen below, the control loop (PLL) is based on the proportional-plus-integrator. The control loop constructor takes three variables control_loop(loop_bw, max_freq, min_freq). max_ and min_freq variables are used to keep the frequency (in the integrator part of the loop) between max_freq and min_freq. I have looked into the Costas and FLL source code and saw how they are configured.
Let's start with Costas loop.
- The loop is configured to have max_freq/min_freq of +1 and -1 respectively
- The phase error input to the control loop i.e. (Φ_i[n] - Φ_o[n]) is bound between -1 and 1.
- After the phase error has been filtered, the output phase i.e. Φ_o[n] is wrapped (between 2pi and -2pi). The frequency is forced into the max_freq and min_freq [1,-1] region.
With the FLL,
- The loop is configured to have max_freq/min_freq of (2*PI/samples_per_symbol) and -(2*PI/samples_per_symbol) respectively.
- Unlike the Costas loop, the phase error input to the control loop i.e. Φ_i[n] is not bounded.
- Like the Costas, the output phase i.e. Φ_o[n] is wrapped (between 2pi and -2pi). The frequency is forced into the max_freq/min_freq of (2*PI/samples_per_symbol) and -(2*PI/samples_per_symbol) region.
I basically have three questions
- Why is the input phase error of the Costas loop limited in the [1,-1] region?
- How do you choose the frequency region [max_freq and min_freq] of the integrator part of the loop? why do we need to limit the frequency range?
- Why is the output phase Φ_o[n] (in both Costas and FLL) wrapped between -2PI and 2PI?
I have added links to the source code of the Costas and the FLL blocks
- Costas Loop: https://github.com/gnuradio/gnuradio/blob/master/gr-digital/lib/costas_loop_cc_impl.cc
- FLL band-edge : https://github.com/gnuradio/gnuradio/blob/master/gr-digital/lib/fll_band_edge_cc_impl.cc