0% found this document useful (0 votes)
3 views

Lab_Notes_7

The document outlines a laboratory focused on analog communications using DSP techniques on the C6713 DSK, covering various modulation methods such as quadrature modulation, AM, QAM, SSB, and FM. It details the processes of modulation and demodulation, including the construction of real passband signals from complex baseband signals and the implementation of quadrature modulators and demodulators. Practical considerations, design tips, and assignments are also included to aid in the understanding and application of these concepts.

Uploaded by

azer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lab_Notes_7

The document outlines a laboratory focused on analog communications using DSP techniques on the C6713 DSK, covering various modulation methods such as quadrature modulation, AM, QAM, SSB, and FM. It details the processes of modulation and demodulation, including the construction of real passband signals from complex baseband signals and the implementation of quadrature modulators and demodulators. Practical considerations, design tips, and assignments are also included to aid in the understanding and application of these concepts.

Uploaded by

azer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

REAL-TIME DSP LABORATORY 7:

Analog Communications using DSP


Techniques on the C6713 DSK

Contents
1 Introduction 1
2 Quadrature Modulation 1
2.1 Complex Baseband Representations For Real Passband Signals . . . . . . . . . . . 2
2.2 Recovering the Complex Baseband Signal from the Real Passband Signal . . . . . . 3
2.3 The Quadrature Modulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 The Quadrature Demodulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Linear Modulation Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3 Amplitude Modulation (AM) 8
3.1 Square Law Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Other AM Demodulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Quadrature Amplitude Modulation (QAM) 9
5 Single-Sideband (SSB) Modulation 11
6 Double-Sideband Suppressed Carrier (DSB-SC) Modulation 12
6.1 Phase Discriminator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 Voltage Controlled Oscillator (VCO) . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.3 Comments on the Second-Order Costas Loop . . . . . . . . . . . . . . . . . . . . 15
7 Frequency Modulation (FM) 16
7.1 FM Demodulation Using A Phase-Locked Loop . . . . . . . . . . . . . . . . . . . 16
8 Practical Considerations for this Lab 18
8.1 Hardware Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.2 Implementation Using Two Boards . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.3 Implementation Using Both Codec Channels Simultaneously . . . . . . . . . . . . 19
9 Design and Implementation Tips 19
10 Assignments* 20
10.1 Extra Credit Assignments* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
11 End Notes 21
11.1 Lab Suggestions for Course Project . . . . . . . . . . . . . . . . . . . . . . . . . 22

1 Introduction

In traditional analog communication systems, a message modulates a sinusoid (oscillating at the


carrier frequency) that is transmitted (radiated from an antenna) across a channel. Modulation
reduces the size of the antenna and allows multiple users to use the same channel. In this lab,
we will be concerned with signals that are bandlimited to the audio range (less than 20kHz),
which means that we will use low frequency sinusoids, voice, and music as our message sources.
In this lab, you will study
• quadrature modulation,
• coherent and non-coherent demodulation, and
• AM, DSB-SC, QAM, SSB, and FM implementations using DSP techniques.

1
2 Quadrature Modulation

The basic idea in an analog communication system is to transform a message m(t) into another
signal s(t) that can be transmitted across a channel [1],[2]. This transformation, or modulation,
must be done in such a way that m(t) may be recovered via demodulation from s(t). The
transmitted signal s(t) may be called a modulated waveform, since it is generated by using the
message signal m(t) to modulate a sinusoidal carrier waveform. The demodulator recovers the
message from the modulated waveform.
We will call our message signal m(t) a baseband signal, since it will be bandlimited around DC
(ω = 0), and we will call our transmit signal s(t) a passband signal, since it will be bandlimited
around the carrier frequency (ω = ωc ). In practice, the carrier frequency will be in the radio
frequency (or RF) range (30kHz to 3GHz), so s(t) may also be referred to as an RF signal.
However, the codecs available for the DSK do not have the sampling rate required to process
RF signals, so we will use frequencies in the audio range1 . We will agree to overlook this fact
and still refer to the transmit signal as an RF signal for the role that it would play in the
communication system for which it was intended.
Sinusoidal carriers will be used to transmit a modulated waveform over a channel. At a given
frequency, there are really two orthogonal sinusoids (90o out of phase) that may be used as
information bearing waveforms. To see this, consider a sinusoidal with frequency ω. Integrating
this sinusoid with a 90o phase shifted version of the same sinusoid over one period will yield
Z Z

cos(ωt) cos(ωt − π2 )dt = cos(ωt) sin(ωt)dt = 0, ω= , (1)
T
<T > <T >

which means that cos(ωt) and sin(ωt) are orthogonal signals. Using this fact, we realize that
we may transmit two channels worth of information (independently) over the same bandwidth.
We will develop this idea next when we construct a real (one channel) passband signal from a
complex (two channel) baseband signal.

2.1 Complex Baseband Representations For Real Passband Signals

The idea behind quadrature modulation is that a real baseband message signal m(t) may be
used to form a complex baseband signal z(t) that complex modulates the time-varying phasor
ejωc t , rotating at the carrier frequency. The real part of this complex modulated signal (real
passband signal), namely s(t), is then transmitted across a channel. Let’s consider the arbitrary
complex baseband signal

z(t) = A(t)ejφ(t) = x(t) + jy(t). (2)


1
There exist high-end DSP-based systems that sample well into the RF range (fs = 2.208MHz). By using an
oscillator and a mixer (a non-linear circuit that multiplies two signals together), an RF signal that is bandlimited
around a carrier may be shifted to a frequency that is more suitable for DSP (< 1.1MHz). This process of
frequency shifting is known as heterodyning.

