Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

ECE 5625 Spring 2012 Project 1 Multicarrier SSB Transceiver: Atlab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

ECE 5625 Spring 2012 Project 1

Multicarrier SSB Transceiver


1 Introduction
In this team project you will be implementing the Weaver SSB modulator as part of a multicarrier
transmission scheme. Coherent demodulation will be implemented for a single carrier that lies
between two adjacent carriers. Test message signals consisting of bandlimited noise will be used
to check crosstalk levels. Recorded speech waveforms will be used to provide a nal test of the
complete system after it has been turned in. The entire simulation will be constructed in MATLAB
m-code. A code framework will be provided along with interface requirements, so that the code
submitted with the report project can be easily tested using the speech waveform message signals.
The m-code functions are documented in Appendix A and the source code itself is on the course
web site as a ZIP le package.
Honor Code: The project teams will be limited to at most two members. Teams are to work
independent of one another. Bring questions about the project to me. I encourage you to work in
teams of two. Since each team member receives the same project grade, a group of two should
attempt to give each team member equal responsibility. The due date for the completed project
will be 12:00 pm, Friday, March 23, 2012.
2 System Description
A block diagram of the complete multicarrier single sideband system (SSB) is shown in Figure 1.
This is more of a conceptual block diagram, as the actual system that will be implemented will use
discrete-time signal processing. Specically the input message signals will be either bandlimited
white noise or speech waveforms, both at a sampling rate of 8 ksp/s (ksamples per second). Using
SSB we are able to pack three message signals very close to each other. This provides bandwidth
efciency for sending many message signals over a narrow band of frequencies. The frequency
plan shows that three W D 4 kHz message signals when SSB modulated can easily t a channel
spanning 16 to 32 kHz. Packing the signals right next to each other may not be the most desirable
since adjacent channel interference may occur. Placing a small guard band, say f , between each
channel may give improved performance.
Each of the SSBmodulator blocks will be implemented as a reusable function block in MATLAB.
The message signal input to each modulator is a signal sampled at 8 ksps. From basic sampling
theory, when we sample at f
s
samples per second, the usable lowpass bandwidth runs from 0
f
s
=2 Hz. If a continuous-time signal has bandwidth exceeding f
s
=2 Hz, aliasing will occur, effec-
tively folding spectral energy at frequencies greater than f
s
=2 back down into the 0f
s
=2 band.
In particular for f
s
D 8 ksps the usable signal bandwidth must be less than 4 kHz. Signals with
bandwidth exceeding 4 kHz will be aliased when sampled at 8 ksps. Telephony grade speech is
sampled at 8 ksps. Band limiting of a speech waveform must be done prior to sampling at 8 ksps to
avoid aliasing. The passband of telephone grade speech is about 300 3300 Hz, thus an antialising
lter can be designed to avoid aliasing when sampled at 8 kHz, yet avoid disturbing the 3003300
Hz signal spectrum.
SSB
Modulator
m
1
t ( )
USSB f
c1
SSB
Modulator
SSB
Modulator
USSB f
c2
USSB f
c3
m
2
t ( )
m
3
t ( )
BPF
Coherent SSB
Demodulator
m

