# Digital Tanlock carrier recovery loop

I’m currently trying to understand a digital tanlock carrier recovery loop for QPSK (for example)

I cannot understand how it works.

For example we an ideal QPSK constellation.

phi = atan2(Q/I) = pi/4,3pi/4,5pi/4 or 7pi/4. After multiplying by M=4 and (mod 2pi) operation the angle is pi.

So after rotating constellation by pi we only gain phase ambiguity and no phase errors.

But how does it work in case of phase/frequency errors?

And one more question. What does "carrier tracking loop BW mean"?

I guess it refers to loop filter?

Is it the bandwidth of the filter? F(z) = Ki + Kp/(1-z^-1).

Jason thanks a lot for the answer.

You understand the basic operation of the phase detector. Reproducing some of the above, the detected phase error is:

$$e_k = M \arctan\left(\frac{i_k}{q_k}\right) \mod{2\pi}$$

As you noted, for an ideal QPSK constellation at the input to the phase detector, $$e_k = \pi$$ for all possible symbol values. However, in the presence of phase error $$\theta$$, the soft decisions at the phase detector input will have the form:

$$\tilde{s_k} = s_k + \theta, \ \theta \in \left[-\frac{\pi}{M}, \frac{\pi}{M}\right]$$

In this model, $$s_k$$ is the value of the QPSK symbol that is closest in phase to the observation. If you were making a hard decision on the symbol value based on observation $$\tilde{s_k}$$, this would be the one you would choose. Because the $$\arctan$$ function directly calculates the phase of the observed symbol, this phase error simply adds to the phase detector output: $$e_k = \pi + \theta$$. This allows the phase detector to detect the phase error in each symbol, modulo $$\frac{2\pi}{M}$$.

The job of the loop filter is to turn this stream of error outputs from the phase detector into a control signal that will adjust the frequency of the NCO that is used before the sampler. The integrator in the loop filter that you showed combats any frequency error (which manifests as a component to the phase error that increases linearly each symbol period). The proportional part of the filter will handle any constant component to the phase error as well.

Carrier tracking loop bandwidth can have multiple interpretations: sometimes it can refer to the pull-in bandwidth of the loop. For example, how large of a frequency error can I have and still expect to achieve lock? If the frequency error is too large, then the loop cannot detect and/or correct for it properly.

As a degenerate example, consider a frequency error $$\omega = \frac{\pi}{2T}$$ radians per second: this means that the carrier would spin exactly one quarter cycle between successive symbols. The phase detector described here would not detect any phase error at all (beyond the constant $$e_k = \pi$$ component discussed above).