The receiver samples this waveform at times $nT_S+hat epsilon _Delta$ where $hat epsilon _Delta$ is its estimate of timing offset at that time. Therefore, the sampled received waveform in the absence of noise can be written as
begin
r(nT_S+hat epsilon _Delta) = sum _ a[i] p(nT_S+hat epsilon _Delta-iT_M-epsilon _Delta)
end
In the above equation, we have ignored every other distortion at the Rx except for a symbol timing offset $epsilon _Delta$. This signal is input to a matched filter $h(nT_S) = p(-nT_S)$ and the output is written as
begin
z(nT_S+hat epsilon _Delta) = sum limits _i a[i] r_p(nT_S+hat epsilon _Delta -iT_M -epsilon _Delta)
end
Here, $r_p(nT_S)$ is the corresponding Nyquist pulse.
Maximum Likelihood Timing Error Detector (TED)
For unknown symbols, the likelihood function is maximum when the energy in the matched filter output $|z(nT_S+hat epsilon _Delta)|^2$ is maximum. Taking its derivative at symbol $m$ and ignoring an irrelevant constant, the maximum likelihood Timing Error Detector (TED) is
beginlabel
e[m] = z(mT_M+hat epsilon _Delta) cdot underbrace_<text>
end
It is evident that the maximum likelihood occurs where the derivative term approaches zero which coincides with the peak of the pulse for a single symbol and maximum eye opening for a shaped symbol stream.
Early-Late Timing Error Detector (TED)
For a Rx operating at $L=2$ samples/symbol, the second term in the maximum likelihood TED can be approximated with a differentiator computing only the first central difference, i.e., the term $z'(mT_M+hat epsilon _Delta)$ can be approximated from one sample to the right (at $+T_M/2$) and one sample to the left (at $-T_M/2$) of the current time instant.
[
z'(mT_M+hat epsilon _Delta) approx zleft(mT_M+frac<2>+hat epsilon _Deltaright) –
zleft(mT_M-frac<2>+hat epsilon _Deltaright)
]
From Eq (ref), this leads to an early-late approximation to the maximum likelihood TED known as Early-Late Timing Error Detector (EL-TED) as
beginlabel
e[m] = z(mT_M+hat epsilon _Delta) left<2>+hat epsilon _Deltaright) –
zleft(mT_M-frac<2>+hat epsilon _Deltaright)right>
end
The problem is that at the startup, the Rx does not know which sample out of $L=2$ samples corresponds to the symbol estimate $z(mT_M+hat epsilon _Delta)$. Another sample like the one at $+T_M/2$ or $-T_M/2$ can easily be mistaken as the one corresponding to $T_M$.
To answer this question, consider the figure below and apply the early-late equation for $b$, $c$ and $d$.
begin
e[m] = ccdot (b-d) > 0
end
Consequently, it is treated as a case of early sampling $hat epsilon _Delta
Now let us see what happens when a different TED is formed from the same samples as in Eq (ref) but with a negative derivative term.
beginlabel
e[m] = dcdotbig <-(c-e)big>= dcdot (e-c) > 0
end
Thus, the sampling instant will be pulled forwards until the middle sample $d$ reaches $mT_M-T_M/2$, i.e., in this game of $3$ samples, the middle sample approaches the zero crossing. Then, the left neighbouring sample $e$ will coincide with symbol $a[m-1]$ while the right neighbouring sample $c$ will coincide with $a[m]$. From this observation, Eq (ref) and Eq (ref), we can write the expression for the new TED as
beginlabel
e[m] = zleft(mT_M-frac<2>+hat epsilon _Deltaright) cdotBig
end
which is nothing but the Gardner TED, a non-data-aided version of a general idea known as a Zero Crossing TED (ZC-TED).
The converging locations of the EL-TED and the ZC-TED are shown in the figure below. We conclude from Eq (ref) that negating the slope in a maximum likelihood TED makes the algorithm target the zero crossings of the waveform. While one of the samples aligns with the zero crossings, the other sample automatically aligns with the maximum eye opening due to $T_M/2$ spacing between them.
Clearly, Gardner TED is not an approximation of the maximum likelihood TED. It exploits the fact that the real purpose of a TED is not necessarily finding the maximum of the likelihood function but instead generating an error signal $e[m]$ that converges towards zero.
The Error and Clarification
However, [2] and numerous other references, including Gardner himself [1], have expressed the TED as
a negative version of the one in Eq (ref). Applying a similar analysis as in Eq (ref), such an expression eventually converges towards the EL-TED form in Eq (ref).
Having these two different expressions, i.e., Eq (ref) and Eq (ref), has been a source of confusion and has sometimes lead to erroneous application of the Gardner TED. Next, we discuss the root cause behind this difference in these expressions.
An S-curve for a carrier phase and carrier frequency error detector always has a positive slope at the origin. While many scientists also link the proper operation of a timing error detector with a positive slope at the origin, many others treat the S-curve as having a negative slope. The reason is as follows.
- A timing error $epsilon _Delta$ is introduced in a PAM waveform as
begin
z(t) = sum limits _i a[i] r_p(t -iT_M -epsilon _Delta)
end
It is sampled at $t = nT_S+hat epsilon _Delta$ which yields
begin
z(nT_S +hat epsilon _Delta) &= sum limits _i a[i] r_pBig[ nT_S+hat epsilon _Delta -iT_M-epsilon _DeltaBig]nonumber \
&= sum limits _i a[i] r_pBig[nT_S -iT_M-epsilon _<Delta:e>Big]label
end
where
begin
epsilon _ <Delta:e>equiv epsilon _Delta-hat epsilon _Delta
end
When $epsilon _<Delta:e>>0$, i.e., $epsilon _Delta > hat epsilon _Delta$, our estimate $hat epsilon _Delta$ should increase. Similarly, when $epsilon _ <Delta:e>0$, it should decrease: the resulting S-curve has a negative slope at the origin.
The scientists following the former approach define Gardner TED as in Eq (ref) and EL-TED as in Eq (ref) that converges to Eq (ref). On the other hand, those following the latter approach define the Gardner TED as in Eq (ref). The confusion between a Gardner TED and an EL-TED is thus clarified.
This lead [2] to mistaking the Gardner TED as another approximation to the maximum likelihood TED, although the real approximation was the EL-TED. Interestingly, this is what lead to Gardner himself deriving the TED in [1] through the former approach but then reversing the sign of the error signal at the last moment so that the TED slope could become negative at the origin. According to him, «the reversal of sign has no significance in the formal manipulations or in the processor’s computation burden, but assures negative slope at the tracking point of the detector output».
References
[1] F. M. Gardner, A BPSK/QPSK timing-error detector for sampled receivers, IEEE Transactions on Communications, Vol. 34, No. 5, May 1986.
[2] M. Oerder, “Derivation of Gardner’s timing-error detector from the maximum likelihood principle,”, IEEE Transactions on Communications, Vol. 35, No. 6, 1987.
Источник
Gardner Timing Error Detector: A Non-Data-Aided Version of Zero-Crossing Timing Error Detectors
Timing synchronization plays the role of the heart of a digital communication system. We have already seen how a timing locked loop, commonly known as symbol timing PLL, works where I explained the intuition behind the maximum likelihood Timing Error Detector (TED). A simplified version of maximum likelihood TED, known as Early-Late Timing Error Detector, was also covered before. Today we discuss a different timing synchronization philosophy that is based on zero-crossing principle. It is commonly known as Gardner timing recovery .
Background
Before we start this topic, I recommend that you read about Pulse Amplitude Modulation (PAM) for an introduction to digital systems, the framework in which timing synchronization algorithms are described here. The notations for the main parameters are the following.
- Sample time (inverse of sample rate): $T_S$
- Symbol time (inverse of symbol rate): $T_M$
- Data symbols: $a[m]$
- Timing error: $epsilon _Delta$
- Timing error estimate: $hat epsilon _Delta$
The samples at the matched filter output in a Pulse Amplitude Modulated (PAM) system are denoted by
begin
cdots, z((n-2)T_S), z((n-1)T_S), z(nT_S)), z((n+1)T_S), z((n+2)T_S), cdots
end
where $T_S$ is the sampling time and the oversampling factor is 2. The question is: How do we know which sample corresponds to the symbol peak? At the startup time of the Rx, all we have is a series of samples spaced by half-symbol period $T_M/2$ where $T_M$ is the symbol time. Depending on the actual $epsilon_Delta$, we could have
begin
z((n-2)T_S)
z((m-1)T_M+hat epsilon_Delta) quad text\
z((n-1)T_S)
z(mT_M-frac<2>+hat epsilon_Delta) \
z(nT_S)
z(mT_M+hat epsilon_Delta) quad text \
z((n+1)T_S)
z(mT_M+frac<2>+hat epsilon_Delta) \
z((n+2)T_S)
z((m+1)T_M+hat epsilon_Delta) quad text
end
or we could have either $z((n-1)T_S)$ or $z((n+1)T_S)$ correspond to the symbol peak with other samples identified around accordingly. This is because frame synchronization can take us to the correct symbol level only, not the sample.
To answer this question, consider the figure below with samples denoted as $b$, $c$, $d$ and $e$.
Applying the early-late equation for three TED samples $b$, $c$ and $d$,
begin
e_D[m] = ccdot (b-d) > 0
end
However, if we had identified the three TED samples as $c$, $d$ and $e$, then
beginlabel
e_D[m] = dcdot (c-e)
end
Since $c-e$ $>$ $0$ and $d$ is negative,
begin
d cdot(c-e) epsilon_Delta$ (and hence the negative output in the above expression). The TLL would have brought the sampling instant earlier until the middle sample $d$ reached the instant $(m-1)T_M$ and hence identified as $z((m-1)T_M)$. The left and right samples, namely $e$ and $c$, approach zero in the meanwhile, as illustrated by the figure above.
Towards Zero Crossings
An alternative strategy is a zero crossing timing error detector where the algorithm targets the zero crossings of the waveform. This is done by negating the slope . So let us find out what happens with negating the slope in an early-late expression, for which we again consider the same samples $c$, $d$ and $e$ considered above in Eq (ref) with respect to the last figure above.
begin
e_D[m] = dcdotbig <-(c-e)big>= dcdot (e-c)
end
Since $d$ is negative while $e-c$ is also negative,
begin
d cdot(e-c) > 0
end
Thus, the sampling instant will be pushed forward until the middle sample $d$ reaches $mT_M-T_M/2$. Then, the left neighbouring sample $e$ will coincide with symbol $a[m-1]$ while the right neighbouring sample $c$ will coincide with $a[m]$. In this game of $3$ samples, the middle sample approaches the zero crossing . This is the philosophy of the zero crossing TEDs.
The converging locations of zero crossing TED as well as early-late TED for the above example are shown in the figure below. Notice that if we had chosen samples $b$, $c$ and $d$ in a zero crossing TED, the middle sample again would have converged towards zero.
From the above analysis, we can form a timing error detector as
This non-data-aided version is called the Gardner Timing Error Detector (TED) due to its inventor F. M. Gardner. Its data-aided and decision-directed versions are commonly known as Zero Crossing Timing Error Detector (TED) . By using the data symbols $a[m-1]$ and $a[m]$ in place of $z((m-1)T_M+hat epsilon_Delta)$ and $z(mT_M+hat epsilon_Delta)$, respectively, we get the data-aided variant.
beginlabel
e_D[m] = zleft(mT_M-frac<2>+hat epsilon_Deltaright)bigg
end
On the same note, a decision-directed form can be created as
beginlabel
e_D[m] = zleft(mT_M-frac<2>+hat epsilon_Deltaright)bigg<hat a[m-1] – hat a[m]bigg>
end
where the symbol decision $hat a[m]$ for a binary PAM case is
begin
hat a[m] = A times text Big< z(mT_M+hat epsilon_Delta)Big>
end
Like derivative and early-late TEDs, a zero crossing approach also depends on balancing the magnitudes of two samples taken midway from either side of the symbol. Consequently, its performance also suffers when the excess bandwidth $alpha$ is small. See this article for an intuitive explanation of how excess bandwidth impacts the performance of timing synchronization.
Gardner TED is based on the ideas from a wave difference method and a digital Data Transition Tracking Loop (DTTL) (used as a symbol synchronizer in the telemetry Rx of the Mariner Mars 1969 mission.
Receiver Structure
The Rx structure for a zero crossing or Gardner TED is quite similar to that for early-late TED and is drawn in the figure below for a decision-directed setting (click on the image to enlarge it).
The Rx signal $r(t)$ is sampled at a rate of $F_S=2/T_M$, or $T_S=T_M/2$, to generate $r(nT_S)$ at $L=2$ samples/symbol. Next, the sampled signal $r(nT_S)$ is matched filtered at the same rate with its output being $z(nT_S)$. Under the command of an interpolation control block, an interpolator resamples these matched filter outputs at instants $hat epsilon_Delta$ to produce $z(nT_S+hat epsilon_Delta)$. Since this system runs at a rate of 2 samples/symbol, the delay block $T_S$ (that represents a delay of 1 sample) supplies the samples at half a symbol duration, i.e., $z(mT_M-T_M/2+hat epsilon_Delta)$.
The interpolation control block also identifies the time instants $(m-1)T_M$ and $mT_M$ at which the outputs $hat a[m-1]$ and $hat a[m]$ are taken out of the decision block and the error signal $e_D[m]$ is formed once per symbol. In the case of Gardner TED, the matched filter outputs $z((m-1)T_M+hat epsilon_Delta)$ and $z(mT_M+hat epsilon_Delta)$ are directly used instead of $hat a[m-1]$ and $hat a[m]$ in forming the TED output. This signal $e_D[m]$ is then upsampled by $2$ to create $e_D(nT_S)$ that then matches the sample rate $F_S$ of the loop filter and the interpolation control.
Example
Now we simulate a Gardner TED for the same set of parameters as for a derivative TED here except $L$ which is $2$ in this case, i.e.,
begin
text quad rightarrow&quad 2-text, \ L quad =& quad 2
text, \ alpha quad =& quad 0.4, \
B_n T_Mquad =& quad 1/200, \ zeta quad =& quad 1/sqrt<2>, \ epsilon_Delta quad =& quad 0.25 T_M
end
Again, the PI loop filter coefficients are computed from Eq (4) of the PLL article where $K_0$ is unity while a simple routine is used to compute the derivative of the mean curve at $epsilon_Delta=0$ for $K_D$. The output error signal $e_D[m]$ for a Gardner TED is shown in the figure below where the estimate of the timing offset $epsilon_Delta=0.25T_M$ is seen converging to its true value. We call this estimate as a fractional interval $mu[m]$. The TLL is seen to converge in approximately $800$ symbols.
Finally, the zero crossing TED for a QAM scheme is given by the sum of inphase and quadrature parts. For example, from Eq (ref), the data-aided version can be written as
begin
begin
e_D[m] &= z_Ileft(mT_M-frac<2>+hat epsilon_Deltaright)bigg + \
&hspace<.3in>z_Qleft(mT_M-frac<2>+hat epsilon_Deltaright)bigg
end
end
Carrier Independent Operation
One of the reasons for popularity of Gardner TED was the belief that its operation is independent of the carrier phase as well as a small frequency offset. Many sources still cite the Gardner TED as having an extra feature of rotationally invariant (carrier independent operation) and hence very suitable for timing acquisition when a significant carrier phase offset and possibly a small carrier frequency offset is present in the Rx signal.
As it turns out, this carrier independent operation is not exclusive to the Gardner TED. In fact, this is a feature of the non-data-aided fashion in which the TED processes the Rx samples. For passband modulation schemes, the Gardner TED is given from complex samples by the inphase part of a conjugate product instead of a simple product.
begin
e_D[m] = bigg[zleft(mT_M-frac<2>+hat epsilon_Deltaright)bigg\bigg]_I
end
From the definition of a complex conjugate $V^*$, we know that
begin
begin
|V^*| &= |V| \
measuredangle V^* &= – measuredangle V
end
end
Consequently, the phase of the middle sample is canceled by the common phase of the two samples in the brackets above. However, the non-data-aided version of early-late TED exhibits exactly the same property for complex samples.
begin
e_D[m] = bigg[z(mT_M+hat epsilon_Delta) left<2>+hat epsilon_Deltaright) – z^*left(mT_M-frac<2>+hat epsilon_Deltaright)right>bigg]_I
end
In terms of complex signals, $expleft(jthetaright)$ is the phase rotation of the middle sample while $expleft(-jthetaright)$ can be taken as common from the terms in the brackets.
In conclusion, as long as there is a conjugate product being taken between the complex samples having the same phase rotation, the TED is essentially carrier independent and Gardner TED is not unique in this regard. Having said that, the presence of a rotating phase in the constellation can perturb the timing error detectors to some extent in terms of the jitter and acquisition time.
There are some final comments in regards to this discussion as follows.
- There has been a long standing confusion in synchronization community regarding the non-data-aided early-late and Gardner timing error detectors that has been clarified here.
- For an example of a timing recovery system that can be implemented after carrier recovery at 1 sample/symbol, see the Mueller and Muller algorithm.
- Feedforward techniques that do not require a PLL are also possible such as digital filter and square timing synchronization.
Источник
Timing synchronization plays the role of the heart of a digital communication system. We have already seen how a timing locked loop, commonly known as symbol timing PLL, works where I explained the intuition behind the maximum likelihood Timing Error Detector (TED). A simplified version of maximum likelihood TED, known as Early-Late Timing Error Detector, was also covered before. Today we discuss a different timing synchronization philosophy that is based on zero-crossing principle. It is commonly known as Gardner timing recovery.
Background
Before we start this topic, I recommend that you read about Pulse Amplitude Modulation (PAM) for an introduction to digital systems, the framework in which timing synchronization algorithms are described here. The notations for the main parameters are the following.
- Sample time (inverse of sample rate): $T_S$
- Symbol time (inverse of symbol rate): $T_M$
- Data symbols: $a[m]$
- Timing error: $epsilon _Delta$
- Timing error estimate: $hat epsilon _Delta$
The samples at the matched filter output in a Pulse Amplitude Modulated (PAM) system are denoted by
begin{equation*}
cdots, z((n-2)T_S), z((n-1)T_S), z(nT_S)), z((n+1)T_S), z((n+2)T_S), cdots
end{equation*}
where $T_S$ is the sampling time and the oversampling factor is 2. The question is: How do we know which sample corresponds to the symbol peak? At the startup time of the Rx, all we have is a series of samples spaced by half-symbol period $T_M/2$ where $T_M$ is the symbol time. Depending on the actual $epsilon_Delta$, we could have
begin{align*}
z((n-2)T_S) ~&rightarrow~ z((m-1)T_M+hat epsilon_Delta) quad text{Symbol Peak}\
z((n-1)T_S) ~&rightarrow~ z(mT_M-frac{T_M}{2}+hat epsilon_Delta) \
z(nT_S) ~&rightarrow~ z(mT_M+hat epsilon_Delta) quad text{Symbol Peak} \
z((n+1)T_S) ~&rightarrow~ z(mT_M+frac{T_M}{2}+hat epsilon_Delta) \
z((n+2)T_S) ~&rightarrow~ z((m+1)T_M+hat epsilon_Delta) quad text{Symbol Peak}
end{align*}
or we could have either $z((n-1)T_S)$ or $z((n+1)T_S)$ correspond to the symbol peak with other samples identified around accordingly. This is because frame synchronization can take us to the correct symbol level only, not the sample.
To answer this question, consider the figure below with samples denoted as $b$, $c$, $d$ and $e$.
Applying the early-late equation for three TED samples $b$, $c$ and $d$,
begin{equation*}
e_D[m] = ccdot (b-d) > 0
end{equation*}
However, if we had identified the three TED samples as $c$, $d$ and $e$, then
begin{equation}label{eqTimingSyncELTEDexample}
e_D[m] = dcdot (c-e)
end{equation}
Since $c-e$ $>$ $0$ and $d$ is negative,
begin{equation*}
d cdot(c-e) < 0
end{equation*}
Instead of $hat epsilon_Delta<epsilon_Delta$, the early-late TED then would treat this as a case of late sampling $hat epsilon_Delta>epsilon_Delta$ (and hence the negative output in the above expression). The TLL would have brought the sampling instant earlier until the middle sample $d$ reached the instant $(m-1)T_M$ and hence identified as $z((m-1)T_M)$. The left and right samples, namely $e$ and $c$, approach zero in the meanwhile, as illustrated by the figure above.
Towards Zero Crossings
An alternative strategy is a zero crossing timing error detector where the algorithm targets the zero crossings of the waveform. This is done by negating the slope. So let us find out what happens with negating the slope in an early-late expression, for which we again consider the same samples $c$, $d$ and $e$ considered above in Eq (ref{eqTimingSyncELTEDexample}) with respect to the last figure above.
begin{align*}
e_D[m] = dcdotbig{-(c-e)big} = dcdot (e-c)
end{align*}
Since $d$ is negative while $e-c$ is also negative,
begin{equation*}
d cdot(e-c) > 0
end{equation*}
Thus, the sampling instant will be pushed forward until the middle sample $d$ reaches $mT_M-T_M/2$. Then, the left neighbouring sample $e$ will coincide with symbol $a[m-1]$ while the right neighbouring sample $c$ will coincide with $a[m]$. In this game of $3$ samples, the middle sample approaches the zero crossing. This is the philosophy of the zero crossing TEDs.
The converging locations of zero crossing TED as well as early-late TED for the above example are shown in the figure below. Notice that if we had chosen samples $b$, $c$ and $d$ in a zero crossing TED, the middle sample again would have converged towards zero.
From the above analysis, we can form a timing error detector as
begin{equation}label{eqTimingSyncGardnerTED}
e_D[m] = zleft(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)bigg{zleft((m-1)T_M+hat epsilon_Deltaright) – z(mT_M+hat epsilon_Delta)bigg}
end{equation}
This non-data-aided version is called the Gardner Timing Error Detector (TED) due to its inventor F. M. Gardner. Its data-aided and decision-directed versions are commonly known as Zero Crossing Timing Error Detector (TED). By using the data symbols $a[m-1]$ and $a[m]$ in place of $z((m-1)T_M+hat epsilon_Delta)$ and $z(mT_M+hat epsilon_Delta)$, respectively, we get the data-aided variant.
begin{equation}label{eqTimingSyncZCTEDDA}
e_D[m] = zleft(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)bigg{a[m-1] – a[m]bigg}
end{equation}
On the same note, a decision-directed form can be created as
begin{equation}label{eqTimingSyncZCTEDDD}
e_D[m] = zleft(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)bigg{hat a[m-1] – hat a[m]bigg}
end{equation}
where the symbol decision $hat a[m]$ for a binary PAM case is
begin{equation*}
hat a[m] = A times text{sign} Big{ z(mT_M+hat epsilon_Delta)Big}
end{equation*}
Like derivative and early-late TEDs, a zero crossing approach also depends on balancing the magnitudes of two samples taken midway from either side of the symbol. Consequently, its performance also suffers when the excess bandwidth $alpha$ is small. See this article for an intuitive explanation of how excess bandwidth impacts the performance of timing synchronization.
Gardner TED is based on the ideas from a wave difference method and a digital Data Transition Tracking Loop (DTTL) (used as a symbol synchronizer in the telemetry Rx of the Mariner Mars 1969 mission.
Receiver Structure
The Rx structure for a zero crossing or Gardner TED is quite similar to that for early-late TED and is drawn in the figure below for a decision-directed setting (click on the image to enlarge it).
The Rx signal $r(t)$ is sampled at a rate of $F_S=2/T_M$, or $T_S=T_M/2$, to generate $r(nT_S)$ at $L=2$ samples/symbol. Next, the sampled signal $r(nT_S)$ is matched filtered at the same rate with its output being $z(nT_S)$. Under the command of an interpolation control block, an interpolator resamples these matched filter outputs at instants $hat epsilon_Delta$ to produce $z(nT_S+hat epsilon_Delta)$. Since this system runs at a rate of 2 samples/symbol, the delay block $T_S$ (that represents a delay of 1 sample) supplies the samples at half a symbol duration, i.e., $z(mT_M-T_M/2+hat epsilon_Delta)$.
The interpolation control block also identifies the time instants $(m-1)T_M$ and $mT_M$ at which the outputs $hat a[m-1]$ and $hat a[m]$ are taken out of the decision block and the error signal $e_D[m]$ is formed once per symbol. In the case of Gardner TED, the matched filter outputs $z((m-1)T_M+hat epsilon_Delta)$ and $z(mT_M+hat epsilon_Delta)$ are directly used instead of $hat a[m-1]$ and $hat a[m]$ in forming the TED output. This signal $e_D[m]$ is then upsampled by $2$ to create $e_D(nT_S)$ that then matches the sample rate $F_S$ of the loop filter and the interpolation control.
Example
Now we simulate a Gardner TED for the same set of parameters as for a derivative TED here except $L$ which is $2$ in this case, i.e.,
begin{align*}
text{Modulation} quad rightarrow&quad 2-text{PAM}, \ L quad =& quad 2 ~text{samples/symbol}, \ alpha quad =& quad 0.4, \
B_n T_Mquad =& quad 1/200, \ zeta quad =& quad 1/sqrt{2}, \ epsilon_Delta quad =& quad 0.25 T_M
end{align*}
Again, the PI loop filter coefficients are computed from Eq (4) of the PLL article where $K_0$ is unity while a simple routine is used to compute the derivative of the mean curve at $epsilon_Delta=0$ for $K_D$. The output error signal $e_D[m]$ for a Gardner TED is shown in the figure below where the estimate of the timing offset $epsilon_Delta=0.25T_M$ is seen converging to its true value. We call this estimate as a fractional interval $mu[m]$. The TLL is seen to converge in approximately $800$ symbols.
Finally, the zero crossing TED for a QAM scheme is given by the sum of inphase and quadrature parts. For example, from Eq (ref{eqTimingSyncZCTEDDA}), the data-aided version can be written as
begin{equation*}
begin{aligned}
e_D[m] &= z_Ileft(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)bigg{a_I[m-1] – a_I[m]bigg} + \
&hspace{.3in}z_Qleft(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)bigg{a_Q[m-1] – a_Q[m]bigg}
end{aligned}
end{equation*}
Carrier Independent Operation
One of the reasons for popularity of Gardner TED was the belief that its operation is independent of the carrier phase as well as a small frequency offset. Many sources still cite the Gardner TED as having an extra feature of rotationally invariant (carrier independent operation) and hence very suitable for timing acquisition when a significant carrier phase offset and possibly a small carrier frequency offset is present in the Rx signal.
As it turns out, this carrier independent operation is not exclusive to the Gardner TED. In fact, this is a feature of the non-data-aided fashion in which the TED processes the Rx samples. For passband modulation schemes, the Gardner TED is given from complex samples by the inphase part of a conjugate product instead of a simple product.
begin{equation*}
e_D[m] = bigg[zleft(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)bigg{z^*left((m-1)T_M+hat epsilon_Deltaright) – z^*left(mT_M+hat epsilon_Deltaright)bigg}bigg]_I
end{equation*}
From the definition of a complex conjugate $V^*$, we know that
begin{align*}
begin{aligned}
|V^*| &= |V| \
measuredangle V^* &= – measuredangle V
end{aligned}
end{align*}
Consequently, the phase of the middle sample is canceled by the common phase of the two samples in the brackets above. However, the non-data-aided version of early-late TED exhibits exactly the same property for complex samples.
begin{equation*}
e_D[m] = bigg[z(mT_M+hat epsilon_Delta) left{z^*left(mT_M+frac{T_M}{2}+hat epsilon_Deltaright) – z^*left(mT_M-frac{T_M}{2}+hat epsilon_Deltaright)right}bigg]_I
end{equation*}
In terms of complex signals, $expleft(jthetaright)$ is the phase rotation of the middle sample while $expleft(-jthetaright)$ can be taken as common from the terms in the brackets.
In conclusion, as long as there is a conjugate product being taken between the complex samples having the same phase rotation, the TED is essentially carrier independent and Gardner TED is not unique in this regard. Having said that, the presence of a rotating phase in the constellation can perturb the timing error detectors to some extent in terms of the jitter and acquisition time.
Final Remarks
There are some final comments in regards to this discussion as follows.
- There has been a long standing confusion in synchronization community regarding the non-data-aided early-late and Gardner timing error detectors that has been clarified here.
- For an example of a timing recovery system that can be implemented after carrier recovery at 1 sample/symbol, see the Mueller and Muller algorithm.
- Feedforward techniques that do not require a PLL are also possible such as digital filter and square timing synchronization.
This post aims to summarize the main concepts involved in a symbol timing synchronization scheme by exploring a MATLAB example. For the reader interested in going deeper into the topic, I recommend Michael Rice’s digital communications book [1], which is the book referenced by MATLAB’s symbol timing synchronization implementation. Finally, after understanding the concepts presented there, I recommend exploring the MATLAB simulation that I developed and published on Github:
https://github.com/igorauad/symbol_timing_sync
Contents
- 1 Background
- 1.1 Timing Error Detector
- 1.2 Loop Filter
- 1.3 Interpolator Controller and Interpolator
- 2 Pulse Shaping Filter Design Considerations
- 3 Transmitter
- 4 Channel
- 5 Receiver without Symbol Timing Synchronization
- 6 Receiver with Symbol Timing Synchronization
- 7 Derivative Matched Filter (dMF)
- 8 dMF design
- 9 Maximum likelihood Timing Error Detector (ML-TED)
- 10 Zero-crossing Timing Error Detector (ZC-TED)
- 11 Final Remarks
- 12 References
Background
What is symbol timing synchronization?
Since there are many flavors of synchronization, the precise definition of each synchronization can become confusing. For example, there is clock synchronization, frame synchronization, carrier synchronization, all of which are different concepts than symbol timing synchronization.
Symbol timing synchronization has a unique purpose: to find the optimal instants when downsampling a sequence of samples into a series of symbols. In other words, it focuses on selecting the “best” sample out of every group of samples, such that this selected sample can better represent the transmitted symbol. The chosen sample (deemed as the symbol) is then passed on to the symbol detector. This concept will become clear once we explore a couple of examples.
Components of a Symbol Timing Recovery Loop
At this point, it is instructive to revisit what a basic feedback control loop is. In essence, a control loop has three main elements: an error detector, a filter, and a “plant” (or “process”). Its goal is to control the response produced by a particular input signal. For example, when a power switch is turned on (say from 0 to 12V), a control loop can control the pace at which the output voltage transitions from 0 to 12V, for example, by guaranteeing that it settles at 12V steadily within a given time specification. The error detector compares the input and the output of the loop. The difference (the detected error) is filtered by a block known as the “controller.” This controller has several parameters capable of controlling the desired output response (for example, the just mentioned settling time). Finally, the filter output feeds the “plant,” which generates a signal following the input. The error decreases as the plant’s output approaches the input signal. Ultimately, after enough time, the system converges to its steady state.
Timing recovery loops are just that, but with their peculiar error detector, filter and plant. In the sequel, you can find a very brief overview of the timing recovery loop elements. Do not worry if their essence is not clear yet. It will soon be once we advance into the MATLAB examples.
Timing Error Detector
First, note the n-th receive symbol can be modeled by:
(y(nT_s) = sum limits_{m}x(m)p((n-m)T_s – tau) + v(nT_s), )
where (T_s) is the symbol period, (p) is the channel pulse response (combining both the pulse shaping filter and the receiver-side matched filter), (x(m)) is the m-th transmit symbol, (v(nT_s)) is the AWGN and, importantly, (tau) is the timing offset error within ([0, T_s)), that is, within a fraction of the symbol period.
The timing offset error (tau) results from the channel propagation delay, which can not be controlled and, therefore, introduces delays that are not simply integer multiples of the symbol period. In reality, the propagation delay is such that (tau) is composed of two terms: an integer and a fractional multiple of (T_s). In the context of symbol timing recovery, we are only concerned with the fractional error. The integer error is handled by a frame timing recovery (or frame synchronization) scheme.
Since the pulse (p(t)) is designed for zero intersymbol interference (ISI), it is only because of the timing error (tau) that the terms for (n neq m) in the summation of the above expression for (y(nT_s)) are non-zero. As a result, due to (tau), the received symbol (y(nT_s)) is corrupted by both AWGN and ISI.
The timing error detector has the purpose of estimating this timing error (tau), so that the receiver can adjust its timing and avoid the intersymbol interference.
Loop Filter
The loop filter controls how fast the timing error can be corrected, what types of errors can be treated (for example, linearly varying), and the range of correctable timing errors. In general, it is a second-order system and often the proportional-plus-integral controller (PI controller), commonly used in feedback systems. In this post, we choose not to give in-depth details about the loop filter. Instead, the reader may find a comprehensive discussion in [1] (see Appendix C).
Interpolator Controller and Interpolator
Finally, the interpolator and the interpolator controller in conjunction represent the plant (or process) in the context of symbol timing recovery. The interpolator controller chooses the samples of the matched-filter output sequence to be retained as the symbols. For an oversampling factor of (L), the MF outputs (L) samples for each symbol. In turn, the receiver has to pick only one out of each (L) and pass it to the symbol detector. Hence, it is as if the interpolator controller generated a train of spaced impulses, with impulses solely at the indexes corresponding to the desired symbols.
This tutorial does not discuss the interpolator and its controller. So, again, the reader is referred to [1].
In the end, a timing recovery loop generally looks similar to the following diagram:
With that, we are ready to advance to the tutorial. By looking into MATLAB code and corresponding plots, the main aspects of the timing recovery loop will become clear.
Pulse Shaping Filter Design Considerations
First, design a Square-root Raised Cosine filter for pulse shaping:
L = 4; rollOff = 0.5; rcDelay = 10; htx = rcosine(1, L, 'sqrt', rollOff, rcDelay/2); hrx = conj(fliplr(htx)); figure plot(htx) title('Transmit Filter') xlabel('Index') ylabel('Amplitude') figure plot(hrx) title('Rx Filter (Matched Filter)') xlabel('Index') ylabel('Amplitude') p = conv(htx,hrx); figure plot(p) title('Combined Tx-Rx = Raised Cosine') xlabel('Index') ylabel('Amplitude') zeroCrossings = NaN*ones(size(p)); zeroCrossings(1:L:end) = 0; zeroCrossings((rcDelay)*L + 1) = NaN; hold on plot(zeroCrossings, 'o') legend('RC Pulse', 'Zero Crossings') hold off
The zero-crossings highlighted in the RC pulse are very important in the context of symbol timing synchronization. Once the receiver samples the incoming waveform and performs matched-filtering, the samples retained as symbols must be aligned with these zero-crossings. If that is guaranteed, the intersymbol interference is eliminated. In other words, a given symbol is multiplied by the RC peak (unitary in this case), and its interference contribution to all other neighbor symbols is exactly the amplitude at the zero-crossings, namely null.
Transmitter
Next, observe the transmission of a 2-PAM symbol sequence. Let’s say we transmit a couple of consecutive PAM symbols over a period that at least is longer than the RC delay:
M = 2; data = zeros(1, 2*rcDelay); data(1:2:end) = 1; txSym = real(pammod(data, M)); figure stem(txSym) title('Symbol Sequence') xlabel('Symbol Index') ylabel('Amplitude')
Note we intentionally generated the sequence with alternating +1, -1, +1, -1, and so forth. First, this will help with visualization. Secondly, and more importantly, this property will be critical when we discuss a specific timing error detector scheme. Keep that in mind.
txUpSequence = upsample(txSym, L); figure stem(txUpSequence) title('Upsampled Sequence') xlabel('Sample Index') ylabel('Amplitude') txSequence = filter(htx, 1, txUpSequence); figure stem(txSequence) title('Shaped Transmit Sequence') xlabel('Index') ylabel('Amplitude')
Channel
Next, let’s add a random channel propagation delay in units of sampling intervals (not symbol intervals):
timeOffset = 1; rxDelayed = [zeros(1, timeOffset), txSequence(1:end-timeOffset)];
Furthermore, let’s completely ignore AWG noise. This simplification will make the symbol timing synchronization results more apparent and help the explanation.
Receiver without Symbol Timing Synchronization
Now, let’s consider a receiver that does not perform symbol timing synchronization. As the initial block diagram illustrates, assume the matched filter block precedes the symbol timing recovery loop. Hence, apply the matched filtering first, as follows:
mfOutput = filter(hrx, 1, rxDelayed); figure stem(mfOutput) title('Matched Filter Output (Correlative Receiver)') xlabel('Index') ylabel('Amplitude')
Next, let’s add an arbitrary timing used by the receiver to select samples from the incoming sequence and pass them to the decision module (namely for the downsampler).
rxSym = downsample(mfOutput, L); selectedSamples = upsample(rxSym, L); selectedSamples(selectedSamples == 0) = NaN; figure stem(mfOutput) hold on stem(selectedSamples, '--r', 'LineWidth', 2) title('Matched Filter Output (Correlative Receiver)') xlabel('Index') ylabel('Amplitude') legend('MF Output', 'Downsampled Sequence (Symbols)') hold off
In this case, the extracted samples (the received symbols) look as follows:
figure stem(rxSym) title('Symbol Sequence') xlabel('Symbol Index') ylabel('Amplitude')
Finally, after skipping the transitory due to the raised cosine pulse delay, the corresponding scatter plot becomes:
figure plot(complex(rxSym(rcDelay+1:end)), 'o') grid on xlim([-1.5 1.5]) title('Rx Scatterplot') xlabel('In-phase (I)') ylabel('Quadrature (Q)')
Note it is not looking good enough yet. The receiver is not extracting the samples aligned with the zero-crossings of the pulse shaping function. Consequently, the retained symbols are disturbed by intersymbol interference.
Receiver with Symbol Timing Synchronization
Now let’s suppose the receiver knows the symbol timing offset exactly, in terms of sampling periods or, equivalently, fractional symbol intervals. Let’s add the timeOffset variable to the offset argument of the downsample function:
rxSym = downsample(mfOutput, L, timeOffset);
In this case, we can see that the “selected” samples are:
selectedSamples = upsample(rxSym, L); selectedSamples(selectedSamples == 0) = NaN; figure stem(mfOutput) hold on stem(selectedSamples, '--r', 'LineWidth', 2) title('Matched Filter Output (Correlative Receiver)') xlabel('Index') ylabel('Amplitude') legend('MF Output', 'Downsampled Sequence (Symbols)') hold off
Hence, the symbols passed to the PAM decision module are:
figure stem(rxSym) title('Symbol Sequence') xlabel('Symbol Index') ylabel('Amplitude')
And, again, skipping the raised cosine pulse delay, the symbol scatter plot becomes:
figure plot(complex(rxSym(rcDelay+1:end)), 'o') grid on xlim([-1.5 1.5]) title('Rx Scatterplot') xlabel('In-phase (I)') ylabel('Quadrature (Q)')
Perfect, isn’t it? So, in conclusion, all the receiver needs is to find somehow the exact instants of the zero-crossings within the time-shifted pulse shaping functions representing each transmitted symbol. This task is supported by the timing error detector (TED) of the symbol timing recovery loop. In particular, the TED aims to indicate how well the current symbol timing alignment is relative to the zero crossings. We discuss two possible TED approaches next.
Derivative Matched Filter (dMF)
One of the possible TED schemes is the so-called maximum likelihood TED (ML-TED). It employs a derivative matched filter (dMF), which, as the name implies, is a filter whose output corresponds to the derivative of the matched filter. The idea is that the MF derivative approaches zero whenever the MF response reaches a peak, i.e., when its slope transitions from positive to negative. Let’s see how this looks like in practice.
First, let’s design the dMF. Before doing so, note there are several ways of approximating a derivative in discrete time. The main distinction lies in the resulting frequency response of the filter and, more specifically, how the filter deals with noise. An approach that avoids enhancing high-frequency noise is the central differences differentiator (refer to this informative post). Therefore, we choose this approach in what follows:
dMF design
h = [0.5 0 -0.5]; central_diff_mf = conv(h, hrx); dmf = central_diff_mf(2:1+length(hrx)); figure plot(hrx) hold on, grid on plot(dmf, 'r') legend('MF', 'dMF') title('MF vs. dMF') xlabel('Index') ylabel('Amplitude') hold off
So, as expected, we can see that the very center of the MF (the peak) is aligned with a zero amplitude at the dMF. Hence, the dMF can provide a good indication as to whether the receiver is correctly observing the MF peak. That is, the dMF output should be roughly zero at this point.
Nevertheless, it is worth clarifying that the dMF is designed to indicate the peaks associated with each time-shifted RC pulse (due to each transmitted symbol), not the peak values observed in the combined MF output. Recall from the model of (y(nTs)) presented in the beginning that the n-th received symbol is a sum of time-shifted pulses (i.e., time-shifted RC pulses). Furthermore, recall that the RC pulse is designed for zero intersymbol interference at the suitable locations (the symbol instants) but does not guarantee zero interference elsewhere. Hence, when you look at the sum of pulses forming (y(nTs)), the correct symbol instants are not on the peak values. In contrast, when looking at the individual RC pulses generated by each transmitted symbol, the right symbol location coincides with the peak of the individual pulses. You can observe this better by playing with the following snippet on your own:
N = 5; rndData = randi(M, 1, N) - 1; rndTxSym = real(pammod(rndData, M)); rcLen = 2*rcDelay*L + 1; mfOutLen = rcLen + N*L - 1; mfOutMtx = zeros(N, mfOutLen); dmfOutMtx = zeros(N, mfOutLen); selectedSamples = NaN * ones(1, mfOutLen); for i = 1:N txSymInd = zeros(1, N); txSymInd(i) = rndTxSym(i); txSeq = conv(htx, upsample(txSymInd, L)); mfOutMtx(i, :) = conv(hrx, txSeq); dmfOutMtx(i, :) = conv(dmf, txSeq); selectedSamples((L*rcDelay) + 1 + (i-1)*L) = rndTxSym(i); end figure plot(mfOutMtx.') hold on stem(selectedSamples, '--r') hold off title('Time-shifted RC pulses due to each Tx symbol') xlabel('Sample Index') figure plot(dmfOutMtx.') hold on stem(selectedSamples, '--r') hold off title('dMF response due to each Tx symbol') xlabel('Sample Index') figure plot(sum(mfOutMtx, 1)) hold on stem(selectedSamples, '--r') hold off title('Full MF Output') xlabel('Sample Index')
Maximum likelihood Timing Error Detector (ML-TED)
In the ML-TED scheme, the MF and dMF operate concurrently, filtering the same input sequence. Hence, continuing with the example, the dMF output looks as follows:
dmfOutput = filter(dmf, 1, rxDelayed); figure stem(dmfOutput) title('Derivative Matched Filter Output') xlabel('Index') ylabel('Amplitude')
Furthermore, the ML-TED extracts a timing error precisely at the same instant when a sample from the MF output is retained as a symbol. The result is shown next. In particular, we can contrast the two scenarios discussed earlier, i.e., when the receiver is unaware of the symbol timing offset and the opposite case when it does know the correct timing offset.
dmfDownsampled_nosync = downsample(dmfOutput, L); dmfDownsampled_withsync = downsample(dmfOutput, L, timeOffset); figure stem(dmfDownsampled_nosync) hold on stem(dmfDownsampled_withsync, '--r', 'LineWidth', 2) xlabel('Symbol Index') ylabel('Amplitude') legend('No Symbol Timing Sync', 'With Sync') title('Downsampled dMF output') hold off
Note that the timing error metric output by the dMF has significant amplitude for the unsynchronized receiver but is practically null for the receiver that already knows the symbol timing offset. Hence, we can conclude that this dMF can be very useful. It will indicate the alignment (or misalignment) relative to the pulse shaping function’s peak and zero-crossings.
Nonetheless, note this particular ML-TED scheme has only worked above because we forced the transmit symbols to be continuously alternating between +1 and -1. When that is not true, as is the case for most practical random symbol streams, the ML-TED output can be very noisy. This noise has a specific name in the symbol timing recovery parlance. It is called self-noise [1]. Other TED schemes, such as the zero-crossing TED (ZC-TED), do not suffer from this noise.
Before advancing into the ZC-TED, there is one final remark. The ML-TED timing error samples above are not complete. It does not suffice to extract the raw downsampled values of the dMF. A sign correction must be applied to these values. A comprehensive explanation is provided for Fig. 8.2.2 in [1], but let’s summarize the idea here.
The unsynchronized receiver can be interpreted as a receiver guessing a timing offset (hat{tau} = 0) in units of sample intervals. However, the actual timing offset is (tau = 1), so the timing error is (tau_e = tau – hat{tau} = 1). The solution is to increase the guess (hat{tau}) until obtaining a zero error ((tau_e = 0)).
When the MF output is transitioning from a -1 symbol to a +1 symbol, the slope of the output is positive. In this case, if we extract a sample from the dMF output using (hat{tau} = 0), we get a positive value, which tells the receiver’s timing recovery loop that the current guess (hat{tau}) must be increased (because the error is positive). Such a positive error indication would be appropriate in the above example, where we need to increase the initial guess (hat{tau} = 0) to get closer to the true offset (tau = 1). In contrast, when the MF output is transitioning from a +1 to -1, the slope of the MF output is negative, so the extracted dMF sample is negative. This negative value indicates the current guess (hat{tau}) must be decreased. That would drive the loop away from the true timing offset, which would be undesirable. Hence, we need some solution to obtain a correct error indication regardless of the underlying symbol transition.
Fortunately, there is a simple trick. If we multiply the dMF output by the detected symbol, note it would be multiplied by +1 in the positive transition (from -1 to +1, because -1 is the previous symbol and +1 is the current symbol) and multiplied by -1 in the negative transition (from +1 to -1). Thus, when the dMF has a negative slope (transition from +1 to -1), the dMF sample is multiplied by a negative value (symbol -1), compensating the slope sign.
Of course, because (tau) is between 0 and L-1, the guess (hat{tau}) must be modulo-L. So, for example, if it is currently (hat{tau} = 0), and (L = 4), a unitary decrease would lead to (hat{tau} = 3).
Once sign correction (using the detected symbols) is applied, the following result is obtained:
rxdata_nosync = pamdemod(downsample(mfOutput, L), M); rxdata_withsync = pamdemod(downsample(mfOutput, L, timeOffset), M); decSym_nosync = real(pammod(rxdata_nosync, M)); decSym_withsync = real(pammod(rxdata_withsync, M)); e_nosync = decSym_nosync .* dmfDownsampled_nosync; e_withsync = decSym_withsync .* dmfDownsampled_withsync; figure stem(e_nosync) hold on stem(e_withsync, '--r', 'LineWidth', 2) xlabel('Symbol Index') ylabel('Amplitude') legend('No Symbol Timing Sync', 'With Sync') title('ML-TED Output - Timing Errors') hold off
Observe that the TED output for the unsynchronized system is all positive after the RC pulse delay (of 10 symbols), which is the expected result given that the current guess (hat{tau} = 0) must be increased to approach the actual (tau = 1).
Zero-crossing Timing Error Detector (ZC-TED)
Next, let’s investigate the ZC-TED, which, as stated earlier, has the advantage of avoiding self noise.
The principle exploited by the ZC-TED is that when the MF output transitions from +1 to -1 or vice versa, it crosses the zero amplitude. In particular, because there are L-1 samples between every two consecutive symbols, the zero-crossing is expected to lie near (if not precisely in) the middle index between these L-1 samples. Therefore, the receiver can constantly observe the sample at the midpoint between a transition and use this value as the timing error. Once the midpoint sample aligns with the zero-crossing, the error becomes zero, and the symbol timing recovery loop can converge (lock). If the midpoint sample is not zero, the current guess (hat{tau}) of the symbol timing offset must be adjusted.
Note that, with this mechanism, the ZC-TED scheme does not require a dMF filter at all. Instead, it operates solely by using the samples of the regular MF output. Hence, the ZC-TED can be implemented more efficiently than the ML-TED, avoiding the computational cost associated with the dMF filtering.
To understand the adjustment applied to the current guess (hat{tau}), we consider the two possible scenarios, a positive transition (from -1 to +1) and a negative transition (from +1 to -1). The plot below zooms into a negative transition observed on the unsynchronized system, namely the system whose current timing offset guess is (hat{tau} = 0).
figure stem(mfOutput(41:41+L)) hold on plot(mfOutput(41:41+L)) hold off xlabel('Index') ylabel('Amplitude')
Note the midpoint sample (at index 3) is positive. Meanwhile, a positive transition (from -1 to +1) looks as follows:
figure stem(mfOutput(45:45+L)) hold on plot(mfOutput(45:45+L)) hold off xlabel('Index') ylabel('Amplitude')
That is, the midpoint sample is negative. Hence, just like the ML-TED, the ZC-TED also needs a sign correction step. In both cases plotted above, the correct timing error indication should be a positive value, given that the current timing offset guess (hat{tau} = 0) must be increased to approach the actual (tau = 1). However, the value observed on a positive transition was negative.
The proper way of sign-correcting the midpoint samples observed by the ZC-TED is by multiplication with the difference (hat{a}(k-1) – hat{a}(k)) between the previous and the current symbols. This difference can be based on the actual symbols when known at the receiver side (data-aided approach) or on decisions (decision-directed method).
Next, we can observe the sign-corrected ZC-TED output for the unsynchronized and perfectly synchronized systems:
midSamples_nosync = mfOutput((L/2 + 1):L:end); midSamples_withsync = mfOutput((L/2 + 1 + timeOffset):L:end); signcorrection_nosync = [-diff(decSym_nosync), 0]; signcorrection_withsync = [-diff(decSym_withsync), 0]; zcted_nosync = midSamples_nosync .* signcorrection_nosync; zcted_withsync = midSamples_withsync .* signcorrection_withsync; figure stem(zcted_nosync) hold on stem(zcted_withsync, '--r', 'LineWidth', 2) hold off xlabel('Symbol Index') ylabel('Amplitude') legend('No Symbol Timing Sync', 'With Sync') title('ZC-TED Output - Timing Errors')
Note the ZC-TED yields reasonable timing error indication. Namely, it outputs positive timing error values for the unsynchronized receiver (again, after the RC pulse delay) and zero values for the perfectly synchronized receiver.
Finally, observe the reason why the ZC-TED scheme does not suffer from self noise. It is because the sign-correction term (hat{a}(k-1) – hat{a}(k)) is (0) when two consecutive symbols are equal, i.e., +1 and +1, or -1 and -1. As a result, the scheme does not request any timing correction when there is no zero-crossing between two symbols. In contrast, with the ML-TED, even though it requires a data transition to yield a reasonable timing error estimate, it does not eliminate the timing error estimate when the consecutive symbols are equal, leading to self noise.
This tutorial provided an introduction to the concept of symbol timing synchronization. If you are interested in digging deeper into the topic, I suggest experimenting with the simulator and scripts available on the Symbol Timing Sync Github repository. The simulator implements a complete timing recovery loop, including a PI controller, an interpolator (with multiple options), and an interpolation control scheme based on the modulo-1 counter explained in [1]. Furthermore, the simulator includes useful debugging features, such as a time scope to show relevant loop metrics in “in real-time” (evolving over the simulation). Feel free to experiment with it and even contribute to the repository.
References
[1] Rice, Michael. Digital Communications: A Discrete-Time Approach. Upper Saddle River, NJ: Prentice Hall, 2009.
The Gardner Timing Error Detector (TED) when at zero error positions the samples as follows related to the equation for the timing error:
Specific to the use of the Gardner TED for higher order QAM I offer the following from my own experience in using it successfully for this purpose:
First we note that the Gardner TED can be viewed as a form of the Maximum Likelihood Timing Detector which for complex signals takes the general expression as:
$$epsilon = text{Real}{dot y cdot y^* }$$
Where $epsilon$ is an error term that for small timing offsets is approximately proportional to the timing error, $y$ is the sample at the ideal time location with zero time error, $dot y$ is the derivative of $y$ and $y^*$ is the complex conjugate of $y$.
Note intuitively what is happening here in vicinity of the desired lock-point (tracking condition): Consider $dot y$ as a sign and a scaling of the transition between symbols as given by $y^*$. The TED is using the transition from one symbol to the next and changing it’s sign and scaling it accordingly to create the «S-curve» for error discrimination on average. If the real (or imaginary) transition is going from a lower value to a higher value, the TED will pass that through directly (but reduce it’s level for shorter transitions, which is consistent with optimum ratio combining, allowing the larger transitions which have a higher SNR with regards to time error detection to provide a bigger contribution toward the result), while if the transition is going from a higher value to a lower value, the TED with invert the sign and then pass that through as the error curve. The variation we see on any given transition is the «pattern noise» inherent in the Gardner TED, which in practical application will be filtered out below concern by the timing error tracking loop (but which is why I suggest to use the Gardner TED before final RRC matched filtering in the receiver as detailed here).
For the Gardner TED specifically, the derivative $dot y$ is approximated using $y_{n+1}-y_{n-1}$ and we get:
$$TED = text{Real}{(y_{n+1}-y_{n-1}) cdot y_n^* }$$
Which in using $y=I+jQ$ reduces nicely to:
$$TED = I_n(I_{n+1}-I_{n-1})+Q_n(Q_{n+1}-Q_{n-1})$$
Where $y_{n}$ refers to what would be the sample between symbols when error is 0, and $y_{n+1}$ and $y_{n-1}$ the samples adjacent on each side, with the sampling rate as two samples per symbol as commonly done with the Gardner TED.
Below is a demonstration confirming that this complex form of the Gardner TED works well for higher order modulations, in this case 16-QAM specifically.
The eye diagram of the waveform, in this case with a timing offset (actual samples at 4 samples/symbol are shown as bloe dots) is shown in the plot below (showing the real portion while the imaginary portion would look similar).
My Python code for the Gardner TED is given below;
def ted(tx, n, offset):
'''
tx: oversampled complex waveform
n: oversampling rate
offset: sample offset delay
'''
# downsample to 2 samples per symbol with timing offset
tx2 = tx[offset::int(n/2)]
# generate a prompt, late and early each offset by 1 sample
late = tx2[2:]
early = tx2[:-2]
prompt = tx2[1:-1]
# compute and return the Garnder Error result
return np.real(np.conj(prompt[::2])*(late-early)[::2])
In order to confirm the average has the S-curve associated with the Gardner TED, I rotated through all possible offsets and computed the average for each offset to generate the error curve as given below:
(As a side note, I have completed the same test showing how the M&M timing error detector can also be used for QAM).
This works as long as the data is generally equiprobable (as is typically the case especially when data scrambling is utilized) so on average the expected result is achieved. Thus even though not every symbol transitions through zero, for every non-zero transition there is an identical non-zero transition of opposite sign given the equiprobably distribution, resulting in a zero average when no timing offset exists.
I explain in more detail how the Gardner TED works where the timing loop used would be concerned with the average and not the error update after any given symbol transition, and how this would apply to BPSK, QPSK, and QAM waveforms at these additional posts:
Gardner Timing Recovery for Repeated Symbols
Isn’t Gardner’s algorithm and Early-Late gate the same thing?