j t ( )
Ideal Channel with
usable Bandwidth
from 16 32 kHz.
Each SSB channel
occupies ~4 kHz.
f (kHz)
16 32 0
m
1
m
2
m
3
Transmission Bandwidth
j 1 2 3 , , =
S
i
n
g
l
e
-
S
i
d
e
d
S
p
e
c
t
r
u
m
f
c1
f
c2
f
c3
x
c1
t ( )
x
c2
t ( )
x
c3
t ( )
x t ( ) x t ( )
y t ( )
Figure 1: Multicarrier SSB transmission system top level block diagram.
In the SSB modulators of Figure 1 the message signal is assumed to be sampled at 8 ksps. In
discrete-time form the message signal is denoted by the sequences m
j
n D m
j
.n=d
s
/, j D 1; 2; 3.
These discrete-time signals enter a bank of three SSB modulators, each of which processes its input
signal with lters and multiplications by reference sinusoids to produce nominally three upper
SSB (USSB) signals. The signal carrier frequencies are denoted f
c1
, f
c2
, and f
c3
. In order to
accommodate a useful range of carrier frequencies, yet still remain in the discrete-time domain,
the sampling rate is increased from 8 ksps up to 96 ksps, f
s1
D 8 ! f
s2
D 96, which corresponds
to an upsampling factor of L D 12. This factor was chosen to be convenient for use in this project.
A real system would likely consider a different value for L.
With the sampling rate increased to 96 ksps, the usable bandwidth, from sampling theory, is
now 096=2 D 48 kHz. In Figure 1 we further see that for the purposes of this project, the trans-
mission bandwidth or channel is dened to be 16 to 32 kHz. In practice this band of frequencies
could be located at any assignable frequency band. Note that the discrete-time signals might rst
be digital-to-analog converted and then frequency translated using analog mixing.
The received signal x.t /, which is composed of three adjacent USSB signals, is ready for
demodulation of just one of the message signals m
j
n, j D 1; 2; 3. In this project a coherent
demodulator is proposed as the means to recover an estimate of the transmitted message signal
(sequence). Acoherent demodulator needs a coherent reference, but we will assume for this project
that such a reference is available. It might be that one or more pilot signals are sent such that
through frequency mixing operations, following a nonlinearity, all three coherent carriers, f
c1
,
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 2
f
c2
, and f
c3
, can be obtained from the received signal.
The various lters, frequency mixing, and digital signal processing , will result in some crosstalk
between the three adjacent channels, as well as undesired band limiting of the desired signal. The
Project Tasks section of this project description document, will detail measurements to assess some
of these distortions.
The top level simulation le, which implements all of Figure 1 is contained in the m-le
SSB_transceiver.m and is listed below. The functions weaver() and SSB_demod() will be
written by each project team.
function m_recovered = SSB_transceiver(fc,message_type,demod_channel)
% m_recovered = SSB_transceiver(fc,message_type,demod_channel)
%
%=============== Inputs ======================
% fc = Carrier frequencies in Hz of signal to be demodulated
% message_type = String value either noise or speech; the speech input
% requires that that the .wav files be present.
% demod_channel = An integer, 1, 2, or 3, to specify which message channel
% will be demodulated and output from the function
%
%=============== Outputs =====================
% m_recovered = The recovered modulation downsampled to 8 ksps
%
% Mark Wickert, March 2007
L = 12; % Upsampling factor
fs = 8000; % sampling rate = 8000 Hz
%////////////// BEGIN TRANSMITTER ////////////////////////////
% Create transmitter message signals from either bandlimited white noise or
% from available sampled speech test vectors
switch lower(message_type)
case noise
% Design a 9th-order bandpass noise shaping filter with 3 dB
% cutoffs at 300 & 3300 Hz relative to a 8000 Hz sampling rate.
[bn,an] = butter(9,2*([300 3300]/8000));
% Create 3 zero mean noise vectors
m1 = randn(1,100000);
m2 = randn(1,100000);
m3 = randn(1,100000);
% Filter the noise vectors.
m1 = filter(bn,an,m1);
m2 = filter(bn,an,m2);
m3 = filter(bn,an,m3);
case speech
N = 100000;
m1 = wavread(OSR_uk_000_0050_8k.wav,[1,N]);
m1 = m1; %transpose to row vector
m2 = wavread(OSR_us_000_0018_8k.wav,[1,N]);
m2 = m2; %transpose to row vector
m3 = wavread(OSR_us_000_0030_8k.wav,[1,N]);
m3 = m3; %transpose to row vector
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 3
2.1 SSB Modulator Design
otherwise
error(Valid message_type must be noise or speech)
end
% Input message vectors into SSB modulators
xc1 = weaver(m1,fs/2,fc(1),fs,L,upper);
xc2 = weaver(m2,fs/2,fc(2),fs,L,upper);
xc3 = weaver(m3,fs/2,fc(3),fs,L,upper);
% Form the composite signal
x = xc1 + xc2 + xc3;
%x = xc1 + xc3;
%x = xc2;
clear(xc1, xc2, xc3)
%/////////////////// END Transmitter ///////////////////////////
% Channel bandlimits signal to 16 - 32 kHz bandwidth
% The sampling rate is L*fs = 48 kHz
% It is the respnsibility of the receiver to downsample the signal back to
% the fs rate
[b_chan,a_chan] = butter(7, 2*[16000 32000]/(L*fs));
x = filter(b_chan,a_chan,x);
%/////////////////// BEGIN RECEIVER ////////////////////////////
m_recovered = SSB_demod(x,fc(demod_channel),L*fs,fs);
%/////////////////// END RECEIVER //////////////////////////////
Since digital signal processing is not a prerequisite for this course, some details on how to
implement the needed SSB modulator (weaver) and demodulator (SSB_demod) is now provided.
2.1 SSB Modulator Design
A continuous-time version of Weavers SSB modulator is shown in Figure 2 [1]. For this project
you will be implementing the modulator in the discrete-time domain , i.e., using digital signal
processing (DSP) techniques. A hardware implementation of Weavers modulator, that employs
multirate DSP techniques, can be found in [2]. The Palmero implementation serves as the moti-
vation for the discrete-time version of Figure 2 shown in Figure 3. Note that all signals have been
replaced by discrete-time signals or sequences. If you are unfamiliar with DSP notation and math,
guidance will be provided as the design approach unfolds. First of all notice that the rst pair of
cos/sin signal generators have the continuous variable t replaced by the time index variable over the
sampling rate n=f
s1
. This is a natural substitution, as periodic sampling of the time axis (consider
analog-to-digital conversion) means that we sample the analog signal m.t / at T
s
D 1=f
s
second
intervals, that is m
j
n D m
j
.nT
s
/ D m
j
.n=f
s
/, etc., with time index n being the discrete-time
time axis equivalent.
The implementation of discrete-time (digital) lters can be kept at a rather abstract level by just
thinking of the lters as having a transfer function that is a ratio of polynomials in the z-domain.
The z-domain is the discrete-time equivalent of the familiar s-domain. Consider an analog lowpass
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 4
2.1 SSB Modulator Design
Ideal
LPF
B = W/2
Ideal
LPF
B = W/2
m t ! " x
c
t ! "
2 2!
W
2
!!!!!
" #
$ %
t cos
2! f
c
W
2
!!!!! #
" #
$ %
t cos
+
+_
90 " $ 90 " $
Figure 2: Weaver SSB modulator as an analog signal processing function.
or bandpass lter has transfer function
H.s/ D
c
0
Cc
1
s Cc
2
s
2
C Cc
M
s
M
d
0
Cd
1
s Cd
2
s
2
C Cd
N
s
N
: (1)
A study of digital signal processing, in particular digital lter design, reveals that analog lter pro-
totypes, e.g., Butterworth, Chebyshev, Elliptic, etc., can be converted to digital lter equivalents
with knowledge of the sampling rate, f
s
, and the analog lter coefcients fc
k
; d
k
g. The corre-
sponding digital lter in the discrete-time domain will havea transfer function in the z-domain
given by
H.z/ D
b
0
Cb
1
z
1
Cb
2
z
2
C Cb
M
z
M
a
0
Ca
1
z
1
Ca
2
z
2
C Ca
N
z
N
(2)
A z-domain expression results by taking the z-transform of a discrete-time sequence, much like an
s-domain expression results by taking the Laplace transform of a continuous-time signal. A course
in DSP is needed to obtain the details. The new ECE 2610 course serves as the starting point for
this study. The signicance of having z-domain lter coefcients is that we can implement the
lter as an algorithm of the form
yn D
N
X
kD1
a
k
yn k C
M
X
kD0
b
k
xn k; (3)
assuming we have normalized the denominator coefcients so that a
0
D 1. Note that (3) is known
as a linear constant coefcient difference equation (LCCDE).
The MATLAB signal processing toolbox has a collection of functions for designing digital l-
ters. For our purposes the output of a particular digital lter design is simply a pair of coefcient
vectors (b,a). The MATLAB GUI tool fdatool (launched by typing fdatool at the command
prompt) can be useful in designing lters and placing a and b coefcient vectors into the MATLAB
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 5
2.1 SSB Modulator Design
Lowpass
Digital
B = W/2
Lowpass
Digital
B = W/2
m n [ ] x
c
n [ ]
2 2!
W
2
-----
" #
$ %
n
f
s1
------ cos
2! f
c
W
2
-----
" #
$ %
n
f
s2
------ cos
+
+_
Interpolate
12 LPF
Interpolate
12 LPF
2 2!
W
2
-----
" #
$ %
n
f
s1
------ sin
2! f
c
W
2
-----
" #
$ %
n
f
s2
------ sin
Sampling Rate f
s2
96 kHz = = Sampling Rate f
s1
8 kHz = =
Figure 3: Weaver SSB modulator discrete-time implementation.
workspace. This may be useful for some design teams more comfortable with DSP. For the pur-
poses of this project however, it is sufcient to obtain all of your needed lter designs, both lowpass
and bandpass, from the Butterworth family.
2.1.1 Butterworth Filter Design
Butterworth digital lters can be designed from MATLABs command prompt using the function
butter() (for more information type help butter). Suppose we desire a 5th-order lowpass
lter with cutoff frequency of 2 kHz and f
s
D 8 ksps. This can be synthesized at the MATLAB
command prompt as follows:
>> n = 5; % filter order
>> fc = 2000; % cutoff frequency in Hz
>> fs = 8000; % sampling frequency in Hz
>> [b,a] = butter(n,2*(fc/fs));
The lter coefcients are returned in the vector variables b and a. If we wanted to characterize the
lter we just designed, we can use the function fvtool as follows:
>> fvtool(b,a,fs,8000); % scale the frequency axis to fs = 8000 Hz
The resulting plot, following vertical axis scaling using the cursors, is shown in Figure 4. The
fvtool window allows you to show a variety of frequency response format, e.g., magnitude in
dB, phase, group delay, pole-zero, etc. The cursors can be used to scale the plot to reasonable
dynamic range values, i.e., lter gains down to say only -80 to -60 dB. Without re-scaling the
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 6
2.1 SSB Modulator Design
display will show the lter gain down to -150 dB, which is beyond reason for any real hardware
implementation. Dont make plots like this. Note that MATLAB is uses double precision oating-
point arithmetic for all calculations by default.
x and y axis
scaling cursor
buttons
Figure 4: Studying lter characteristics using fvtool.
With a lter now designed, we can put it to work using the MATLAB filter() function, which
implements (3) for vector input/output. If we have a sequence of signal samples stored in the vector
m we can produce the ltered output m_filt via:
>> N = 10000; % Length of input vector
>> n = 0:N-1; % create a time index vector
>> m = cos(2*pi*1000/fs*n);
>> m_filt = filter(b,a,m);
If we need a bandpass lter, we can again use the butter function to obtain a and b coefcient
vectors. A bandpass design requires both a lower and upper cutoff frequency in its specication.
As an example, a lter having lower and upper cutoff frequencies of f
1
and f
2
respectively, is
created as follows:
>> % order 5, lower and upper cutoff at f1 and f2 relative to fs
>> [b_bpf, a_bpf] = butter(5, 2*[f1, f2]/fs);
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 7
2.2 SSB Coherent Demodulator with Downsampling
Note that you must make sure that f
1
and f
2
are well between 0 and f
s
=2 Hz. Recall again that
from lowpass sampling theory, the usable bandwidth lies between 0 and f
s
=2 Hz. For a bandpass
lter to make sense in a DSP system, the passband must be well inside this frequency range. For
example, 1632 kHz with respect to a 96 kHz sampling rate makes sense.
2.1.2 Upsampling and Interpolation
The Weaver modulator requires that we implement a sampling rate change from f
s1
D 8 kHz
to f
s2
D 96 kHz. Without getting into the DSP math details, this requires the cascade of an
upsampler with L D 12 followed by a lowpass interpolation lter. The upsample function inserts
L 1 zero samples between every input sample, and the lowpass lter interpolates signal sample
values to replace the zero sample values inserted by the upsampler. The bandwidth of the lowpass
interpolation lter should be the bandwidth of the signal being upsampled, in this case about 4
kHz. The MATLAB function interp(x,L) automatically implements both operations (type
help interp for more information). The discussion thus far should allow the SSB modulator
function to be constructed.
2.2 SSB Coherent Demodulator with Downsampling
Coherent demodulation of SSB is described in [3]. A DSP implementation follows this exact ap-
proach. The transmitter carrier frequency is generated from knowledge of the sampling frequency,
so a coherent demodulation reference can be generated in like fashion. A real receiver would not
have this knowledge, but as mentioned earlier, might be able to take advantage of a pilot signal
from which to derive a demodulation carrier reference.
One question you need to consider is whether or not you need to place a bandpass lter in
front of the coherent demodulator? Secondly, once the signal is demodulated, the sampling rate
can be reduced back to f
s1
D 8 kHz. The DSP function used for sampling rate reduction is known
as a decimator. A decimator is composed of a lowpass lter in cascade with a downsampler.
Downsampling by the factor M keeps every Mth sample of the input sequence. The M1 samples
in between are discarded. Since downsampling reduces the effective sampling rate, and we know
that the usable frequency band is always 0f
s
=2, the signal input to a downsampler must be strictly
bandlimited to .f
s
=2/=M Hz to insure that aliasing does not occur. When a signal sampled at
f
s2
D 96 kHz is down sampled by M D 12 to f
s1
D 8 kHz, the input signal to the decimator must
be lowpass ltered down to a nominal bandwidth of no more than W D .96000=2=12/ D 4000 Hz.
Recall that telephone grade audio only needs 3003300 Hz. Note that this is the same bandwidth
as required in the coherent demodulator, so the coherent demodulator and decimator can share
the same lowpass lter? The MATLAB function decimate() implements the functionality of the
lowpass lter and downsampler in a single function call, i.e.,
>> M = 12; % sampling rate reduction factor
>> y = decimate(x,M);
The MATLAB default decimation lowpass lter is a Chebyshev design. To discover the exact
implementation details type help decimate.
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 8
2.3 System Performance via Spectral Analysis
2.3 System Performance via Spectral Analysis
As you are building up your system it will be helpful to view signals in the frequency domain.
Since random signals are involved in the testing process, both the noise input the speech input, we
need to use the power spectral density (PSD) as opposed to just the Fourier transform of the signal.
Recall that Chapter 2 of [3] introduced the PSD as a tool for spectral analysis of deterministic and
random signals. The MATLAB function simpleSA() estimates the power spectrum of a random
signal (sequence). To demonstrate this function in action we will execute the full SSB transceiver
system using ltered noise as the message signals. The carrier frequencies have been chosen to be
20, 24, and 28 kHz. There are no guard bands between the channels with this conguration. An
in-class demonstration will demonstrate this conguration using the sample speech les available
in the project zip package. Figure 5 shows the PSD of bandlimited white noise entering the SSB
modulators. The sampling rate at this point is 8 ksps. Note that the bandpass shaping lter has
given the spectrum a passband running from 3003300 Hz as expected.
>> m_rec = SSB_transceiver([20000,24000,28000],noise,2);
49 x = xc2; % a breakpoint was set at line 49 in SSB_transceiver.m
K>> simpleSA(m2,2^10,fs,-60,5,b)
K>> axis([0 4000 -60 5])
K>> title(PSD of Band Limited White Noise Input to SSB Modulator)
K>> print -tiff -depsc mess.eps
K>> simpleSA(xc2,2^10,L*fs,-80,20,b)
K>> axis([10000 40000 -80 20])
K>> title(PSD of the f_c1 SSB Modulator Output (fs = 96 ksps))
K>> print -tiff -depsc fc1.eps
K>> simpleSA(xc1+xc2+xc3,2^10,L*fs,-80,20,b)
K>> axis([10000 40000 -80 20])
K>> title(PSD of the Composite SSB Modulator Output (fs = 96 ksps))
K>> print -tiff -depsc fc123.eps
In Figure 6 we see the spectrum of the SSB signal at f
c1
D 20 kHz. Notice that the spectrum
is far from perfect. The lters in the Weaver modulator, especially the upsampling operation from
8 ksps to 96 ksps, has introduced spectral images which are not completely removed by the default
interpolation lter of the function interp. The composite spectrum, as sent through the channel
is shown in Figure 7.
3 Project Tasks
1. Implement and test the SSB modulator function weaver using the function interface de-
scribed below. During normal operation, i.e., as exercised by SSB_transceiver, the input
sampling rate will be 8 ksps and the output sampling rate will be 96 ksps, i.e., L D 12.
function [y,fs2] = weaver(x,W,fc,fs,L,mode)
% [y,fs2] = weaver(x,W,fc,fs,L,mode)
%
%================== Inputs ======================
% x = Input message signal
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 9
0 500 1000 1500 2000 2500 3000 3500 4000
!60
!50
!40
!30
!20
!10
0
Frequency
P
o
w
e
r