2
Here, the polar representation is a generalized phasor representation, wherein magnitude and
phase are time-varying. We say z(t) is baseband because its spectrum z(t) ←→ Z(jω) is ban-
dlimited around DC (ω = 0). This is shown in Figure 1. This spectrum is not generally
Hermitian symmetric because z(t) is complex.

Z(jZ)

Figure 1: The complex baseband spectrum Z(jω). Taken from [3].

From this complex baseband signal z(t) we want to build a real passband signal that may be
radiated from a mobile phone or transmitted through a coaxial cable. Consider the complex
modulated signal

w(t) = z(t)ejωc t ; ωc : carrier frequency (3)


jφt jωc t
= A(t)e e
= [x(t) + jy(t)][cos(ωc t) + j sin(ωc t)].

The complex spectrum of w(t) is w(t) ←→ W (jω) = Z(j(ω − ωc)). The spectrum W (jω) is now
bandlimited around the carrier frequency ωc as shown in Figure 2. This signal is often referred
to as a complex analytic signal, which means that it contains no “negative frequencies”.

W( jZ)

Z
Zc
0

Figure 2: The complex bandpass spectrum W (jω). Taken from [3].

Note that the spectrum in Figure 2 is still not Hermitian symmetric, since the signal w(t) is
complex. In order to build a real signal that can be radiated or transmitted, let’s construct the
real signal

3
w(t) w(t)
s(t) = Re{w(t)} = + (4)
2 n2 o
 jωc t
= Re z(t)e = Re A(t)ejφt ejωc t = A(t) cos(ωc t + φ(t)) (5)
= Re {[x(t) + jy(t)][cos(ωc t) + j sin(ωc t)]} = x(t) cos(ωc t) − y(t) sin(ωc t). (6)

Each of these representations for the real signal s(t) brings its own insights. For example, eqn (5)
shows the bandpass signal to be an amplitude and phase modulation of a cosinusoidal carrier,
and eqn (6) shows it to be a quadrature modulation of sinusoidal and cosinusoidal carriers.
Equation (4) shows the spectrum of the bandpass signal to be

w(t) w(t) 1 1
s(t) = + ←→ S(jω) = Z(j(ω − ωc )) + Z(j(−ω − ωc )). (7)
2 2 2 2

This is illustrated in Figure 3.

S ( jZ)

1
2
Z j ( Z  Z c ) 1
2 Z j (Z  Z c )

-Zc Zc
0

Figure 3: The complex spectrum of the real bandpass signal S(jω). Note the Hermitian sym-
metry. Taken from [3].

2.2 Recovering the Complex Baseband Signal from the Real Passband Signal

Once we have transmitted data across a channel, we will want to demodulate the received signal
to recover the in-phase and quadrature components of our transmitted signal. Generally, there
will be noise present in the channel, so the demodulated signals will be an estimate of what
was actually transmitted. To begin let’s assume that the received signal, r(t), is identical to
the sent signal (i.e. r(t) = s(t)). Recall that our complex baseband representation of s(t) is
bandlimited around the positive frequency ωc and its complex conjugate is bandlimited around
the negative frequency −ωc , each scaled by 21 . Therefore, what we ultimately want is the
positive frequencies of S(jω) scaled by two and complex demodulated to baseband. To do this,
the negative frequencies of S(jω) are eliminated using a phase splitter, which is shown in Figure
4.

4
1

r(t) = s(t) + w(t) = s(t) + jdž(t)

-j sgn(Z )
j

Phase Splitter: ) ( jZ )

Figure 4: Phase splitter with Fourier transform Φ(jω)

Recall that the Fourier transform of a Hilbert transformer (see lab 4) is H(jω) = −jsgn(ω),
where sgn(·) is the signum function2 . The resulting Fourier transform of a phase splitter (using
linearity) is then

Φ(jω) = 1 + j(−jsgn(ω)) = 1 + sgn(ω) = 2u(ω). (8)

Here, u(ω) is the unit step function:


