Matlab, Simulink Building A Direct Sequence Spread Spectrum Model
Matlab, Simulink Building A Direct Sequence Spread Spectrum Model
Data Communications
CE00036-3
Tutors: Dr Alison Griffiths & Amr El-HELW
Email: [email protected] [email protected]
Building a Dircet sequence spread spectrum Model
Introduction
A transmission technique in which a pseudo-noise code, independent of the information data,
is employed as a modulation waveform to “spread” the signal energy over a bandwidth much
greater than the signal information bandwidth. At the receiver the signal is “despread” using a
synchrpnized replica of the pseudo- noise code
. In DS-SS, the carrier (data signal) is modulated by the PN code sequence, which is of a
much higher frequency than the desired data rate
• If the Code sequence were deterministic, everybody could access the channel;
• If the Code sequence were truly random, then nobody, including the intended
receiver, could access the channel;
So, PN sequences appear as random noise to everybody else, except to the transmitter and
the intended receiver.
1. Drag the following blocks from the Simulink Library Browser into the model window,
and connect them as shown in the figure:
• Random interger generator, from the data sources sublibrary of comm
sources library (communication blockset).
• Unipolar to bipolar converter, from the utility blocks sublibrary of the
communication blockset library
• PN sequence generator, from the sequence generators sublibrary of comm
sources library (communication blockset).
• Product, from the math operations sublibrary of the simulink library.
• Bipolar to unipolar converter, from the utility blocks sublibrary of the
communication blockset library
• BPSK Modulator and Demodulator Baseband, from PM in the Digital
Baseband Modulation sublibrary of the Modulation library (communication
blockset).
• AWGN Channel, from the channels (communication blockset).
• Integrate and dump, from the commm filters sublibrary of the communication
blockset library.
• Sign, from the math operations sublibrary of the simulink library.
• Error rate calculation from the comm sinks library (communication blockset).
• Display form the sources sublibrary of the simulink library.
.
All r registers in the generator update their values at each time step according to the
value of the incoming arrow to the shift register. The adders perform addition modulo
2. The shift register is described by the Generator Polynomial parameter, which is a
primitive binary polynomial in z, gr zr + gr-1 zr-1 + gr-2 zr-2+...+go. The coefficient gk is 1
if there is a connection from the kth register, as labeled in the preceding diagram, to
the adder. The leading term gr and the constant term go of the Generator Polynomial
parameter must be 1.
You can specify the Generator polynomial parameter using either of these formats:
• A vector that lists the coefficients of the polynomial in descending order of
powers. The first and last entries must be 1. Note that the length of this
vector is one more than the degree of the generator polynomial
• A vector containing the exponents of z for the nonzero terms of the
polynomial in descending order of powers. The last entry must be 0.
The Unipolar to Bipolar Converter block maps the unipolar input signal to a bipolar
output signal. If the input consists of integers between 0 and M-1, where M is the M-
ary number parameter, then the output consists of integers between -(M-1) and M-1.
If M is even, then the output is odd, and vice-versa
The Integrate and Dump block creates a cumulative sum of the discrete-time input
signal, while resetting the sum to zero according to a fixed schedule. When the
simulation begins, the block discards the number of samples specified in the Offset
parameter. After this initial period, the block sums the input signal along columns and
resets the sum to zero every N input samples, where N is the Integration period
parameter value. The reset occurs after the block produces its output at that time step.
The integrate-and-dump operation is often used in a receiver model when the system's
transmitter uses a simple square-pulse model. It can also be used in fiber optics and in
spread-spectrum communication systems such as CDMA (code division multiple
access) applications.
Sign
The Sign block indicates the sign of the input: The output is 1 when the input is
greater than zero. The output is 0 when the input is equal to zero. The output is -1
when the input is less than zero.
1. Double-click the random integer generator block and make the following changes
• Set M-ary nimber to 2.
• Set sample time to 1/1000.
2. Double-click the PN sequence generator block and make the following changes to the
default parameters in the block's dialog:
• Set Set sample time to 1/32000.
3. Double-click the Unipolar to bipolar converter block and make the following changes
to the default parameters in the block's dialog:
• Set M-ary nimber to 2.
4. Double-click the bipolar to unipolar converter and make the following changes to the
default parameters in the block's dialog:
• Set M-ary nimber to 2.
5. Double-click the AWGN Channel block and make the following changes to the default
parameters in the block's dialog:
• Set Es/No to 6.
• Set Symbol period to 1/32000.
6. Double-click the Integrate and Dump block and make the following changes to the
default parameters in the block's dialog:
• Set integration period to 32.
7. Double-click the error rate calculation block and make the following changes
• Set receive delay nimber to 1.