S
p
e
c
t
r
u
m

M
a
g
n
i
t
u
d
e

(
d
B
)
PSD of Band Limited White Noise Input to SSB Modulator
300 3300
(Hz)
Figure 5: Spectra of ltered white noise representing a message signal spectrum.
% W = Bandwidth of first lowpass in Weaver mod;
% nominally 4000 Hz
% fc = Output carrier frequency in Hz
% fs = Input sampling rate (nominally 8000 Hz)
% L = Upsampling factor (nominally 12)
% mode = Select upper of lower SSB via upper or lower
%================== outputs =====================
% y = modulator output at sample rate L*fs
% fs2 = output sample rate in Hz
%
(a) Plot the PSD of the modulator output for a band limited noise input, with f
c
D 20 kHz.
The plot window should be scaled as in Figure 6.
(b) Comment on the performance of your modulator function.
(c) Provide a fully commented source code listing of this function in your report.
2. Implement a coherent SSB demodulator using the function interface described below.
function y_demod = SSB_demod(x,fc,fs_in,fs_out)
% y_demod = SSB_demod(x,fc,fs_in,fs_out)
%
%=============== Inputs ======================
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 10
1 1.5 2 2.5 3 3.5 4
x 10
4
!80
!70
!60
!50
!40
!30
!20
!10
0
10
20
Frequency
P
o
w
e
r

