Lab 7: Amplitude Modulation and Complex Lowpass Signals: ECEN 4652/5002 Communications Lab Spring 2020
Lab 7: Amplitude Modulation and Complex Lowpass Signals: ECEN 4652/5002 Communications Lab Spring 2020
Lab 7: Amplitude Modulation and Complex Lowpass Signals: ECEN 4652/5002 Communications Lab Spring 2020
3-16-20 P. Mathys
Thus, Ac m(t) ej(2πfc t+θc ) is a complex-valued bandpass signal with amplitude Ac and center
frequency fc if m(t) is a (bandlimited) baseband signal. To make this into a real bandpass
signal x(t), write
x(t) = Re{Ac m(t) ej(2πfc t+θc ) } = Re Ac m(t) cos(2πfc t + θc ) + j sin(2πfc t + θc )
= Ac m(t) cos(2πfc t + θc ) ,
where the last equality assumes that Ac m(t) is real-valued. The signal x(t) obtained in this
way is a AM-DSB-SC (amplitude modulation, double side-band, suppressed carrier) signal
with carrier frequency fc , carrier phase θc and Fourier transform
Ac
x(t) = Ac m(t) cos(2πfc t + θc ) ⇐⇒ X(f ) = M (f − fc ) ejθc + M (f + fc ) e−jθc .
2
Starting from
1
we could also have derived this as
δ(f − fc ) ejθc + δ(f + fc ) e−jθc Ac
X(f ) = Ac M (f ) ∗ = M (f − fc ) ejθc + M (f + fc ) e−jθc .
2 2
What is important to note here is that taking the real (or imaginary) part of a signal in the
time domain is an operation that has a well-defined and easy to evaluate counterpart in the
frequency domain.
In the frequency domain x(t) ⇔ X(f ) can be visualized as follows (assuming θc = 0 for
simplicity)
M(f ) X(f )
Mm Ac Mm LSB USB
2
f f
−fm 0 fm −fc 0 fc
−fc −fm −fc +fm fc −fm fc +fm
From the figure it is evident that if the bandwidth of m(t) is fm , then the bandwidth of x(t)
is 2fm , which explains the “DSB” in AM-DSB-SC. It is also clear that if m(t) has no dc
component (which is the case for speech and music signals, for instance), then x(t) has no
component at the carrier frequency fc , which is where the “SC” comes from. The portion
of the spectrum of x(t) for which fc − fm ≤ |f | < fc is called the lower side-band (LSB),
whereas the portion for which fc < |f | ≤ fc + fm is called the upper side-band (USB).
To recover m(t) undistorted from x(t), fc ≥ fm is required, but usually fc fm in practice.
The block diagram of an AM-DSB-SC transmission system is shown in the following figure.
Noise n(t)
Transmitter Receiver
The transmitter consists of a LPF that bandlimits the wideband message signal mw (t) to
|f | ≤ fm and the modulator which multiplies the resulting message signal m(t) with the
output Ac cos(2πfc t + θc ) of the carrier oscillator. The channel is modeled as a filter HC (f )
with noise added at the output. In the receiver the incoming signal r(t) is multiplied by the
local oscillator signal 2 cos(2πfc t + θc ) and then lowpass filtered at fL . Assuming an ideal
2
channel with attenuation γ and no noise such that r(t) = γ x(t), the demodulation operation
can be described as
v(t) = 2r(t) cos(2πfc t+θc ) = 2γAc m(t) cos2 (2πfc t+θc ) = γAc m(t) 1 + cos(4πfc t+2θc ) .
Assuming that fc ≥ fm , the second term, which is a AM-DSB-SC signal with carrier fre-
quency 2fc and carrier phase 2θc , can be removed by lowpass filtering at fL = fm and
thus
m̂(t) = γAc m(t) .
In the absence of noise and other channel impairments this is an exact replica of the trans-
mitted message signal, scaled by γAc .
If m(t) is a wide-sense stationary process with autocorrelation function Rm (τ ), then the
autocorrelation function of the AM-DSB-SC signal x(t) can be computed as
Rx (t1 , t2 ) = E Ac m(t1 ) cos(2πfc t1 + θc ) A∗c m∗ (t2 ) cos(2πfc t2 + θc )
−10
−20
−30
−40
−50
−60
0 2000 4000 6000 8000 10000 12000 14000 16000
f [Hz]
3
1.2 Coherent AM Reception
An idealizing assumption which is tacitly made in the AM-DSB-SC transmission system
block diagram given earlier, is that the local oscillator at the receiver is synchronized with
the carrier oscillator at the transmitter. To see why this synchronism between transmitter
and receiver is important, assume that the local oscillator signal is 2 cos(2πfc t), but the
received AM-DSB-SC signal is r(t) = γAc m(t) cos(2π(fc + fe )t + θe ), i.e., there is a frequency
error fe and a phase error θe between transmitter and receiver. Now the receiver computes
after the LPF at fL = fm . When fe = 0, a small phase error |θe | π/2 attenuates m(t) by
cos(θe ) ≈ 1, which presents no big problem, but a phase error close to ±π/2 attenuates m(t)
substantially or even suppresses it altogether. If fe is non-zero, then θe does not matter and
m̂(t) changes periodically in intensity because of the multiplication with cos(2πfe t), which
is quite annoying.
On the positive side, however, the fact that m(t) cos(θe ) = 0 for θe = ±π/2 means that two
AM-DSB-SC signals, such as
can use the same carrier frequency fc to transmit two independent message signals mi (t)
and mq (t). This is known as quadrature amplitude modulation (QAM), and xi (t)
is called the in-phase component of the AM signal at fc , whereas xq (t) is called the
quadrature component. At any rate, it is crucial for the correct demodulation of AM
signals with suppressed carrier, that the receiver is phase (and frequency) synchronized
with the transmitter. Receivers of this type are called synchronous or coherent receivers.
In practice the maintenance of exact phase synchronism between two oscillators in different
physical locations is quite a non-trivial problem and requires a considerable amount of active
hardware and/or software.
4
The two baseband signals mi (t) ⇔ Mi (f ) and mq (t) ⇔ Mq (f ) are real-valued, bandlimited
to fm , and independent of each other. Since the overall signal x(t) has bandwidth 2fm ,
using QAM is one way of avoiding the doubling of the bandwidth associated with amplitude
modulation.
More generally, let
xL (t) = mi (t) + j mq (t)
be a complex-valued lowpass signal with bandwidth fm , made up from the real-valued signals
mi (t) and mq (t). Then we can obtain a real-valued QAM bandpass signal in two steps as
follows. In the first step xL (t) is multiplied by Ac and shifted right by fc in the frequency
domain to obtain the complex-valued signal xu (t) as
xu (t) = Ac xL (t) ej2πfc t .
In the second step the real-valued QAM signal x(t) is obtained by
xu (t) + x∗u (t)
x(t) = Re{xu (t)} = .
2
In the frequency domain this corresponds to
Xu (f ) + Xu∗ (−f ) Ac
X(f ) = = Mi (f − fc ) + j Mq (f − fc ) + Mi∗ (−f − fc ) − j Mq∗ (−f − fc ) .
2 2
Since mi (t) and mq (t) are real-valued, we have Mi (f ) = Mi∗ (−f ) and Mq (f ) = Mq∗ (−f ) and
therefore
Ac
X(f ) = Mi (f − fc ) + j Mq (f − fc ) + Mi (f + fc ) − j Mq (f + fc ) .
2
Thus, the x(t) ⇔ X(f ) obtained in this way is the same as the one we obtained before from
x(t) = xi (t) + xq (t).
To demodulate the QAM signal x(t) and recover xL (t) and therefore mi (t) and mq (t) as the
real and imaginary parts of xL (t), we can again use the frequency shift property of the FT.
We multiply x(t) by 2 e−j2πfc t to obtain
v(t) = x(t) 2 e−j2πfc t = [xu (t) + x∗u (t)] e−j2πfc t = Ac [xL (t) + x∗L (t) e−j4πfc t ] .
After lowpass filtering at fL = fm this yields
x̂L (t) = LPF{v(t)} = Ac xL (t) .
Graphically, QAM modulation and demodulation using complex-valued lowpass signals can
be visualized as follows.
Ac ej2πfc t 2e−j2πfc t
5
Using xL (t) = mi (t) + j mq (t) and e±j2πfc t = cos(2πfc t) ± j sin(2πfc t), this can also be
implemented using only real-valued signals as shown in the next blockdiagram.
6
Suppose now that x̂L (t) has some special properties from which fe and θe can be estimated.
Then it is possible to obtain the scaled, but otherwise error-free demodulated signal from
the complex-valued QAM demodulator output x̂L (t) by multiplying with e−j(2πfe t+θe )
x̂L e−j(2πfe t+θe ) = γ Ac xL (t) .
If, on the other hand, the receiver uses an entirely real-valued QAM demodulator implemen-
tation and r(t) is correspondingly converted to
r(t) = γ Ac mi (t) cos(2π(fc + fe )t + θe ) − mq (t) sin(2π(fc + fe )t + θe ) ,
then
vi (t) = r(t) 2 cos(2πfc t) = γ Ac mi (t) cos(2πfe t + θe ) + cos(2π(2fc + fe )t + θe ) +
− mq (t) sin(2πfe t + θe ) + sin(2π(2fc + fe ) + θe ) ,
and
vq (t) = −r(t) 2 sin(2πfc t) = γ Ac mi (t) sin(2πfe t + θe ) − sin(2π(2fc + fe )t + θe ) +
+ mq (t) cos(2πfe t + θe ) − cos(2π(2fc + fe ) + θe ) .
After lowpass filtering at fL ≈ fm the demodulated real-valued signals are
m̂i (t) = LPF{vi (t)} = γ Ac mi (t) cos(2πfe t + θe ) − mq (t) sin(2πfe t + θe ) ,
and
m̂q (t) = LPF{vq (t)} = γ Ac mq (t) cos(2πfe t + θe ) + mi (t) sin(2πfe t + θe ) .
In this case it is in general not possible to obtain scaled, but otherwise error-free demodulated
signals from m̂i (t) and m̂q (t). Thus, the preferred way for (digital) signal processing in radio
receivers is to use complex-valued lowpass signals for as long as possible and to convert to
real-valued signals only after all other necessary processing has been done.
7
Written out explicitly, the general form of a AM-DSB-TC signal is
x(t) = Ac 1 + αmn (t) cos(2πfc t + θc ) = Ac cos(2πfc t + θc ) + Ac αmn (t) cos(2πfc t + θc ) ,
| {z } | {z }
carrier term AM-DSB-SC signal
where mn (t) is the normalized message signal, obtained from the lowpass filtered wideband
signal m(t) = LPF{mw (t)} as
m(t)
mn (t) = ,
maxt |m(t)|
and 0 ≤ α ≤ 1 is the modulation index (often expressed in percent as 100α%). Comparing
this with AM-DSB-SC, the only difference is that instead of using m(t) (or mn (t)) directly,
the offset version 1 + αmn (t) is used to modulate the carrier amplitude. The following figure
shows the AM-DSB-TC (upper graph) and the AM-DSB-SC (lower graph) signals that result
from a sinusoidal message signal m(t). The modulation index for the AM-DSB-TC signal is
α = 0.7
AM−DSB−TC, m(t)=sin(2πf1t), f1=100 Hz, fc=2000 Hz, α=0.7
2
1
xTC(t)
−1
−2
0 0.005 0.01 0.015 0.02 0.025 0.03
1
xSC(t)
−1
−2
0 0.005 0.01 0.015 0.02 0.025 0.03
t [sec]
Note that the carrier (blue line) never changes phase in the AM-DSB-TC case since the
message signal (red dashed line) is never negative due to the dc offset (green line at +1). For
the AM-DSB-SC signal, however, the phase of the carrier (blue line) changes by 180◦ when
the message signal (red dashed line) becomes negative because it has no dc offset (green line
at 0). Thus, in contrast to AM-DSB-SC, an AM-DSB-TC signal can be demodulated using
an envelope detector which only looks at the magnitude of the peaks of the received signal
which are independent of changes in phase and frequency of the carrier signal.
8
In the frequency domain the AM-DSB-TC and the AM-DSB-SC signals for a sinusoidal
message signal m(t) = sin(2πf1 t), f1 = 100 Hz, look as follows.
0.5
0.4
XTC(f)
0.3
0.2
0.1
0
−3000 −2000 −1000 0 1000 2000 3000
0.5
0.4
XSC(f)
0.3
0.2
0.1
0
−3000 −2000 −1000 0 1000 2000 3000
f [Hz]
Note that in the AM-DSB-TC case the carrier has always at least twice the amplitude of
the sidebands. Since the carrier itself is unmodulated, only the sidebands carry information,
and the efficiency η of AM-DSB-TC is therefore
where
Z τ /2 Z τ /2
1 1
<y(t)> = lim y(t) dt , and thus <m2n (t)> = lim m2n (t) dt ,
τ →∞ τ −τ /2 τ →∞ τ −τ /2
which is (typically much) less than the η = 100% value which is achieved by AM-DSB-SC.
9
The quantity ρ(t), which is non-negative by convention, is called the envelope of x(t) and
θ(t) is called the phase of x(t). The following figure shows the envelopes (bold red line) and
the phases (green line) of a AM-DSB-TC (upper graphs) and a AM-DSB-SC (lower graphs)
signal when m(t) is a sinusoid.
−1
−2
0 0.005 0.01 0.015 0.02 0.025 0.03
200
100
θTC(t) [deg]
−100
−200
0 0.005 0.01 0.015 0.02 0.025 0.03
−1
−2
0 0.005 0.01 0.015 0.02 0.025 0.03
200
100
θSC(t) [deg]
−100
−200
0 0.005 0.01 0.015 0.02 0.025 0.03
t [sec]
Quite clearly the envelope of the AM-DSB-TC signal has the same shape as m(t), whereas the
envelope of the AM-DSB-SC signal is the absolute value |m(t)| of m(t). For the AM-DSB-TC
signal the phase is constant for all t, whereas for the AM-DSB-SC signal the phase jumps
by ±180◦ for those t where m(t) < 0. Thus, demodulation of a AM-DSB-SC signal requires
both ρ(t) and θ(t), but a received AM-DSB-TC signal r(t) can be demodulated based on the
envelope of r(t) alone, without the need to synchronize to the phase (and precise frequency)
of the carrier of r(t). A receiver which does that is called a non-coherent receiver, whereas a
receiver that needs to be precisely synchronized with the carrier oscillator at the transmitter
is called a coherent receiver.
10
The following block diagram of a non-coherent “squaring receiver” for AM-DSB-TC is
more complicated than the circuit that is actually used in most standard AM receivers, but
it makes it very easy to show analytically why AM-DSB-TC does not need a phase (and
frequency) synchronized circuit for demodulation.
Assume that the received signal is r(t) = γx(t), where γ is the attenuation factor of the
transmission channel. Then, referring to the notation in the above block diagram,
2
v(t) = r2 (t) = γ 2 A2c 1+αmn (t) cos2 (2πfc t + θc )
γ 2 A2c 2
= 1+αmn (t) 1 + cos(4πfc t + 2θc ) .
2
The LPF is designed to remove the AM signal at twice the carrier frequency, while passing
(1 + αmn (t))2 unchanged, so that
γ 2 A2c 2
w(t) = 1 + αmn (t) .
2
Therefore, after taking the (positive) square root, the envelope of r(t) is obtained as
γAc γAc
ρ(t) = √ 1 + αmn (t) = √ 1 + αmn (t) .
2 2
The second equality follows from the fact that (1 + αmn (t)) ≥ 0 if 0 ≤ α ≤ 1. Finally,
removing the dc component from ρ(t) yields the estimate
γαAc
m̂(t) = √ mn (t) ,
2
of the transmitted message signal. In the absence of noise and channel distortion, this is an
exact (but scaled) copy of the original message signal m(t), independent of the exact value
of fc and independent of any knowledge of the phase θc of the carrier signal.
Using standard trigonometric identities, a sinusoidal signal r(t) with envelope ρ(t) ≥ 0,
carrier frequency fc , and phase θ(t) can be expressed as
r(t) = ρ(t) cos 2πfc t + θ(t) = ρ(t) cos θ(t) cos(2πfc t) − ρ(t) sin θ(t) sin(2πfc t) .
| {z } | {z }
= wi (t) = wq (t)
From this one easily obtains
q w (t)
q
ρ(t) = wi2 (t) + wq2 (t) , and θ(t) = tan−1 .
wi (t)
11
The equation for ρ(t) leads to another, more sophisticated receiver for AM-DSB-TC, the I-Q
envelope detector (or I-Q absolute value detector) shown in the following block diagram.
r(t) q ρ̂(t)
• 2 cos(2πfc t) wi2 (t) + wq2 (t)
−2 sin(2πfc t)
Similarly, the equation for θ(t) leads to the block diagram of a I-Q phase detector as
shown next.
−2 sin(2πfc t)
Finally, the (equivalent) circuit that is used in most AM receivers is the “absolute value
receiver” shown below.
12
1.7 AM-SSB-SC and AM-VSB-SC
One of the disadvantages of AM-DSB-SC is that it occupies twice the bandwidth of the
original message signal. One straightforward way to reduce the bandwidth to the original
value is to only keep one of the sidebands of the AM signal and suppress the other one. The
resulting AM signals are known as AM-SSB-LSB (amplitude modulation, single sideband,
lower sideband) and as AM-SSB-USB (amplitude modulation, single sideband, upper side-
band) depending on whether the lower or upper sideband is kept. To convert AM-DSB-SC
to AM-SSB-SC (either LSB or USB), the AM-DSB-SC signal can be filtered with a bandpass
filter (BPF) as shown in the following block diagram.
Ac cos(2πfc t + θc )
Carrier Oscillator
For AM-SSB-USB, for example, the transmitter filter HBx (f ) is chosen as shown in the
following figure.
f
−fc −fm −fc −fc +fm 0 fc −fm fc fc +fm
A problem with this filter are the sharp cutoffs needed near fc , especially if m(t) has a dc
component (which is the case for analog TV broadcast signals, for instance). To alleviate
this problem, vestigial sideband (VSB) modulation can be used. This is essentially a
compromise between AM-DSB and AM-SSB, with a well controlled (usually linear) overall
transition from the passband of HB (f ) to the stopband near fc , extending over a range of
2∆ around fc . Depending on whether the lower or upper sideband is kept, the resulting
AM signal is either called AM-VSB-LSB (amplitude modulation, vestigial sideband, lower
sideband) or AM-VSB-USB (amplitude modulation, vestigial sideband, upper sideband).
An example of a filter HB (f ) that converts a AM-DSB-SC signal to a AM-VSB-USB-SC
signal is shown in the following figure.
f
−fc −fm −fc −fc +fm 0 fc −fm fc fc +fm
−fc −∆ −fc +∆ fc −∆ fc +∆
13
Demodulation of AM-SSB-SC signals and AM-VSB-SC signals is done in a similar fash-
ion as for AM-DSB-SC by multiplying the received signal with the local oscillator signal
2 cos(2πfc t + θc ), followed by lowpass filtering at fm . To remove noise and/or interference
from the unused (portion of the) sideband, a BPF should be used at the input of the receiver,
as shown in the following blockdiagram.
2 cos(2πfc t + θc )
Local Oscillator
For AM-SSB-SC the same BPF can be used for both the transmitter and the receiver. For
AM-VSB-SC the product HBx (f )HBr (f ) of the frequency responses of the BPFs at the
transmitter and receiver must be equal to HB (f ) as shown above.
HL (f )
1 0≤α≤1
sin(2πfL t) sin(2παfL t)
hL (t) = ⇐⇒
πt 2παfL t
f
−(1+α)fL 0 (1+α)fL
−(1−α)fL (1−α)fL
By making use of the frequency shift property of the FT, this LPF can be converted to a
BPF hBP (t) ⇔ HBP (f ) which is symmetric about some center frequency fc ≥ (1 + α) fL
(where α = 0 for an ideal LPF) by
BPFs that are obtained from ideal LPFs (i.e., α → 0) are well suited for picking out one
particular signal from several FDM (frequency division multiplexed) signals, or for generating
SSB (single sideband) AM signals from DSB AM signals. BPFs that are obtained from LPFs
with trapezoidal frequency response can be used for similar tasks, but in addition they can
also be used to convert frequency to amplitude (in the transition region of the BPF) and to
generate VSB (vestigial sideband) AM signals.
14
1.9 Frequency Division Multiplexing
Multiplexing is key to using communication system resources efficiently and share them
among many users. Time division multiplexing (TDM) assigns different time slots to different
users. Frequency division multiplexing (FDM) uses the equivalent approach in the
frequency domain by allocating different frequency bands to different users.
100 km 1 km 10 m 10 cm 1 mm
Microwaves
1.10 Mixers
A mixer is a device that has two inputs which are multiplied together to obtain one output
which contains the convolution of the spectra of the input signals. If one of the inputs is
a sinusoid produced by a local oscillator, then the output consists of the input spectrum
shifted by the local oscillator frequency fx to the left and to the right. Usually only one of
the shifted spectra is desired and thus a mixer is normally followed by a BPF (or sometimes
an LPF), as shown in the following block diagram.
15
s1 (t) x(t) s2 (t)
× BPF
2 cos(2πfx t)
If s1 (t) is an AM signal of the form s1 (t) = v(t) cos(2πfc1 t), where v(t) could either be directly
a message signal for AM-DSB-SC, or a normalized message signal plus a dc-component for
AM-DSB-TC, then one easily finds that
Thus, the two logical choices for the center frequency of the BPF are either fc2 = fc1 + fx or
fc2 = |fc1 − fx |. Note that both fx ≤ fc1 and fx > fc1 are possible. In either case, the output
is s2 (t) = v(t) cos(2πfc2 t), i.e., it is another AM signal with new carrier frequency fc2 . This
is a feature that is used extensively in transmitters to produce a signal, e.g., using digital
signal processing (DSP), at lower frequencies and then move it up to the actual transmit
frequency which may be in the GHz range. Receivers then use the same feature in the
opposite way to bring a signal down from the actual transmit frequency to a (much) lower
frequency range where DSP can be used.
where fe is the frequency error and θe is the phase error between the transmitter and the
receiver. To obtain (an estimate of) the error signal ψ(t) = 2πfe t + θe from r(t), start from
squaring r(t) to obtain
γ 2 A2c m2 (t)
r2 (t) = γ 2 A2c m2 (t) cos2 2π(fc + fe )t + θe = 1 + cos 4π(fc + fe )t + 2θe .
2
Multiplying this by 2 cos(4πfc t) yields
vi (t) = γ 2 A2c m2 (t) 1 + cos 4π(fc + fe )t + 2θe cos 4πfc t
= A(t) 2 cos 4πfc t + cos(4πfe t + 2θe ) + cos 4π(2fc + fe )t + 2θe ,
where A(t) = γ 2 A2c m2 (t)/2 is a time-varying amplitude. Simlarly, multiplying by -2 sin 4πfc t
results in
vq (t) = −γ 2 A2c m2 (t) 1 + cos 4π(fc + fe )t + 2θe sin 4πfc t
= A(t) − 2 sin 4πfc t + sin(4πfe t + 2θe ) − sin 4π(2fc + fe )t + 2θe .
16
Thus, after lowpass filtering with 2fe < fL < fc ,
Finally, the error estimate ψ(t) is obtained by taking an inverse tangent and dividing by 2
as follows w (t)
1 q
ψ(t) = tan−1 .
2 wi (t)
This whole process is shown in blockdiagram form in the next figure.
−2 sin 4πfc t
Note that, before the division by 2 to obtain ψ(t), it is crucial that the phase (which is
only resolved modulo 2π by the inverse tangent) is unwrapped. To demodulate the received
AM-DSB-SC signal r(t), the local oscillator term 2 cos(2πfc t + ψ(t)) is then used instead of
the 2 cos(2πfc t + θc ) term shown in an earlier blockdiagram.
2 Lab Experiments
E1. AM Transmitter/Receiver. (a) FIR LPF/BPF with Trapezoidal H(f ). Modify
your trapfilt function in the filtfun module so that it can be used as either a lowpass or
a bandpass filter with trapezoidal frequency response. The header of the extended function
is shown below.
17
def trapfilt(sig_xt, fparms, k, alfa):
"""
Delay compensated FIR LPF/BPF filter with trapezoidal
frequency response.
>>>>> sig_yt, n = trapfilt(sig_xt, fparms, k, alfa) <<<<<
where sig_yt: waveform from class sigWave
sig_yt.signal(): filter output y(t), samp rate Fs
n: filter order
sig_xt: waveform from class sigWave
sig_xt.signal(): filter input x(t), samp rate Fs
sig_xt.get_Fs(): sampling rate for x(t), y(t)
fparms = fL for LPF
fL: LPF cutoff frequency (-6 dB) in Hz
fparms = [fBW, fc] for BPF
fBW: BPF -6dB bandwidth in Hz
fc: BPF center frequency in Hz
k: h(t) is truncated to
|t| <= k/(2*fL) for LPF
|t| <= k/fBW for BPF
alfa: frequency rolloff parameter, linear
rolloff over range
(1-alfa)fL <= |f| <= (1+alfa)fL for LPF
(1-alfa)fBW/2 <= |f| <= (1+alfa)fBW/2 for BPF
"""
To test your modified trapfilt function, estimate the parameters of the BPF whose fre-
quency response is shown below and recreate h(t) ⇔ H(f ) with your trapfilt function.
18
FT Approximation , Fs=44100 Hz, N=44100, ∆f=1 Hz
1.4
1.2
|X(f)| 0.8
0.6
0.4
0.2
0
0 2000 4000 6000 8000 10000 12000 14000 16000
200
100
∠X(f) [deg]
−100
−200
0 2000 4000 6000 8000 10000 12000 14000 16000
f [Hz]
(b) Start a new Python module, called amfun.py, and write a function, called amxmtr which
performs the tasks of an AM transmitter to produce AM-DSB-SC, AM-DSB-TC, AM-SSB,
and AM-VSB signals for a real-valued (wideband) message signal m(t). This function uses
the extended trapfilt function to lowpass filter m(t) to fm and to bandpass filter the AM
signal x(t). The header of amxmtr looks as follows:
19
def amxmtr(sig_mt, xtype, fcparms, fmparms=[], fBparms=[]):
"""
Amplitude Modulation Transmitter for suppressed (’sc’)
and transmitted (’tc’) carrier AM signals
>>>>> sig_xt = amxmtr(sig_mt, xtype, fcparms, fmparms, fBparms) <<<<<
where sig_xt: waveform from class sigWave
sig_xt.signal(): transmitted AM signal
sig_xt.timeAxis(): time axis for x(t)
sig_mt: waveform from class sigWave
sig_mt.signal(): modulating (wideband) message signal
sig_mt.timeAxis(): time axis for m(t)
xtype: ’sc’ or ’tc’ (suppressed or transmitted carrier)
fcparms = [fc, thetac] for ’sc’
fcparms = [fc, thetac, alfa] for ’tc’
fc: carrier frequency
thetac: carrier phase in deg (0: cos, -90: sin)
alfa: modulation index 0 <= alfa <= 1
fmparms = [fm, km, alfam] LPF at fm parameters
no LPF at fm if fmparms = []
fm: highest message frequency
km: LPF h(t) truncation to |t| <= km/(2*fm)
alfam: LPF at fm frequency rolloff parameter, linear
rolloff over range 2*alfam*fm
fBparms = [fBW, fcB, kB, alfaB] BPF at fcB parameters
no BPF if fBparms = []
fBW: -6 dB BW of BPF
fcB: center freq of BPF
kB: BPF h(t) truncation to |t| <= kB/fBW
alfaB: BPF frequency rolloff parameter, linear
rolloff over range alfaB*fBW
"""
Test your transmitter using the message signal sig_mt generated below as input.
20
Px =0.2469, Px (f1 , f2 ) = 0.1235, Fs = 44100 Hz, ∆ f = 1 Hz, NN = 1, N = 44100
0.07
0.06
0.05
PSD: Sx (f) 0.04
0.03
0.02
0.01
0.00
0 2000 4000 6000 8000 10000 12000 14000 16000 18000
f [Hz]
How does the PSD change if you use the same parameters as above, except for setting
xtype=’tc’ and alfa=0.7?
(c) Use the speech signal in speech701.wav and the music signal in music701.wav to gen-
erate AM-DSB-SC signals x1 (t) and x2 (t), respectively, with fc = 8000 Hz, fm = 4000 Hz,
km ≈ 10 . . . 20, and αm = 0.05. Use θc = −90◦ for the speech signal and θc = 0◦ for the
music signal. Adjust the carrier amplitude Ac2 of x2 (t) (modulated with the music signal)
such that the average powers P (x1 (t)) and P (x2 (t)) of the AM-DSB-SC
√ signals are approx-
imately equal. Create a third signal x3 (t) = (x1 (t) + x2 (t))/ 2. Save the three signals in
myam701.wav, myam702.wav, and myam703.wav, respectively, for later use. Display the PSDs
of each of the three signals and compare them. Does the bandwidth for x3 (t), which contains
two message signals, change? Display also the PSDs of the squared AM signals x21 (t), x22 (t),
and x23 (t) and analyze them in the vcinity of 2fc (zoom-in to a range of approximately 15900
to 16100 Hz). Is there any useful information that you can get from the squared signals? If
so, what is this information and for which of the three signals is it actually present?
(d) For the Python module amfun.py, write a function called amrcvr that demodulates a
received AM signal r(t) and produces an estimate m̂(t) of the transmitted message m(t).
Here is the header for this function
21
def amrcvr(sig_rt, rtype, fcparms, fmparms=[], fBparms=[], dcblock=False):
"""
Amplitude Modulation Receiver for coherent (’coh’) reception,
or absolute value (’abs’), or squaring (’sqr’) demodulation,
or I-Q envelope (’iqabs’) detection, or I-Q phase (’iqangle’)
detection.
>>>>> sig_mthat = amrcvr(sig_rt, rtype, fcparms, fmparms,
fBparms, dcblock) <<<<<
where sig_mthat: waveform from class sigWave
sig_mthat.signal(): demodulated message signal
sig_mthat.timeAxis(): time axis mhat(t)
sig_rt: waveform from class sigWave
sig_rt.signal(): received AM signal
sig_rt.timeAxis(): time axis for r(t)
rtype: Receiver type from list
’abs’ (absolute value envelope detector),
’coh’ (coherent),
’iqangle’ (I-Q rcvr, angle or phase),
’iqabs’ (I-Q rcvr, absolute value or envelope),
’sqr’ (squaring envelope detector)
fcparms = [fc, thetac]
fc: carrier frequency
thetac: carrier phase in deg (0: cos, -90: sin)
fmparms = [fm, km, alfam] LPF at fm parameters
no LPF at fm if fmparms = []
fm: highest message frequency
km: LPF h(t) truncation to |t| <= km/(2*fm)
alfam: LPF at fm frequency rolloff parameter, linear
rolloff over range 2*alfam*fm
fBparms = [fBW, fcB, kB, alfaB] BPF at fcB parameters
no BPF if fBparms = []
fBW: -6 dB BW of BPF
fcB: center freq of BPF
kB: BPF h(t) truncation to |t| <= kB/fBW
alfaB: BPF frequency rolloff parameter, linear
rolloff over range alfaB*fBW
dcblock: remove dc component from mthat if true
"""
Test your receiver with the AM-DSB-SC signals that you produced in part (c). Use the same
fm , km and αm as for the transmitter. Can you recover the speech and music signals from
x3 (t) without any interference between the two signals?
(e) Analyze and, if possible, demodulate the AM signals in the wav-files amsig701.wav,
amsig702.wav, amsig703.wav, and amsig704.wav. Look at the signals in the frequency
domain and listen to the demodulated signals (make a wav file in Python and then use a
music player for listening). Try different demodulation methods (coherent, non-coherent,
22
I-Q envelope detection, etc). Interpret the graphs and the different demodulation methods
and relate your findings to how the demodulated signals sound.
(f ) Repeat (e) for the AM signals in the wav-files amsig705.wav, amsig706.wav, and
amsig707.wav.
(g) Real-valued AM demodulator for AM-DSB-SC signals in GNU Radio. Build
the GNU Radio flowgraph shown below to demodulate the two AM-DSB-SC signals in the
file AMsignal_002.bin. The file was recorded using a sampling rate of 512 kHz and each
sample is a 32-bit (real) floating point number.
The nominal carrier frequencies of the two signals are fc1 = 124 kHz and fc2 = 144 kHz, but
the transmitters were off a little bit (within ±10 Hz) from the nominal values. The receiver
attempts to demodulate the signals with the nominal carrier frequency values, followed by
fine tuning in the range from -10 to +10 Hz. The goal of this experiment is to find out how
successful that strategy is when working with real-valued signal processing and to discuss
its advantages and shortcomings.
then we obtain a filter with conplex-valued filter coefficients that can be used for such things
as generating AM-SSB and AM-VSB signals at baseband. The header of this complex-valued
version of trapfilt, called trapfilt_cc, is shown below.
23
def trapfilt_cc(sig_xt, fparms, k, alfa):
"""
Delay compensated FIR LPF/BPF filter with trapezoidal
frequency response, complex-valued input/output and
complex-valued filter coefficients.
>>>>> sig_yt, n = trapfilt_cc(sig_xt, fparms, k, alfa) <<<<<
where sig_yt: waveform from class sigWave
sig_yt.signal(): complex filter output y(t), samp rate Fs
n: filter order
sig_xt: waveform from class sigWave
sig_xt.signal(): complex filter input x(t), samp rate Fs
sig_xt.get_Fs(): sampling rate for x(t), y(t)
fparms = fL for LPF
fL: LPF cutoff frequency (-6 dB) in Hz
fparms = [fBW, fBc] for BPF
fBW: BPF -6dB bandwidth in Hz
fBc: BPF center frequency (pos/neg) in Hz
k: h(t) is truncated to
|t| <= k/(2*fL) for LPF
|t| <= k/fBW for BPF
alfa: frequency rolloff parameter, linear
rolloff over range
(1-alfa)*fL <= |f| <= (1+alfa)*fL for LPF
(1-alfa)*fBW/2 <= |f| <= (1+alfa)*fBW/2 for BPF
"""
Test your trapfilt_cc function by recreating the filter with h(t) ⇔ H(f ) shown below. In
your solution include a time domain plot (real and imaginary part) of h(t).
24
2.5
FT Approximation, Fs = 44100 Hz, N=44100, ∆ f =1.00 Hz
2.0
1.5
X ( f) |
1.0
|
0.5
0.0
−3000 −2000 −1000 0 1000 2000 3000
200
150
100
arg[X(f)] [deg]
50
0
−50
−100
−150
−200
−3000 −2000 −1000 0 1000 2000 3000
f [Hz]
(b) Complex-Valued QAM Modulator. In the Python module amfun add the function
qamxmtr, whose header is shown below, for QAM modulation of complex-valued message
signals (of the form m(t) = mi (t) + j mq (t)).
25
Test your qamxmtr function by recreating the myam703.wav QAM signal described in E1c. To
test both qamxmtr and trapfilt_cc, use the speech701.wav signal to generate a AM-SSB-
LSB signal with bandwidth ≈ 4000 Hz using complex-valued lowpass signal processing fol-
lowed by QAM modulation at fc = 8000 Hz and θc = 0◦ . Save this signal in myam701ssb.wav
for later use.
(c) The counterpart to the qamxmtr function is the QAM receiver function qamrcvr which
uses complex-valued signal processing. Add this function whose header is shown below to
the amfun module.
Test your receiver with the signals that you produced in part (b) and in E1c. What happens
if you remove one of the sidebands of an AM-DSB-SC signal, frequency shift the resulting
(complex-valued) baseband signal, e.g., by 100 Hz, then take the real part and listen to it?
(d) Look at the AM signals in E1e and E1f (amsig701.wav. . .amsig707.wav again. Can
you improve the quality of any of the demodulated signals using complex lowpass signal
processing operations, e.g., by removing one of the sidebands?
(e) Complex-valued AM demodulator for AM-DSB-SC signals in GNU Radio.
Build the GNU Radio flowgraph shown below to demodulate the two AM-DSB-SC signals
in the file AMsignal_002.bin. The file was recorded using a sampling rate of 512 kHz and
each sample is a 32-bit (real) floating point number.
26
The nominal carrier frequencies of the two signals are fc1 = 124 kHz and fc2 = 144 kHz, but
the transmitters were off a little bit (within ±10 Hz) from the nominal values. The receiver
attempts to demodulate the signals with the nominal carrier frequency values, followed by
fine tuning in the range from -10 to +10 Hz. The goal of this experiment is to find out
how successful that strategy is when working with complex-valued signal processing and to
discuss its advantages and shortcomings. Compare also to E1g.
(f ) The file AMsignal_005.bin is a binary file that contains the I and Q components of
several radio signals in the frequency range from 0 to 120 kHz. The sampling rate of the file
is Fs = 240 kHz and the bandwidth allowed for each station is 10 kHz. Use this file as input
from a File Source in the GNU Radio Companion (GRC). Build a flowgraph in the GRC for
tuning to and demodulating AM-DSB-SC and, more generally QAM signals (i.e., the sum
of two AM-DSB-SC signals at the same carrier frequency, one with a cosine and one with a
sine carrier). Find all radio signals in AMsignal_005.bin and characterize their properties,
such as fc , θc , AM-DSB vs QAM, stability of fc , interference between different stations, etc.
Try to demodulate the signals as cleanly as possible. Here is an example of a flowgraph that
can be used to analyze the different signals.
27
Note that some parameters are left blank and you have to decide (and make the case) for the
best (or at least a good) choice. In the QT GUI Sink consider looking at the Constellation
Display in addition to the Frequency and Time Domain Displays to distinguish between
AM-DSB and QAM signals (why?).
2000–2020,
c P. Mathys. Last revised: 3-04-20, PM.
28