The goal of the PLL is to maintain a demodulating sine and
cosine that match the incoming carrier. Suppose
ω
c
ω
c
is the believed digital carrier frequency. We can
then represent the actual received carrier frequency as the
expected carrier frequency with some offset,
ω
c
˜
=
ω
c
+
θ
˜
n
ω
c
˜
ω
c
θ
˜
n
. The NCO generates the demodulating sine and
cosine with the expected digital frequency
ω
c
ω
c
and offsets this frequency with the output of the
loop filter. The NCO frequency can then be modeled as
ω
c
^
=
ω
c
+
θ
^
n
ω
c
^
ω
c
θ
^
n
. Using the appropriate trigonometric identities
, the in-phase and quadrature signals can
be expressed as
z
0
n=1/2cos
θ
˜
n-
θ
^
n+cos2
ω
c
+
θ
˜
n+
θ
^
n
z
0
n
12
θ
˜
n
θ
^
n
2
ω
c
θ
˜
n
θ
^
n
(4)
z
Q
n=1/2sin
θ
˜
n-
θ
^
n+sin2
ω
c
+
θ
˜
n+
θ
^
n
z
Q
n
12
θ
˜
n
θ
^
n
2
ω
c
θ
˜
n
θ
^
n
(5)
After applying a low-pass filter to remove the double
frequency terms, we have
y
1
n=1/2cos
θ
˜
n-
θ
^
n
y
1
n
12
θ
˜
n
θ
^
n
(6)
y
Q
n=1/2sin
θ
˜
n-
θ
^
n
y
Q
n
12
θ
˜
n
θ
^
n
(7)
Note that the quadrature signal,
z
Q
n
z
Q
n
, is zero when the received carrier and internally
generated waves are exactly matched in frequency and phase.
When the phases are only slightly mismatched we can use the
relation
∀θ,small:sinθ≈θ
θ
small
θ
θ
(8)
and let the current value of the quadrature
channel approximate the phase difference:
z
Q
n≈
θ
˜
n-
θ
^
n
z
Q
n
θ
˜
n
θ
^
n
. With the exception of the sign error, this
difference is essentially how much we need to offset our NCO
frequency. To make sure that the sign of the phase
estimate is right, in this example the phase detector is
simply negative one times the value of the quadrature
signal. In a more advanced receiver, information from both
the in-phase and quadrature branches is used to generate an
estimate of the phase error.