S
p
e
c
t
r
u
m

M
a
g
n
i
t
u
d
e

(
d
B
)
PSD of the f
c1
= 20 kHz SSB Modulator Output (fs = 96 ksps)
(Hz)
Desired Upper SSB signal
on a 20 kHz carrier
Lower SSB
leakage from
Weaver
modulator
Spectral images from
the upsampling operation
inside the Weaver
modulator
Figure 6: Spectra of f
c1
D 20 kHz SSB noise modulated carrier.
% x = Received signal input at sampling rate fs_in
% fc = Carrier frequency of signal to be demodulated
% fs_in = Sampling rate in samples per second of input signal
% fs_out = Sampling rate of output demodulated signal; it is assumed that
% fs_in/fs_out is an integer
%
%=============== Outputs =====================
% y_demod = Recovered modulation from the carrier based signal at fc;
% The sampling rate is fs_out (nominally 8 ksps)
%
(a) Test your modulator using just a single SSB carrier at 20 kHz (turn off the other carriers
in SSB_transceiver by letting x = xc1), plot the PSD of the recovered message
signal. Assume again that band limited noise is used for the input message. The plot
window should scaled similarly to Figure 5.
(b) Comment on the performance of your coherent demodulator.
(c) Provide a fully commented source code listing of this function in your report.
3. In this task all three carriers will be turned on. Choose any 4 kHz spacing you wish for the
carriers so long as they t within the channel bandwidth (the next task will allow you to
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 11
1 1.5 2 2.5 3 3.5 4
x 10
4
!80
!70
!60
!50
!40
!30
!20
!10
0
10
20
Frequency
P
o
w
e
r

S
p
e
c
t
r
u
m

M
a
g
n
i
t
u
d
e

(
d
B
)
PSD of the Composite SSB Modulator Output (fs = 96 ksps)
(Hz)
m
1
t ( ) on f
c1
m
2
t ( ) on f
c2
m
3
t ( ) on f
c3
Figure 7: Spectra of the composite SSB noise modulated carrier.
experiment with a guard band between the carriers). Band limited noise messages sources
will again be employed for testing.
(a) Obtain a composite signal spectrum plot similar to Figure 7 for your specic modulator
bank implementation. Make your axis scaling match that of Figure 7.
(b) Moving to the demodulator output measure the signal-to-interference ratio (SIR) in
dB via superposition of demodulated output signals. Set the demodulator to recover
the center carrier (this should be carrier number 2). With just the center carrier being
transmitted, i.e. set x = xc2, nd the power in the demodulator output as Psig =
var(m_rec). Next nd the interference power by setting the transmiiter output to be
x = xc1 + xc3 and nd the interference power to be Pinterfere = var(m_rec).
Now form the ratio
SIR
dB
D 10 log
10

