Introduction
This receiver exercise introduces the primary components of a
QPSK receiver with specific focus on symbol-timing recovery.
In a receiver, the received signal is first coherently
demodulated and low-pass filtered (see
Digital Receivers: Carrier Recovery for
QPSK) to recover the message signals (in-phase and
quadrature channels). The next step for the receiver is to
sample the message signals at the symbol rate and decide which
symbols were sent. Although the symbol rate is typically
known to the receiver, the receiver does not know when to
sample the signal for the best noise performance. The
objective of the symbol-timing recovery loop is to find the
best time to sample the received signal.
Figure 1 illustrates the digital receiver system.
The transmitted signal coherently demodulated with both a sine
and cosine, then low-pass filtered to remove the
double-frequency terms, yielding the recovered in-phase and
quadrature signals,
s
I
^
n
s
I
^
n
and
s
Q
^
n
s
Q
^
n
. These operations are explained in
Digital Receivers: Carrier Recovery for
QPSK. The remaining operations are explained in this
module. Both branches are fed through a
matched
filter and re-sampled at the symbol rate. The matched
filter is simply an FIR filter with an impulse response
matched to the transmitted pulse. It aids in timing recovery
and helps suppress the effects of noise.
If we consider the square wave shown in
Figure 2
as a potential recovered in-phase (or quadrature) signal
(
i.e., we sent the data
+1-1+1-1…
+1
-1
+1
-1
…
) then sampling at any point other than the symbol
transitions will result in the correct data.
However, in the presence of noise, the received waveform may
look like that shown in
Figure 3.
In this case, sampling at any point other than the symbol
transitions does not guarantee a correct data decision. By
averaging over the symbol duration we can obtain a better
estimate of the true data bit being sent
(
+1
+1 or
-1
-1). The best averaging filter is the matched filter,
which has the impulse response
un-un-
T
symb
u
n
u
n
T
symb
,
where
un
u
n
is the unit step function,
for the simple rectangular pulse shape used in
Digital
Transmitter: Introduction to Quadrature Phase-Shift
Keying.
Figure 4 and
Figure 5 show the result of
passing both the clean and noisy signal through the matched
filter.
Note that in both cases the output of the matched filter has
peaks where the matched filter exactly lines up with the
symbol, and a positive peak indicates a
+1
+1 was sent; likewise, a negative peak indicates a
-1
-1 was sent. Although there is still some noise in
second figure, the peaks are relatively easy to distinguish
and yield considerably more accurate estimation of the data
(
+1
+1 or
-1
-1) than we could get by sampling the original noisy
signal in
Figure 3.
The remainder of this handout describes a symbol-timing
recovery loop for a BPSK signal (equivalent to a QPSK signal
where only the in-phase signal is used). As with the above
examples, a symbol period of
T
s
=16
T
s
16
samples is assumed.
Early/late sampling
One simple method for recovering symbol timing is performed
using a
delay-locked loop (
DLL).
Figure 6 is a block diagram of the necessary
components.
Consider the sawtooth waveform shown in
Figure 4, the output of the matched filter with a
square wave as input. The goal of the DLL is to sample this
waveform at the peaks in order to obtain the best
performance in the presence of noise. If it is not sampling
at the peaks, we say it is sampling too early or too late.
The DLL will find peaks without assistance from the user.
When it begins running, it arbitrarily selects a sample,
called the
on-time sample, from the matched
filter output. The sample from the time-index one greater
than that of the on-time sample is the
late
sample, and the sample from the time-index one less
than that of the on-time sample is the
early
sample.
Figure 7 shows an example of
the on-time, late, and early samples. Note in this case
that the on-time sample happens to be at a peak in the
waveform.
Figure 8 and
Figure 9
show examples in which the on-time sample comes before a
peak and after the peak.
The on-time sample is the output of the DLL and will be used
to decide the data bit sent. To achieve the best
performance in the presence of noise, the DLL must adjust
the timing of on-time samples to coincide with peaks in the
waveform. It does this by changing the number of
time-indices between on-time samples. There are three
cases:
-
In Figure 7, the on-time sample is already
at the peak, and the receiver knows that peaks are
spaced by
T
symb
T
symb
samples. If it then takes the next on-time
sample
T
symb
T
symb
samples after this on-time sample, it will be
at another peak.
-
In Figure 8, the on-time sample is too
early. Taking an on-time sample
T
symb
T
symb
samples later will be too early for the next
peak. To move closer to the next peak, the next on-time
sample is taken
T
symb
+1
T
symb
1
samples after the current on-time sample.
-
In Figure 9, the on-time sample is too
late. Taking an on-time sample
T
symb
T
symb
samples later will be too late for the next
peak. To move closer to the next peak, the next on-time
sample is taken
T
symb
-1
T
symb
1
samples after the current on-time sample.
The offset decision block uses the on-time, early, and late
samples to determine whether sampling is at a peak, too
early, or too late. It then sets the time at which the next
on-time sample is taken.
The input to the offset decision block is
on-timelate-early
on-time
late
early
, called the
decision statistic.
Convince yourself that when the decision statistic is
positive, the on-time sample is too early, when it is zero,
the on-time sample is at a peak, and when it is negative,
the on-time sample is too late. It may help to refer to
Figure 7,
Figure 8, and
Figure 9. Can you see why it is necessary to
multiply by the on-time sample?
The offset decision block could adjust the time at which the
next on-time sample is taken based only on the decision
statistic. However, in the presence of noise, the decision
statistic becomes a less reliable indicator. For that
reason, the DLL adds many successive decision
statistics and corrects timing only if the sum
exceeds a threshold; otherwise, the next on-time sample is
taken
T
symb
T
symb
samples after the current on-time sample. The
assumption is that errors in the decision statistic caused
by noise, some positive and some negative, will tend to
cancel each other out in the sum, and the sum will not
exceed the threshold because of noise alone. On the other
hand, if the on-time sample is consistently too early or too
late, the magnitude of the added decision statistics will
continue to grow and exceed the threshold. When that
happens, the offset decision block will correct the timing
and reset the sum to zero.
Sampling counter
The symbol sampler maintains a counter that decrements every
time a new sample arrives at the output of the matched
filter. When the counter reaches three, the matched-filter
output is saved as the late sample, when the counter reaches
two, the matched-filter output is saved as the on-time
sample, and when the counter reaches one, the matched-filter
output is saved as the early sample. After saving the early
sample, the counter is reset to either
T
symb
-1
T
symb
1
,
T
symb
T
symb
, or
T
symb
+1
T
symb
1
, according to the offset decision block.
MATLAB Simulation
Because the DLL requires a feedback loop, you will
have to simulate it on a sample-by-sample basis in
MATLAB.
Using a square wave of period
32
32 samples as input, simulate the DLL system shown in
Figure 6. Your input should be
several hundred periods long. What does it model? Set the
decision-statistic sum-threshold to
1.0
1.0; later, you can experiment with different values.
How do you expect different thresholds to affect the DLL?
Figure 10 and
Figure 11 show the
matched filter output and the on-time sampling times
(indicated by the impulses) for the beginning of the input,
before the DLL has locked on, as well as after 1000 samples
(about 63 symbols' worth), when symbol-timing lock has been
achieved. For each case, note the distance between the
on-time sampling times and the peaks of the matched filter
output.
DSP Implementation
Once your MATLAB simulation works, DSP implementation is
relatively straightforward. To test your implementation, you
can use the function generator to simulate a BPSK waveform by
setting it to a square wave of the correct frequency for your
symbol period. You should send the on-time sample and the
matched-filter output to the D/A to verify that your system is
working.