(
1, ω≥0
u(ω) = (9)
0, ω<0

This will give us the desired complex analytic signal, w(t). Next, this complex signal is down-
demodulated to baseband by multiplying it by e−jωc t , which will result in


w(t)e−jωc t = z(t)ejωc t e−jωc t = z(t), (10)

and we will have successfully recovered the complex baseband signal z(t) from real passband
signal s(t).

2.3 The Quadrature Modulator

We want to build the real RF signal s(t) from a bandlimited baseband message m(t). From eqns
(4) - (6), the transmit signal s(t) has the polar and Cartesian representations


s(t) = Re z(t)ejωc t = A(t) cos(ωc t + φ(t)) = x(t) cos(ωc t) − y(t) sin(ωc t), (11)

where x(t) and y(t) are the in-phase and quadrature components of the RF signal, respectively.
Note that x(t) and y(t) are the real and imaginary parts of the complex baseband representation
2
The signum function returns the sign (±1) of the real variable passed to the function.

5
of s(t) in eqn (2). The basic block diagram for implementing a quadrature modulator is shown
in Figure 5.

In-phase
x(t)
baseband signal

cos (Z c t)
s(t) RF signal

Quadrature phase
y(t)
baseband signal

- sin (Z c t)

Figure 5: The quadrature modulator for creating the real bandpass signal s(t). Taken from [3].

Here, the real bandpass signal s(t) is created by modulating the two independent bandlimited
signals x(t) and y(t). In the polar representation of z(t) = A(t)ejφ(t) , A(t) is the time-varying
magnitude, which is called the envelope of s(t), and φ(t) is the time-varying phase, which will not
be renamed. Note that A(t) is called the envelope of s(t) since it is the slow varying magnitude
that rides on the peaks, or envelope, of the transmitted signal s(t), and z(t) is called the complex
envelope of s(t), since it contains the information about the magnitude of the envelope and the
phase offset from the carrier frequency, namely ωc , of s(t)3 .
The signal s(t) is a quadrature amplitude modulated (or QAM) signal. From eqn (11), the QAM
signal s(t) may be interpreted in two ways. One, the signal s(t) is a signal whose amplitude is
modulated by A(t) and whose phase is modulated by φ(t). Another way to look at this is to say
that the in-phase component of s(t) is modulated by x(t) and the quadrature phase component
is modulated by y(t) (The second way being demonstrated in Figure 5). The game in analog
communications (and digital, with a slight twist on our story) is to select x(t) and y(t) to get a
certain type of modulation.

2.4 The Quadrature Demodulator

The general QAM demodulator is shown in Figure 6.


For a QAM demodulator to work properly, the local oscillator that generates the function
ejωc t = cos(ωc t) + j sin(ωc t) must be exactly in phase with the oscillator that generated the
cos(ωc t) and sin(ωc t) functions in the transmitter. This type of synchronous demodulation
requires either a phase-locked loop or that a pilot tone be sent with transmit signal. In the
case of phase-locked loop, an algorithm must track the current phase of the carrier frequency.
These types of demodulators will be used in the DSB-SC and FM cases. The other method
for synchronous demodulation is to include a pilot tone in the transmit signal. In this lab, the
3
In some texts, s(t) is the labelled the sent signal, which is how we have defined it, sL (t) is the complex
lowpass representation of s(t) (i.e. sL (t) = z(t)), and s+ (t) is the complex analytic representation of s(t) (i.e.
s+ (t) = w(t)).

6
Figure 6: Complex Implementation of a Synchronous Demodulator or Quadrature Receiver for
QAM.

message will have no DC (ω = 0) components. This means that a small DC offset may be added
to the baseband message signal that may be removed at the receiver end without affecting the
message signal. When this DC offset is modulated up to the passband by a local oscillator,
it will carry enough information about the phase of the carrier sinusoid to do synchronous
demodulation. This type of demodulation will be used in the coherent implementation of QAM
and SSB. In this lab, various coherent and non-coherent methods of demodulating will be studied.

2.5 Linear Modulation Schemes

All of the modulation schemes in this lab (with the exception of FM) are linear modulation
schemes. Linear modulation means that the in-phase component is the message signal and the
quadrature component is a filtered version of the message signal (or zero). In these systems, the
Fourier transform of the transmitted signal may be expressed in terms of the message signal.
Practical linear demodulation may be done by using the method described above. However, this
requires synchronous demodulation, which means that a pilot tone must be embedded in the
transmitted signal, or a carrier recover scheme must be used. This will done in the QAM, DSB-
SC, and SSB schemes. In the AM and FM schemes, specialized non-linear systems will used to
demodulate message signal. These non-linear systems raise some concerns, namely inefficient use
of transmit power in the AM case and an inability to specify the bandwidth of the transmitted
signal in the FM case.
Table 1 describes how to construct the in-phase and quadrature components of s(t) from the
baseband message signal m(t) for various modulation schemes.
Table 1 bears the following comments:
• QAM: This is the general case. In practice, there will be a small carrier component called
a pilot that the local oscillator will lock onto. This will be addressed when the quadrature
demodulator is implemented.
• AM: The carrier amplitude Ac must be greater than the signal amplitude. AM signals may
be demodulated via a simple envelope detector or a square law detector, but will require
more power to transmit than the other schemes.

7
QAM I signal Q signal Envelope Phase
Type x(t) y(t) A(t) φ(t)

AM Ac + m(t) 0 Ac + m(t) 0

DSB-SC m(t) 0 |m(t)| 0 or π

SSB m(t) m̂(t)

Rt
FM cos(φ(t)) sin(φ(t)) 1 kω m(τ )dτ
0

Table 1: Various Modulation Schemes for a QAM Modulator.

• DSB-SC: Double sideband suppressed carrier signals require synchronous demodulation,


which will be implemented using a Costas receiver. This scheme will require less power to
transmit than AM signals mentioned above, but is bandwidth inefficient.
• SSB: Single sideband needs only half the RF bandwidth of AM or DSB-SC and will require
synchronous demodulation. The signal m̂(t) is the Hilbert transform of the message signal
m(t).
• FM: The baseband signal is encoded in the phase of the RF signal. Demodulation is done
by non-linear devices like a phase-locked loop or an FM discriminator.

As stated earlier, all transmitted RF signals carry two channels worth of information (i.e. the in-
phase and quadrature channels). In the cases where the quadrature component is not used (i.e.
AM and DSB-SB), the transmit signal contains twice the bandwidth of its baseband messgae
signal, which means that bandwidth is being wasted. This can be remedied by choosing a
modulation scheme that uses the symmetry property of real signals to reduce the bandwidth,
such as SSB. In general, we will want to pick a modulation scheme that conserves bandwidth
and power and has a high tolerance to noise.
In each of these schemes, m(t) is assumed to be a single channel or mono source. When we want
to transmit a two channel or stereo source (e.g. the left and right channels of from a CD), we
will want to use a scheme like QAM. In this case, we could modulate the left and right channels
of our stereo signal onto the in-phase and quadrature carriers of QAM signal, respectively. We
will address this again when we implement the various modulation schemes.

8
3 Amplitude Modulation (AM)

Amplitude modulation, or AM is the oldest modulation scheme used in commercial radio. From
Table 1 and eqn (11), it may be seen that AM signals have no quadrature component. This
means that the transmit signal s(t) is

s(t) = [Ac + m(t)] cos(ωc t) = Ac cos(ωc t) + m(t) cos(ωc t). (12)

When this is implemented, Ac > |m(t)| ∀ t. This is required so that the message signal m(t)
rides on the peaks, or envelope, of the carrier sinusoid cos(ωc t). From the righthand side of eqn
(12), we can see that the transmit signal contains a carrier sinusoid modulated by the message
signal plus a scaled sinusoid that carries no information about the transmit signal. This extra
signal contains most of the power of the transmit signal and is generally considered a waste
of power. However, it does allow for demodulation via a simple envelope detector4 . In DSP
hardware, we will use a square law detector as describe in [2].

3.1 Square Law Detector

Consider squaring the sent signal s(t). The result is

1 1
s2 (t) = [Ac + m(t)]2 cos2 (ωc t) = [Ac + m(t)]2 + [Ac + m(t)]2 cos(2ωc t). (13)
2 2
From the righthand side of eqn (13), we can see that the squaring operation created the original
baseband signal, namely x(t) = Ac + m(t), squared and scaled by two, and a high frequency
component that is the original baseband signal squared and scaled by two that is modulating
cos(2ωc t) (a sinusoid oscillating twice as fast as the original carrier frequency ωc ). Under a
bandlimited assumption, the higher frequency term may be filtered out using a lowpass filter.
The result of lowpass filter would be

1 2 1
x (t) = [Ac + m(t)]2 . (14)
2 2
Now, taking the square root of eqn (14) gives

r
1 2 1 1
x (t) = x(t) = [Ac + m(t)]. (15)
2 4 4

The last step to recovering the message signal is to remove the DC component Ac . Most of the
message signals that we will use in this lab will have no DC components, so the Ac term may be
removed by either using a highpass filter or subtracting off the gain. However, the codec on the
DSK is capacitively coupled so that DC signals are not transmitted. Therefore, the highpass
filter is not necessary, but it is good practice to put one in. The basic hardware diagram for this
square law demodulator is given in Figure 7.
4
An envelope detector an analog circuit that may be build using a diode in series with a parallel combination
of a resistor and a capacitor.

9
received
signal
[·]2 LPF [˜] HPF DAC K m(t)
nts

Figure 7: DSP Implementation of a Square Law AM Demodulator. Adapted from [2].

In Figure 7, notice that output is the original message signal scaled by the constant K. From
the previous discussion, K = 4. In practice, you will want to add a gain to the output. This
gain may be greater than 4, but it must be small enough to not overdrive the codec.
In practice, this implementation will require floating-point arithmetic to calculate the square
root of a function.

3.2 Other AM Demodulators

Another possible AM demodulator is given in [2]. In this implementation, the envelope detector
is implemented using a Hilbert transformer. For more information on this, refer to [2].

4 Quadrature Amplitude Modulation (QAM)

The most general coherent demodulator is the QAM demodulator, which is shown in Figure 6.
In order to implement this demodulator, the receiver has to be able to lock onto the phase of the
cos(·) and sin(·) waves that the in-phase and quadrature components modulated. In the general
case, this is done by including a pilot tone that is outside the passband of the transmit signal.
This pilot tone must carry information about the phase of the transmit signal. A specialized
circuit is then used to extract this phase information and use it for coherent demodulation.
In the case where voice and music are being transmitted, the baseband message signal will contain
no frequency components around DC. This means that we can add a small DC component to
our in-phase signal (i.e. replace x(t) with p + x(t), where p is small). Now, the transmit signal
from eqn (11) becomes

s(t) = x(t) cos(ωc t) − y(t) sin(ωc t) + p cos(ωc t), (16)

where p cos(ωc t) is the pilot tone that the demodulator will be able to lock onto. Since the
message signal will contain no frequency components around DC, the pilot tone p cos(ωc t) will
be the only frequency component around the frequency ωc in the sent signal. This pilot tone
and its quadrature counterpart, namely p sin(ωc t), may be extracted from s(t) using finely tuned
IIR comb filters. The transfer functions of the filters that do this are [2]

(1 − r)(1 − r cos(ωc to )z −1 )
Hin (z) = , (17)
1 − 2r cos(ωc to )z −1 + r 2 z −2

10
and

(1 − r)r sin(ωc to )z −1
Hquad (z) = . (18)
1 − 2r cos(ωc to )z −1 + r 2 z −2

Here, Hin (z) is used to recover p cos(ωc t), and Hquad (z) is used recover p sin(ωc t). In practice,
the value of r in eqns (17) and (18) will be slightly less than one. If the DTFT’s of eqns (17)
and (18) are labelled Hin (ejωto ) and Hquad (ejωto ), respectively, and they are each evaluated at
ω = ωc , then the following relationships hold:

lim Hin (ejωc to ) = .5 (19)


r→1

and

lim Hquad (ejωc to ) = −.5j, (20)


r→1

which means that the in-phase and quadrature components will be recovered exactly. However,
as r approaches 1, the transfer functions Hin (z) and Hquad (z) are approaching zero in the
numerator and the poles (roots in the denominator polynomial) are approaching the unit circle.
When implementing these filters using digital (quantized) values, they become unstable as r
gets arbitrarily close to one (NB: theoretically, r < 1 will guarantee a stable implementation,
however due to rounding errors in the digital hardware, it is not restrictive enough to guarantee
stablity). According to [2], the optimal value of r should be chosen so that Hin (z) and Hquad (z)
have a 50Hz 3dB bandwidth centered at ωc 5 . These filters will allow for demodulation of all
QAM signals. In particular, they will be useful for demodulating DSB-SC and SSB signals.
Caveat: These filters only extract the information about the in-phase and quadrature com-
ponents of the received signal, but they do not remove it. To remove this component, either
subtract it before demodulating or use a highpass filter at the output to remove it.
The general hardware diagram that will be used to implement a QAM demodulator is given in
Figure 8.
In Figure 8, the solid lines represent the real channel and the dotted lines represent the imaginary
channel. The multiplication operation is a complex multiplication (i.e. it will require four real
multiplications, two real additions, and will produce a two channel output). After the complex
demodulation, the output must be passed through a lowpass filter to remove other users on
the channel. It must also filter out the DC component that was used to carry the pilot tone.
These two operations may be combined into one by designing a bandpass filter whose passband
extends from 50Hz to the bandwidth of the channel. A simple FIR filter or the reconstruction
filter on the codec will work well for this lab.
NB: Be sure to account for the filter latency of the Hilbert transformer.

5
By a 50Hz 3dB bandwidth, we mean that if |H(ejωc to )| = 1, then |H(ej(ωc +∆ω)to )| ≈ |H(ej(ωc −∆ω)to )| ≈ .5,
where ∆ω = 2π × 25 rad/sec.

11
Re[·] BPF DAC x(t)
received
signal
-j sgn(Ȧ) x
nto
Hilbert Transformer Im[·] BPF DAC y(t)

1 r Baseband Filters
That Remove DC
1  2r cos(Z c to ) z 1  r 2 z  2 Components

In-phase
Carrier
1  r cos(Z c to ) z 1

Quadrature
Carrier
r sin(Z c to ) z 1

Bandpass Carrier Recovery Filters

Figure 8: Hardware Diagram of a QAM Demodulator. Adapted from [2].

5 Single-Sideband (SSB) Modulation

Single-sideband modulation is the most efficient way to use bandwidth. This method takes
full advantage of complex baseband signal by creating a complex (two channel) signal where
each channel has half the bandwidth of the real (one channel) message signal. This operation of
creating a two channel signal with half the bandwidth of a one channel signal does not reduce the
bandwidth in the baseband signal, but it will reduce the amount of bandwidth in the passband
(or transmit) signal (centered around a carrier frequency). In the AM and DSB-SC methods,
the passband signal has twice the bandwidth as the message signal. In SSB, the message signal
and the passband signal have the same bandwidth6 . This is the most bandwidth efficient way to
transmit information across a channel. This works because of the Hermitian symmetry of real
signals. If you want to communicate using less bandwidth, then you will have to not be able to
transmit the entire spectrum of the message signal. This is a physical limitation that can not
be circumvented.
The basic SSB modulator may be implemented by creating the Hilbert transform of the message
signal, accounting for filter delays, and then creating the transmit signal as defined in eqn (16),
where x(t) is the delayed message signal, y(t) is the Hilbert transform of the message signal
(aligned in time with the unfilter message signal), and p is chosen in an appropriate manner.
Choosing p will need to be done by trial and error.
The basic SSB demodulator is the same as the QAM demodulator shown in Figure 8. The
6
In these comparisons, the bandwidth of the message signal is the bandwidth centered around DC and the
bandwidth of the transmit signal is with respect to the bandwidth centered around a carrier frequency. To clarify
what is meant by bandwidth, the transmit signal is labelled a passband signal.

12
only consideration is that the message signal will be on the in-phase channel. This means that
filtering the demodulated imaginary channel is unnecessary, since it will be of no use at the
output.

6 Double-Sideband Suppressed Carrier (DSB-SC) Modulation

Double-sideband suppressed carrier modulation is the same as AM, except there is no carrier
component. The basic transmit signal for DSB-SC is

s(t) = m(t) cos(ωc t). (21)

This signal may be demodulated using a Costas receiver, which is a modified phase-locked loop7 .
A well suited DSP implementation of a Costas receiver is shown in Figure 9, which is taken from
[2].

w[n ] z[n ]
received DAC m(t)
signal c1 [n ]
BPF -j sgn(Ȧ) x
s[n ] sˆ[n ] x
c2 [n ]
nto
Hilbert q[n ]
Transformer
e  jI [ n ]

V [n ] E
e  j (˜)
1  z 1

d [n ]
z 1 + + D
I [n ]
Phase Discriminator
'T
Voltage Controlled Oscillator (VCO)

Figure 9: Second-Order Costas Loop For Demodulating DSB-SC Signals. Adapted from [2].

The basic idea of a Costas receiver is to track the phase of the modulated waveform cos(ωc t).
The DSP implementation given in Figure 9 is taken from [2], which will be explained shortly.
For more information on this implementation and Costas loops in general, see [1] and [2].
The first task of the demodulator shown in Figure 9 is to bandpass filter the received signal to
get the transmitted signal
7
If the transmit DSB-SC signal has a carrier component added to it, then it may be demodulated using a basic
QAM demodulator. In this case, the transmit signal would need to be defined as s(t) = m(t) cos(ωc t) + a cos(ωc t).
While this will work, it is not the preferred way to do DSB-SC modulation.

13
s[n] = m[n] cos[∆θn + θ1 ]. (22)

Here, θ1 [n] is the phase error at the receiver and ∆θ = ωc to is the change in angle of the carrier
sinusoid between samples. This error will consist of a constant that is the nominal phase error
and may have a slowly changing phase due to a doppler shift. As a result, this phase error will
be expressed as

θ1 [n] = ∆ωnto + γ, (23)

where ∆ω is the Doppler shift and γ is the nominal phase error.


Next, the complex analytic signal w[n] is formed, where

w[n] = s[n] + jb
s[n]
= m[n]ej[∆θn+θ1[n]] . (24)

In this notation, sb[n] is the Hilbert transform of s[n].


In the feedback loop, the system must generate an estimate of the angle of the carrier cos(ωc t)
in the received signal. This angle is determined by using a phase discriminator and a voltage
controlled oscillator, which will be explained shortly. For now, the angle will be defined as

φ[n] = ∆θn + θ2 [n], (25)

This estimate of the angle is used to complex demodulate the signal to baseband, which yields

z[n] = w[n]e−jφ[n]
= m[n]ej[θ1 [n]−θ2[n]]
= c1 [n] + jc2 [n]. (26)

Here, c1 [n] and c2 [n] are the estimates of the in-phase and quadrature components of the base-
band signal z[n]. These estimates may be expressed as

c1 [n] = s[n] cos[φ[n]] + sb[n] sin[φ[n]]


= m[n] cos[θ1 [n] − θ2 [n]] (27)

and

c2 [n] = −s[n] sin[φ[n]] + sb[n] cos[φ[n]]


= m[n] sin[θ1 [n] − θ2 [n]] (28)

When θ1 [n] ≈ θ2 [n], the system is in lock and c1 [n] ≈ m[n] and c2 [n] ≈ 0. In this case, the
in-phase channel carries a good estimate of the original message signal and quadrature channel is
approximately zero. Provided that we can generate θ2 [n] ≈ θ1 [n], this method of demodulation
will allow for coherent detection without the use of a pilot tone.

14
6.1 Phase Discriminator

The next step is to implement a phase discriminator, which will generate an estimate of of the
phase error. To begin this process, the real and imaginary components of the demodulated
signal are multiplied together to get

q[n] = c1 [n]c2 [n] = m2 [n] cos[θ1 [n] − θ2 [n]] sin[θ1 [n] − θ2 [n]]
= .5m2 [n] sin[2(θ1 [n] − θ2 [n])]. (29)

If θ1 [n] and θ2 [n] differ by less than 90o , then q[n] has the same sign as the phase error θ1 [n]−θ2 [n],
so it indicates which direction the phase estimate θ2 [n] should be changed to reduce the phase
error to zero. When the loop is in lock, the small angle approximation sin(x) ≈ x may be used
to accurately approximate q[n] as

q[n] = m2 [n](θ1 [n] − θ2 [n]) + σ[n − 1] for |θ1 [n] − θ2 [n]| ≪ 1. (30)

In this case q[n] is approximately zero and the phase θ1 [n] is being tracked almost perfectly by
θ2 [n].
The next task of the phase discriminator is to generate a DC signal that will correct for the
phase error. This is done by passing q[n] through a lowpass filter to generate

σ[n] = βq[n] + σ[n − 1], (31)

and adding it to αq[n] to get an adjustment to the error estimate for the next angle sample,
namely

d[n] = σ[n] + αq[n]


= (α + β)q[n] + σ[n − 1]. (32)

α
In practice, α and β will be small positive constants with β < 50 . When θ1 [n] ≈ θ2 [n], q[n] ≈ 0,
which means that σ[n] ≈ 0, and the error adjustment d[n] will not change much from sample-to-
sample. This approximation of the phase error is then passed to a voltage controlled oscillator
that uses the approximated phase error to correct the phase of the next angle sample.

6.2 Voltage Controlled Oscillator (VCO)

The voltage-controlled oscillator (VCO) generates the phase corrected angle for the in-phase and
quadrature demodulator signal generator, namely e−j(·) in Figure 9. This is done by calculating
the next angle to be passed to e−j(·) , which is

φ[n + 1] = φ[n] + ∆θ + d[n]. (33)

15
The VCO recursively calculates the phase corrected angle for the next demodulated sample
based on the current angle and phase, namely φ[n] + θ2 [n], plus the error adjustment for current
demodulated complex baseband sample. When this is implemented, the current angle estimate
will need to be used, not the next estimate. This is a basic discrete-time VCO that we will use
in this lab.

6.3 Comments on the Second-Order Costas Loop

It is well known in control theory that an integrator (a transfer function with a pole at ω = 0)
will track constant inputs with a zero steady-state error, and that double integrators (a transfer
function with a double pole at ω = 0) will track first-order input polynomials with a zero
steady-state error. From eqn (23), we can see that θ1 [n] is a first-order polynomial that may be
tracked by a double integrator. In discrete-time systems, an integrator is the transfer function,
U (z), whose impulse response is the unit step response u[n]. Using the well known DTFT
pair u[n] ←→ U (z) = 1−z1 −1 , we can see that U (z) has a simple pole at ω = 0. To see this,
consider z = ejωto . When ω = 0, z = 1, which is pole of U (z), as we would expect. A double
integrator may be formed by cascading two integrators together. In a second-order Costas loop,
one integrator appears in phase discriminator, namely 1−zβ −1 , and one is formed by the feedback
loop in the VCO. Therefore, this second-order (a cascade of two first order integrators) will track
linear phase errors, such as θ1 [n], with zero steady-state error.

7 Frequency Modulation (FM)

Frequency modulation (FM) is non-linear modulation scheme that encodes the message signal
into the phase of the transmit signal. The basic FM transmit signal is

s(t) = cos(ωc t + φ(t)) (34)


= cos(ωc t) cos(φ(t)) − sin(ωc t) sin(φ(t)), (35)

where

Zt
φ(t) = kω m(τ )dτ. (36)
0

In this notation, kω is a positive constant called the frequency sensitivity. In general, kω will be
a fraction of the carrier frequency (e.g. .5ωc ).
To implement a discrete-time FM modulator as described in eqn (34), a VCO may be used. A
basic FM modulator is given in Figure 10.
In Figure 10, β = kω to . Typically, this value will be less than 2π since kω < ωc < ω20 . In the
lab, FM signals may either be generated using the FM modulator in Figure 10 or by using the
signal generator to generate FM signals.

16
m(t) m[n ] E I [n ] s[n ]
+ z 1 cos(˜) DAC s(t )
1  z 1
nto
'T

Figure 10: VCO FM Modulator.

The two most common ways to demodulate FM signals is to use an FM discriminator or to use
a phase-locked loop. Both methods may be implemented on the DSP hardware, but a phase-
locked loop will give better performance. Therefore, only the phase-locked loop will be covered
here. For information about a DSP implementation of an FM discriminator, see [2].

7.1 FM Demodulation Using A Phase-Locked Loop

The block diagram for a discrete-time phase-locked loop FM demodulator is given in Figure 11.
Loop Filter H(z )

E
1  z 1
received Phase Detector
signal

BPF -j sgn(Ȧ) x atan2(y,x) D DAC m(t)


s[n ] sˆ[n ] T m  T1 +
nto
Hilbert
Transformer
e  jI [ n ]

e  j (˜) z 1 + k vT
I [n ]

'T
Voltage Controlled Oscillator (VCO)

Figure 11: A Discrete-Time Phase-Locked Loop FM Demodulator. Adapted From [2].

The FM demodulator in Figure 11 is very similar to the the discrete-time Costas receiver shown
in Figure 9. If the received signal is assumed to be noiseless, then it may be expressed as

s[n] = cos[ωc nto + θm [n]]. (37)

This signal is then passed through a phase splitter to form the complex analytic signal

s[n] = ej[ωc nto +θm [n]] .


w[n] = s[n] + jb (38)

Next, the analytic signal is demodulated to baseband as follows

17
z[n] = w[n]e−jφ[n] = w[n]e−j[ωc nto +θ1 [n]] = ej[θm [n]−θ1[n]] . (39)

The phase angle is φ[n] is calculated recursively by the VCO. Starting at n = 0 and iterating
the equation, it follows that

φ[n + 1] = φ[n] + ωc to + kv to y[n] (40)


= φ[n] + θ1 [n], (41)

where

n−1
X
θ1 [n] = θ[0] + kv to y[n]. (42)
k=0

The phase θ1 [n] is tracked by the loop filter H(z) and is the phase of received signal one
sample ago. Since θm [n] is the phase of the received signal at the current sample, the difference
θm [n] − θ1 [n] is an estimate of the derivative of θm [n] at low frequencies. Recall that the message
signal was used to form the instantaneous frequency of the transmit signal s(t). Therefore, by
k
estimating the derivative of the phase of the received signal, we have that y[n] ≈ kfv m[n] for all
n, and we have demodulated an FM signal.
Recovering the phase difference θm [n] − θ1 [n] is done by calculating the phase of complex base-
band signal z[n]. It is well known that this phase may be calculated as

   
−1 ℑmz[n] −1 s[n]
θm [n] − θ1 [n] = arg z[n] = tan = tan = atan2(b
s[n], s[n]), (43)
ℜez[n] sb[n]

where atan2(y,x) is a built-in C function that may be used when the header file math.h is in-
cluded in a C program. The function atan2(y,x) is a four-quadrant inverse tangent (arctangent)
that returns angles between −π and π.
Between the loop filter and the VCO (second-order pole at ω = 0), this phase-locked loop will
track the linear instantaneous phase of the received signal with zero steady-state error.
This implantation is very similar to the Costas loop in the DSB-SC case, except that the FM
demodulator will require more bandwidth than the Costas loop. In the DSB-SC demodulator,
the loop only had to track a single sinusoid at the carrier frequency, so it only required a small
amount of bandwidth. In the FM demodulator the phase-locked loop must be able to track
signals over the bandwidth of the message signal, which will require more bandwidth. This is
accounted for in design by using larger values of α and β in the loop filter. In a typical FM
α
demodulator, α might be equal to one and β < 100 .

18
8 Practical Considerations for this Lab

8.1 Hardware Limitations

There will be three main hardware limitations in this lab. These include overdriving the codec,
filter latency (timing), and code speed. In all of these implementations, the output will have
to be integers between ±215 (type short) with maps to 3Vpp output voltage. For example, in
an AM communication system the message will have to have a relative peak-to-peak voltage of
less than 1.5Vpp. A point that will be obvious when AM is implemented. For filter latency,
if the real channel of a complex signal is the unfiltered message and the imaginary channel is
the message filtered by a 21-tap FIR filter (N = 20), then the imaginary channel will have a
10 sample delay (filter order divided by 2). This delay must then be accounted for in the real
channel. This is done so that the real and imaginary components of the complex baseband signal
align. Finally, in some systems, there will be many operations that need to be done. Therefore,
it is necessary to code algorithms as efficiently as possible. An example of this would be to use
the optimized assembly coded FIR filter for all FIR filters (see lab 4). These types of design
issues will play a constant theme throughout this lab.

8.2 Implementation Using Two Boards

For the lab assignment, you will be expected to implement both the modulator and the demodu-
lator (a full modem) for each modulation scheme. The most straightforward way of implementing
this is to use one DSK as the modulator and another DSK for the demodulator (see the next
section for an alternative method). This can be done if each group “pairs up” with another
group in the sense that each group must be willing to share their DSK board with another
group. However, each individual group will be expected to turn in their own lab report. Details
of how to do this will be given in the recitation. An alternative is to borrow a board from
the Instructor. Note that you should troubleshoot and assure that both the modulator and
demodulator are working before you try to put them together.

8.3 Implementation Using Both Codec Channels Simultaneously

It is possible to use both channels of codec for this lab at the same time; however, it complicates
the implementation process somewhat. For example, you could use the left channel input as
the message signal input, loop the modulated output of the left channel into the right channel
input, and use the right channel output to display your demodulated output. This should be
straightforward from a programming point of view but will require some special cabling. Let
the Instructor know beforehand if you would like to try this method.
NB: Both this method and the method mentioned above (using two boards) are acceptable for
this lab.

19
9 Design and Implementation Tips

This section gives a list of tips that will aid in the design and implementation of the various
modulation schemes in this lab.
• For many of the modulation schemes, it is possible to use two signal generators to create
the modulator. Therefore, it is often wise to built and test the demodulator first. This
is done for two reasons. First, the demodulator may be tested using a known working
modulator (the signal generators). Second, the demodulators are generally much more
difficult to implement than the modulators. Building and testing the demodulator first
will reduce the sources of error in your modem implementation greatly.
• When designing a phase splitter, the input (straight wire) must be aligned in time with
the output of the Hilbert transformer.
On the class webpage, you will find 30, 60, and 90 order Hilbert transformer coefficient
files. The fixed-point files are: HT 30.cof, HT 60.cof, and HT 90.cof. The floating-point
files are HT 30 float.cof, HT 60 float.cof, and HT 90 float.cof.
Note that there are two sources of latency in this implementation. The first comes from
the way the filter was designed (N/2 samples) and the second comes from the way the
filter is implemented on the DSK (a one sample delay). In your lab report, you will be
expected to justify where the delay come from.
• For the Costas receiver (and the phase-locked loop), the arithmetic was done assuming
that the received signal was normalized to ±1. When you implement this, you have to
convert the received signal (and its time aligned Hilbert transformer) to type float. Then,
you must scale the values by 2−15 to normalize them, implement the receiver, and scale the
output by 215 before you output it to the codec. (Caveat: Do not try to use the bit shift
operator to scale a floating point number. Use the standard floating-point multiplication
to do the scaling)
• In the Costas receiver design, the parameters α and β determine the bandwidth of the
carrier signal that you will be tracking. Sample values are α = 0.01 and β = 0.0002. Note
α
that β = 50 .
• In the phase-locked loop receiver design, the bandwidth must be large enough to track the
entire message signal. In this case, you will want α = 1 and β = 0.01 (or less). Note that
α
β = 100 .

10 Assignments*

For this lab, you will have two options for implementation. One is to use the two wire codec
program and use the DSK as both a modulator and a demodulator. The second way is to use
two DSK’s. This means that you will need to either borrow a DSK from a different group or set
up a time to meet with the TA, who will provide another board. Each group is expected to do
their own work (see “Practical Considerations for this Lab”) .

20
Required Assignment

1. Consider the narrow baseband message signal magnitude spectrum M (jω) shown in
Figure 12. For each of the modulation schemes AM, DSB-SC, and SSB, sketch the
complex baseband spectrum Z(jω), the complex analytic spectrum W (jω), and real
passband spectrum S(jω). Can you sketch the frequency spectrum for an FM scheme?
Why?

M( jZ)

Z
-W W
0

Figure 12: Message Signal Spectrum M (jω)

Required Assignment

2. Design and implement a SSB modem (modulator and demodulator) that does not use a
pilot tone. Implement the QAM demodulator in Figure 6. How does the non-coherence
affect the output signal? Use music/voice as an input and listen to the output.

3. Repeat the previous problem, except include a pilot tone. Use the carrier recovery
circuit in Figure 8 to recover the in-phase and quadrature components of the carrier
sinusoid. How does the phase coherence improve the quality of the demodulated signal?

4. Design and implement a DSB-SC modem. Use a Costas receiver in Figure 9 as your
demodulator. Comment on all of the parameters used. Include an explain your code.

10.1 Extra Credit Assignments*

The following questions are not required, but they will be worth extra credit.

21
Extra Credit Assignment

5. Design and implement a FM modem. Use a phase-locked loop as your demodulator.


Comment on all of the parameters used. Include an explanation of your code.

6. Design and implement an AM modem using a square-law detector as your demodulator.


Comment on all of the parameters used. Include an explanation of your code.
Caveat: When a square-law detector is implemented, the non-linear squaring operation
will increase the bandwidth of the message signal. Note that in order to implement
the AM modulator on the DSK, the frequency spectrum of the transmit signal must be
must be bandlimited to fc + W < f2s , where fs is the rate of the codec and W is the
bandwidth of the message signal. However, the (nonlinear) squaring operation in the
demodulator will result in a signal that has bandwidth 2(fc + W ). Therefore, to avoid
aliasing in the modem, the parameters fc and W must be chosen so that they satisfy
2(fc + W ) < f2s .

11 End Notes

The various modulation schemes implemented in this lab are used in everyday life. Many of these
implementations are very suitable for DSP implementation, but as an engineering, you have to
decide what method is the most practical for the application. For example, implementing a
square law detector in place of simple envelope detector would probably not be a good decision.
Also, doing high rate signal processing with a DSP chip may be very costly. Therefore, an analog
circuits may be more suitable for heterodyning and then using a low rate DSP algorithm for
modulation and demodulation.

11.1 Lab Suggestions for Course Project


• Implement a digital communication lab using the modulation schemes discussed here.
• Implement an OFDM system using an FFT algorithm

References

[1] S. Haykin, Communication Systems. John Wiley and Sons, Inc., New York, 2001.

[2] S. A. Tretter, Communication Design Using DSP Algorithms: With Laboratory Experiments
for the TMS320C6701 and TMS320C6711. Kluwer Academic/Plenum Publishers, New York,
2003.

[3] Colorado State University, Fort Collins, CO, Signals and Systems Laboratory 12: Linear
Modulation and Demodulation, 2001.

22

You might also like