P
sig
P
interfere

(4)
(c) Measure the SIR on one of the outside signals, e.g., f
c1
or f
c3
to see if there is less
interference present than when surrounded by two signals.
(d) Comment on your SIR measurement results.
4. Repeat Task 3, except now you are free to move the carrier frequencies to allow guard bands.
Note that the channel bandpass lter must be left intact, that is you may not change it.
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 12
Comment on any observed performance improvements obtained by including guard bands
between the carriers.
5. Returning once again to carrier frequencies at 20, 24, and 28 kHz, switch the modulator
inputs to the sample speech les provided in the zip package. With all three signals present at
the transmitter output (x = xc1 + xc2 + xc3), demodulate message signal m
2
n. Listen
to this signal using the PC sound system via sound(m_rec,8000).
(a) Listen carefully for any interference heard in the background of the desired message
signal. You may want to listen to all three speech les straight from the ZIP package
so that you know what they are supposed to sound like. Comment on what you hear.
(b) Calculate the SIR for demodulation of the center signal using the superposition tech-
nique of Task 3b.
6. Comment on your overall experience with this team project.
7. In addition to a project report, please package you completed simulation software into a ZIP
package and Email this package to me. I will be verifying your projects by listening to the
demodulated output of the speech les.
4 Appendix
The power spectral density of signals within the system model can be displayed using the supplied
function simpleSA.m. This function will work with either real or complex signals and has a
number of parameters to best plot signal power spectra. The function listing is given below:
function [Px,F] = simpleSA(x,N,fs,min_dB,max_dB,color)
% [Px,F] = simpleSA(x,N,fs,min_dB,max_dB,color)
% Plot the estimated power spectrum of real and complex baseband signals
% using the toolbox function psd(). This replaces the use of psd().
%
% x = complex baseband data record, at least N samples in length
% N = FFT length
% fs = Sampling frequency in Hz
% min_dB = floor of spectral plot in dB
% max_dB = ceiling of spectral plot in dB
% color = line color and type as a string, e.g., r or r--
%
%////////// Optional output variables ///////////////////////////////////
% Px = power spectrum estimate values on two-sided frequency axis
% F = the corresponding frequency axis values
%
% Mark Wickert, October 2008
% while length(x) < N
% N = N/2;
% end
warning off
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 13
if isreal(x)
[Px,F] = psd(x,N,fs);
else
[Px,F] = psd(x,[],[],N,fs);
N = fix(length(F)/2);
F = [F(end-N+1:end)-fs; F(1:N)];
Px = [Px(end-N+1:end); Px(1:N)];
end
warning on
if nargout == 2
return
end
if nargin == 3 || nargin == 5,
plot(F,10*log10(Px))
else
plot(F,10*log10(Px),color)
end
if nargin >= 5
axis([F(1) F(end) min_dB max_dB]);
end
xlabel(Frequency (Hz))
ylabel(Power Spectrum in dB)
grid on
Let us consider a sinusoid in noise followed by a lowpass lter. The signal input to the lter is
xn D Acos.2f
0
=f
s
n/ Cwn
where f
s
is the sampling frequency, f
0
< f
s
=2, and wn is white Gaussian noise. We design an
Elliptical lowpass lter using the MATLAB function
[b,a] = ellip(5,R_pass_dB,R_stop_dB,2*fcutoff/fs):
A good starting value for N is 1024. This places 1024 points in the power spectrum estimate. For
the estimate of the true spectrum to free of estimation noise averaging is needed the total number of
signal samples input to the function needs to exceed N by a factor of 10 or so. A higher resolution
spectral estimate can be obtained by increasing N, but at the expense of increased estimation error,
unless of course the number of signals samples is increased accordingly.
>> n = 0:100000;
>> fs = 20000;
>> x = 2*cos(2*pi*4000/fs*n) + 0.1*randn(size(n));
>> [b,a] = ellip(5,0.1,60,2*5000/fs);
>> y = filter(b,a,x);
>> simpleSA(y,2^10,fs,-90,30,b);
>> print -tiff -depsc test_PSD.eps
The results are shown below in Figure 8. We clearly see a spectral line at 4000 Hz and then
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 14
REFERENCES
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
80
60
40
20
0
20
Frequency (Hz)
P
o
w
e
r

S
p
e
c
t
r
u
m

i
n

d
B
Figure 8: Spectra of the composite SSB noise modulated carrier.
a noise background that has been shaped by the Elliptic lowpass lter. The noise level is at -20
dB due to the scale factor of 0.1 included in front of randn(). By default randn() produces unit
variance random numbers and scaling by 0.1 means the variance is reduced by 0:1
2
D 0:01. In dB
this is 10 log
10
.0:01/ D 20 dB.
References
[1] Donald K. Weaver, AThird Method of Generation and Detection of Single-Sideband Signals,
IRE Proceedings, 1956, pp. 1703-1705.
[2] Nico Palermo, A 9 MHz Digital SSB Modulator, available on the internet at
www.microtelecom.it/ssbdex/ssbdex-e.htm.
[3] R. Ziemer and W. Tranter, Principles of Communications, fth edition, John Wiley, 2002.
ECE 5/4625 Project 1: Multicarrier SSB Transceiver 15

You might also like