Beruflich Dokumente
Kultur Dokumente
This project report is submitted in partial fulfilment of the requirement for the award of the
degree of Bachelor of Science in Electrical and Electronic Engineering of the University of
Nairobi.
DECLARATION OF ORIGINALITY
1. I understand what plagiarism is and I am aware of the university policy in this regard.
2. I declare that this final year project report is my original work and has not been submitted
elsewhere for examination, award of a degree or publication. Where other people’s work
or my own work has been used, this has been properly acknowledged and referenced in
accordance with the University of Nairobi’s requirements.
3. I have not sought or used the services of any professional agencies to produce this work.
4. I understand that any false claim in respect of this work shall result in disciplinary action,
in accordance with University anti-plagiarism policy.
Signature:
CERTIFICATION
This report was submitted to the Department of Electrical and Information Engineering,
University of Nairobi, with my approval as supervisor:
……………………………….
PROF. VITALICE K. ODUOL
Date…………………………………….
iv
ACKNOWLEDGEMENT
I would like to thank my supervisor, Prof. V. K. Oduol, without whom this work would not be
possible. His availability and ideas gave me the motivation I needed to complete this work.
Many thanks to my parents and siblings who supported me and put up with my frequent absence
as I worked on this project.
Finally, immense gratitude to the Almighty God, to whom all glory and honour rightly belongs.
v
LIST OF FIGURES
Figure 1: Feedback shift register. 5
Figure 2: PN sequence waveforms. Autocorrelation function (top). 6
Power spectral density (bottom).
Figure 3: DS-SS waveforms. Binary data (top). PN sequence (mid). 9
Spread binary data (bottom).
Figure 4: DS baseband model. Transmitter (top left). Channel (top right). 10
Receiver (bottom).
Figure 5: DS passband transmitter model. 11
Figure 6: DS passband receiver model. 12
Figure 7: Received DS signal. a) Before despreading. b) After despreading. 13
Figure 8: Block diagram of code synchronization system. 14
Figure 9: Digital matched filter. 16
Figure 10: Serial-search acquisition. 17
Figure 11: Block diagram of a non-coherent correlator 18
Figure 12: Delay-locked loop 19
Figure 13: Block diagram of DS-SS system 22
Figure 14: Block diagram of transmitter 22
Figure 15: PN generator 23
Figure 16: User data (top). PN sequence (bottom). 23
Figure 17: Spectrum of binary data (top). Spectrum of the spread signal (bottom). 24
Figure 18: Block diagram of receiver. 25
Figure 19: Transmitted (top) and received (bottom) waveforms. 25
Figure 20: Block diagram of synchronization system. 26
Figure 21: Block diagram of non-coherent correlator. 27
Figure 22: Threshold detector. 27
Figure 23: Output of threshold detector. 28
vi
LIST OF TABLES
Table 1: Generator polynomials 7
Table 2: Characteristics of Gold sequences 8
Table 3: BER performance for system with normal clock 35
Table 4: BER performance for system with jittery clock 35
viii
TABLE OF CONTENTS
Declaration of Originality ii
Certification iii
Acknowledgement iv
List of Figures v
List of Tables vii
1 Introduction 1
1.1 Abstract 1
1.2 Problem Definition 1
1.3 Objectives 1
1.4 Scope 1
1.5 Justification 2
1.6 Report Organization 2
2 Literature Review 3
2.1 Spread-Spectrum Communication Systems 3
2.1.1 Origins 3
2.1.2 Definitions and Concepts 3
2.2 Direct-Sequence Spread-Spectrum Systems 4
2.2.1 Pseudo-Noise (PN) Sequences 4
2.2.2 Gold Sequences 8
2.2.3 Spectrum Spreading in DS-SS 9
2.2.4 DS-SS with Coherent Binary Phase-Shift Keying 11
2.3 Code Synchronization 13
2.3.1 Code Acquisition 14
2.3.2 Acquisition Methods 16
2.3.2.1 Matched-Filter Acquisition 16
2.3.2.2 Serial-Search Acquisition 17
ix
3 System Description 21
3.1 Model Realization 21
3.2 Description of DS-SS system 21
3.2.1 Transmitter Architecture 22
3.2.2 Channel 25
3.2.3 Receiver Architecture 25
3.2.4 Synchronization System 26
3.2.4.1 Acquisition System 26
3.2.4.2 Tracking System 28
3.2.4.3 Search Control Unit 29
3.2.5 Blocks for Performance Testing 31
4 System Performance 34
4.1 Theoretical BER for BPSK 34
4.2 Performance of DS-SS System 34
5 Conclusion 38
APPENDICES
A MATLAB S-Function File for Jittery Clock 39
B Abbreviations and Acronyms 42
C References 43
1
1. Introduction
1.1. Abstract
1.3. Objectives
1.4. Scope
It is important to note that the synchronization aspects of acquisition and tracking are not
mutually exclusive, with both depending on each other for synchronization to be achieved.
With this crucial point in mind, the project will describe direct-sequence spread-spectrum
systems with regard to spreading sequences, transmitter and receiver design, acquisition
and tracking. Applications of direct-sequence spread spectrum systems in multiple-access
systems will also be described briefly. A special focus will be accorded to code acquisition
with the eventual result that a code acquisition method is designed and demonstrated.
2
1.5. Justification
Chapter 1 gives a general introduction to the project and describes the objectives and scope
of the project.
Chapter 3 describes the various parts that make up the system in detail.
Chapter 4 presents the performance of the system and makes a comparison with the
performance of a theoretical system.
Chapter 5 concludes the project and mentions some modifications that could be made to
the system.
3
2. Literature Review
2.1.1. Origins
is operating in synchronism with the transmitter, the same code is used to despread
the spectrum and the data sequence is recovered [3].
Various types of spread-spectrum signaling techniques are available. These are:
Time hopping (TH) – In this technique, bursts of signal are initiated at pseudo-
random times.
There are also hybrid techniques that involve both DS and FH. A more detailed
discussion of DS-SS systems is now given.
As stated above, both DS and FH systems require the use of a noise-like spreading code
referred to as a pseudo-random or pseudo-noise (PN) sequence. A brief discussion of PN
sequences and another type of spreading sequence, the Gold sequence, is given below.
PN sequences are generated by means of a feedback shift register. These registers are
made up of consecutive stages of bistable memory devices (flip-flops) and feedback
logic. The flip-flops are regulated by a single clock. The block diagram below
illustrates the basic features of a feedback shift register [6].
5
At each tick of the clock, the state of each flip-flop is shifted to the next one down the
line. At the same time, the logic circuit computes a Boolean function of the states of
the flip-flops. The result of this computation is fed back as the input to the first flip-
flop. The sequence generated is therefore determined by the length m of the shift
register. For m flip-flops, the maximum number of possible states of the shift register
is 2𝑚 . The PN sequence so generated must therefore eventually become periodic with
a period of at most 2𝑚 .
Delay-and-add property – The modulo-2 sum of any m-sequence, when summed chip
by chip with a shifted version of the same sequence, produces another shifted version
of the same sequence.
𝑁+1
1− |𝜏|, |𝜏| ≤ 𝑇𝑐
𝑁𝑇𝑐
𝑅𝑐 (𝜏) = (2.1)
1
{ − , 𝑒𝑙𝑠𝑒
𝑁
∞
1 1+𝑁 2
𝑛 𝑛
𝑆(𝑓) = 2 𝛿(𝑓) + ∑ 𝑠𝑖𝑛𝑐 ( ) 𝛿 (𝑓 − ) (2.2)
𝑁 𝑁 2 𝑛=−∞ 𝑁 𝑁𝑇𝑐
𝑛≠0
It can be seen that maximal length sequences exhibit many of the properties
possessed by a truly random binary sequence. As a matter of fact, in the limit, the
two sequences become identical as 𝑁 is made infinitely large. However, a large
𝑁 means an increasing storage requirement, which imposes a practical limit on the
size of 𝑁.
Certain conditions must be met for a maximal-length sequence to be generated.
Generally, maximal-length sequences are defined by polynomials in the binary
field 𝐺𝐹(2). In this field, a primitive polynomial is a polynomial that possesses the
property that the smallest integer n for which the polynomial divides 1 + 𝑥 𝑛 is 𝑛 =
2𝑚 − 1. It turns out that any polynomial of degree m will generate a maximal-
length sequence of period 𝑁 = 2𝑚 − 1 if and only if it is a primitive polynomial.
This is a necessary and sufficient condition. Furthermore, for a positive integer m,
the number of different primitive polynomials of degree m over 𝐺𝐹(2) is given by
𝜙𝑒 (2𝑚 − 1)
𝜆𝑚 = (2.3)
𝑚
where 𝜙𝑒 (𝑛) is the number of positive integers less than and relatively prime to n
(n > 0), also known as Euler’s totient function.
The table below shows some of the polynomials that generate maximal-length
sequences for different register lengths [1].
Register length Sequence Number of Polynomial
m N = 2m-1 polynomials generators
2 3 1 1 + x + x2
3 7 2 1 + x + x3
1 + x2 + x3
4 15 2 1 + x + x4
1 + x3 + x4
5 31 6 1 + x2 + x5
1 + x3 + x5
1 + x + x2 + x3 + x5
1 + x + x2 + x4 + x5
1 + x + x3 + x4 + x5
1 + x2 + x3 + x4 + x5
6 63 6 1 + x + x6
1 + x + x3 + x4 + x6
1 + x5 + x6
1 + x + x2 + x5 + x6
1 + x2 + x3 + x5 + x6
1 + x + x4 + x5 + x6
While the autocorrelation properties of PN sequences are very good, the cross-
correlation properties are quite poor. Thus, PN sequences are not suitable for use in
multiple-access systems, which require that the cross-correlation between any two
users to be very low (ideally zero). A special type of PN sequences, referred to as
Gold sequences, meet this requirement.
2.2.2. Gold Sequences
2(𝑛+1)⁄2 + 1, 𝑛 𝑜𝑑𝑑
|𝜃| ≤ { (2.4)
2(𝑛+2)⁄2 + 1, 𝑛 𝑒𝑣𝑒𝑛; 𝑛 ≠ 0 𝑚𝑜𝑑 4
Then the shift register corresponding to the product polynomial 𝑓1 ∙ 𝑓2 will generate
2𝑛 + 1 different sequences each of period 2𝑛 − 1 and such that the cross-
correlation function of any pair of such sequences satisfies the inequality above.
Gold sequences are generated by the modulo-2 addition of two maximal-length
sequences of the same length. The code sequences are added chip by chip by
synchronous clocking. A special set of Gold sequences is formed from preferred pairs
of m-sequences. These sequences have uniform and bounded cross-correlation which
is three-valued, as shown in the table below:
Gold sequences are used widely in multiple-access systems like CDMA, frequency-
hopping multiple access (FHMA) and ultra-wideband spread-spectrum
communication systems due to their excellent cross-correlation properties. However,
they are usually non-maximal and hence have autocorrelation functions that are worse
than those of m-sequences.
From Fourier theory, it is known that multiplying two signals in the time domain is
equivalent to convolving the spectra of the two signals in the frequency domain.
Accordingly, given a narrowband message signal 𝑏(𝑡) and a wideband PN signal
𝑐(𝑡), the product signal 𝑚(𝑡) will have a spectrum that is nearly the same as the
wideband PN signal. Thus, the PN signal performs the role of a spreading code.
The process of multiplying the message signal and the PN signal causes each message
bit to be chopped up into small time increments referred to as chips. This is illustrated
in the waveforms below:
Figure 3 DS-SS waveforms. Binary data (top). PN sequence (mid). Spread binary
data (bottom)
10
Figure 4 DS baseband model. Transmitter (top left). Channel (top right). Receiver
(bottom)
The received signal 𝑟(𝑡) consists of the transmitted signal 𝑚(𝑡) plus additive
interference 𝑗(𝑡) introduced in the channel. Thus,
Assuming the PN sequence alternates between -1 and +1, squaring destroys the
alternation and thus
Thus, the message signal is recovered at the receiver. However, multiplication of the
interference 𝑗(𝑡) with the local PN sequence will spread its spectrum as it did the data
at the transmitter. Hence, at the receiver, the message is narrowband while the
interference is wideband. All that remains is to apply the multiplier output to a low-
11
pass filter with a bandwidth just large enough to accommodate the message signal,
filtering out almost all the power in the interference and significantly reducing its
effect at the receiver.
Coherent BPSK is incorporated into the transmitter and the receiver to enable this
technique to be used in passband transmission. The figure below shows a block
diagram of the transmitter [4].
A message sequence {𝑏𝑘 } is a stream of 1s and 0s. This sequence is first fed to a polar
NRZ level encoder (not shown) which does the mapping 0 → −1, 1 → +1,
converting the unipolar sequence to a bipolar one. The bipolar sequence 𝑏(𝑡) is then
multiplied with the PN sequence 𝑐(𝑡). This is the first stage of modulation.
The second stage of modulation consists of a BPSK modulator which performs phase
modulation on the message signal 𝑚(𝑡) to yield a phase-modulated signal 𝑥(𝑡) which
is transmitted.
At the receiver, two stages of demodulation are performed. The received signal 𝑦(𝑡)
can be represented as
2𝐸𝑠
𝑦(𝑡) = √ 𝑏(𝑡)𝑐(𝑡) cos(2𝜋𝑓𝑐 𝑡 + 𝜃) (2.9)
𝑇𝑆
Here, 𝐸𝑠 is the energy of the received signal, 𝑇𝑠 is the duration of one symbol of the
data sequence and 𝜃(𝑡) is the phase modulation, takes on values of 0 or 𝜋 depending
on the polarities of the data sequence and the PN sequence at any one time.
The transitions of the data symbols and the PN chips coincide such that the ratio of
𝑇𝑠 to 𝑇𝑐 (the chip time) is an integer. If the bandwidth of the received signal 𝑦(𝑡) is
𝐵𝑠𝑠 and that of a conventionally modulated signal 𝑏(𝑡)cos(2𝜋𝑓𝑐 𝑡) is 𝐵, then the
spreading due to 𝑐(𝑡) is found to yield 𝐵𝑠𝑠 ≫ 𝐵, that is, the signal occupies a
bandwidth in excess of the minimum bandwidth necessary to send it.
The first stage of demodulation involves coherent detection wherein the received
signal 𝑦(𝑡) and a locally generated carrier are applied to a product modulator,
followed by low-pass filtering. This reverses the phase-shift keying applied to the
transmitter signal. The second stage of demodulation involves despreading wherein
the low-pass filter output is multiplied by a locally generated replica of the PN
sequence and then integration is performed over a bit interval. Finally, a decision-
making device gives the final output sequence.
The figure below shows how the received signal together with interference (assumed
narrowband) appear before and after despreading occurs [4].
13
At the spread-spectrum receiver, the corresponding chips in the spreading sequence must
precisely or nearly coincide. Any misalignment causes the signal amplitude at the
demodulator to fall in accordance with the autocorrelation function, leading to signal
degradation. Use of precision clocks in the transmitter and the receiver may help to limit
the uncertainty but there is still the potential of synchronization problems due to clock
drift, range uncertainty and the Doppler shift.
There are various ways in which code synchronization in a spread-spectrum system may
be achieved. Separately transmitted pilot or timing signals or using feedback signals from
the receiver to the transmitter are some of the ways. However, both of these ways accrue
significant costs in power and overhead. A method which is more modest in power and
overhead is to use the received signal to acquire synchronization.
14
Synchronization consists of two parts: acquisition and tracking. Code acquisition is the
operation by which the phase of the receiver-generated sequence is brought to within a
fraction of a chip of the phase of the received sequence. Code tracking is the operation by
which synchronization errors are further reduced or at least maintained within certain
bounds. Acquisition and tracking devices regulate the clock rate, adjusting the timing
offset of the local sequence to the timing offset of the received sequence. The figure below
shows a code synchronization system [1].
where 𝑠(𝑡) is the desired signal and 𝑛(𝑡) is white Gaussian noise. The desired signal
𝑠(𝑡) can be represented as
where 𝑆 is the average power, 𝑐(𝑡) is the PN waveform, 𝜃 is the random carrier phase
and 𝜏 and 𝑓𝑑 are the code phase offset and frequency offset, respectively, which must
be estimated.
If the received waveform 𝑟(𝑡) is expanded in terms of 𝑁 orthonormal basis functions,
an observation vector given by 𝒓 = [𝑟1 𝑟2 ⋯ 𝑟𝑁 ] will result. The likelihood function
for the unknown code phase offset 𝜏 and frequency offset 𝑓𝑑 will be given by the
15
conditional density function of r given 𝜏 and 𝑓𝑑 . Since the carrier phase 𝜃 is a random
variable, the likelihood function Λ(𝒓) will be given by the expectation of the
conditional density function with respect to 𝜃:
2√2𝑆𝑅(𝜏, 𝑓𝑑 )
Λ[𝑟(𝑡)] = 𝐽0 ( ) (2.14)
𝑁0
where 𝐽0 () is the modified Bessel function of the first kind of order zero, 𝑁0 ⁄2 is the
variance of each coefficient in the expansion of 𝑟(𝑡) and
𝑇 2
𝑅(𝜏, 𝑓𝑑 ) = [∫ 𝑟(𝑡)𝑐(𝑡 − 𝜏) cos(2𝜋𝑓𝑐 𝑡 + 2𝜋𝑓𝑑 𝑡) 𝑑𝑡]
0
𝑇 2
+ [∫ 𝑟(𝑡)𝑐(𝑡 − 𝜏) sin(2𝜋𝑓𝑐 𝑡 + 2𝜋𝑓𝑑 𝑡)𝑑𝑡] (2.15)
0
A common feature of all acquisition methods is that the received signal and the locally
generated PN sequence are first correlated to establish a measure of similarity
between them. This measure is then compared to a threshold to determine if the two
signals are in synchronism. If they are, a verification algorithm is started. Some dwell
time is usually necessary while testing synchronism to avoid false locking. After this,
tracking can begin.
The two main acquisition methods are matched filter acquisition and serial-search
acquisition, also known as the sliding correlator. These are briefly described below.
The figure below illustrates a digital matched filter that can be used for non-
coherent acquisition [4].
The received signal together with the local PN sequence are applied to a non-
coherent correlator which generates the statistic 𝑅(𝜏, 0). If the received and
local spreading sequences are not aligned, the autocorrelation value is low and
hence the threshold value is not exceeded. The cell under test is thus rejected
and the phase of the local sequence is advanced or retarded by generating and
extra clock pulse or by blocking one.
If the received and local spreading sequences are aligned to within a certain
arbitrary value (say, half a chip), then the autocorrelation value will be high and
the threshold value will be exceeded. The search is then stopped and the cell is
selected as the correct one. Demodulation and tracking can then commence.
The amount of time required to test a cell is referred to as the dwell time and is
approximately equal to the integration period in the non-coherent correlator. An
acquisition system in which a single test determines whether a cell is accepted
as the correct one or not is termed a single-dwell system; one in which
subsequent verification tests are required before a decision is made is termed a
multiple-dwell system.
Code tracking will be very briefly discussed as it is not the subject of this project;
however, mention of it is important since acquisition and tracking are not mutually
exclusive but rather depend of each other for synchronization to be achieved.
Once receiver timing has been synchronized to within a fraction of a chip time, the
estimate should further be refined to approach zero. Corrections must be made
continuously because of the relative motion of transmitter and receiver and the
instability of clocks.
A popular method used for tracking is the delay-locked loop (DLL). This is shown in
the figure below [4].
19
The locally generated PN sequence 𝑝𝑟 (𝑡) of the tracking loop is offset from the
incoming PN sequence 𝑝(𝑡) by a time 𝜏 < 𝑇𝑐 ⁄2. Within the DLL, two PN sequences
are delayed from each other by one chip time (𝑇𝑐 ), that is, 𝑝𝑟 (𝑡 + 𝑇𝑐 ⁄2 + 𝜏)
(advanced sequence) and 𝑝𝑟 (𝑡 − 𝑇𝑐 ⁄2 + 𝜏) (delayed sequence).
When 𝜏 is positive, the error signal causes the voltage-controlled clock to increase its
frequency, thereby forcing 𝜏 to decrease. Conversely, when 𝜏 is negative, the error
signal causes the voltage-controlled clock to decrease its frequency, thereby forcing
𝜏 to increase. In this way, tracking of the PN sequence is achieved.
In a CDMA system, each user is assigned its own PN sequence which is approximately
orthogonal to all other sequences. The receiver performs a time correlation operation in
order to detect only the specific desired sequence. All other sequences appear as noise to
this particular receiver due to decorrelation. Of course, this receiver needs to have a
knowledge of the PN sequence used by the transmitter.
Thus, with the use of SS techniques, it is possible for multiple users to transmit
simultaneously in the same frequency band, and yet the data can be decoded by a receiver,
provided that the receiver uses a PN code that is identical to, and synchronized with, the
particular SS signal that is to be decoded. However, the quality of communication
20
decreases as the number of users increases. CDMA (unlike TDMA or FDMA) is said to
have a soft capacity limit since there is no absolute limit on the number of users; the system
performance degrades for all users as the number of users is increased, and improves as
the number of users is decreased.
21
3. System Description
This section describes in detail the complete direct-sequence spread-spectrum system. The
various parts of the system, namely, transmitter, receiver, channel, acquisition and tracking
together with the subsystems contained therein are presented in depth.
The system was modeled using Simulink, which is a companion software to MATLAB.
Simulink is extremely well-suited to modeling many kinds of systems due to its vast array
of packages tailor-made for various applications including, but not limited to,
communication systems, computer vision, robotics and control systems.
Simulink models systems using blocks which represent real-life systems. The software is
user-friendly since each block has a description and a way to vary various parameters,
making it quite versatile. It also contains visual tools such as displays, scopes, spectrum
analyzers, among others which further lend to its facility in use.
The Communications Blockset was mainly used in modeling the system, as well as other
commonly-used blocks and mathematical operations. This blockset contains blocks
pertaining to communication systems such as filters, modulators, demodulators, sequence
generators and channels as well as utility blocks such as bipolar-to-unipolar converters
and bit error rate calculators.
The user data was generated by a Bernoulli binary generator at the rate of 10
bits/second. The probability of 1s and 0s was equal hence this was a good
representation of real-life data which is usually random e.g. speech. The user data was
then multiplied by the PN sequence to spread its spectrum. BPSK modulation was
then carried out for passband transmission.
The PN generator was built out of seven D flip-flops to give a code length of 𝑁 =
27 − 1 = 127. The generator polynomial used was 1 + 𝑥 + 𝑥 7 which was gotten by
23
using the outputs of the first and seventh flip-flops in the feedback logic. The PN
generator is shown below.
Figure 15 PN generator
The clock was set to run at 1000 Hz so as to generate a PN sequence at a rate of 1000
chips/second. There was also an option of using a variable clock so as to observe the
performance of the system with regard to synchronization.
The waveforms below show the user data and the PN sequence.
Below, the spectra of the user data and of the spread sequence are shown. It can be
seen that the spectrum has been made ‘wider’. While the spectrum of the user data
has most of its energy from 0 – 5 𝐻𝑧, the spread signal occupies a bandwidth of
1 𝑘𝐻𝑧. This is the spreading mechanism. It can also be noted that the magnitude of
the spread signal is larger.
3.2.2. Channel
An additive white Gaussian noise (AWGN) channel was used in the DS-SS model.
At the receiver, the phase-shift keying was undone using a BPSK demodulator. This
was followed by despreading using a synchronized PN sequence generated by a local
PN generator. Filtering and signal shaping was then done to receive an estimate of the
transmitted user data.
The figure below shows the transmitted and received user data for a signal-to-noise
ratio (SNR) of 10 𝑑𝐵.
It can be seen that the data can be recovered at the receiver after despreading using a
local PN generator.
It can be seen that there are three main sections in the synchronization system, namely,
the acquisition system (made up of the non-coherent correlator and the threshold
detector), the tracking system and the search control unit. Each of these is now
described separately.
The data from the channel is multiplied by an in-phase and quadrature sinusoidal
waveform at the carrier frequency to generate in-phase and quadrature
components of the received data. Each component is passed through a chip-
matched filter and sampled at the rate of the synchronized clock (more on this
later). The sampled components are then multiplied by the local PN sequence
and passed through a square-law detector and finally summed to generate
correlated data.
The correlated data is then taken to a threshold detector, shown in the figure
below.
The threshold detector consists of a filter and a comparator. The correlated data
is filtered and then compared to a threshold. The output of the comparator is
HIGH if the data is greater than or equal to the threshold and LOW if it is less
28
than the threshold. Thus, a 1 or a 0 is output from the threshold detector, as shown
in the figure below.
The tracking system was implemented as a DLL, as shown in the figure below.
The three inputs to the DLL are gotten from the non-coherent correlator. The
early PN sequence is the synchronized sequence while the late PN sequence is
gotten from the output of the sixth flip-flop in the local PN generator. These
sequences are correlated with the data from the channel using the filter and the
envelope detector. The two components are then summed and taken to a voltage-
29
Thus, the DLL uses the delayed and advanced PN sequences to produce a signal
which tracks the received sequence.
1
The clock in this unit had a period of a fifth of the chip time, i.e. 𝑇 = 5000 𝑠 =
𝑇𝑐
. This ensured that the serial search was performed over decision regions (or
5
cells) much less than a chip size, improving accuracy. The clock output is first
inverted to enable it to drive a negative-edge triggered flip-flop. The inverted
clock and the signal from the threshold detector serve as inputs to a NAND logic
gate. The logic gate gives a HIGH output whenever the clock and the detected
signal are 90° out of phase or are both LOW. Whenever the clock and the
detected signal are both HIGH, the output of the NAND gate is LOW.
The J-K flip-flop has shorted inputs hence it acts as a T flip-flop. Whenever the
input to a T flip-flop is HIGH, the output of the flip-flop is LOW and vice versa;
the flip-flop performs toggling. Thus, if the clock and the detected signal are not
synchronized, the search control unit generates an extra clock pulse, effectively
slowing down the clock. The output of the flip-flop is then modulo-2 added with
the signal from the tracking system, giving rise to a synchronized clock signal.
The figure below compares the normal clock and the synchronized clock.
It is this synchronized clock that drives the local PN generator to give rise to a
synchronized PN sequence which can be used at the receiver to recover the data.
The figure below compares the transmitter and receiver PN sequences.
31
It can be seen that the receiver PN sequence does not vary in the same manner
as the transmitter PN sequence due to the latter’s adjustment by the search
control unit.
The Error Rate Calculator block form the Communications Blockset was used to test
the performance. This block computes the bit error rate using the transmitted and
received signals and outputs three sets of data: the bit error rate, the number of errors
detected and the number of symbols compared. These were displayed using the
Display block. The figure below illustrates this.
32
Thus, the simulation above yielded a bit error rate of 0.008 or 0.8%. Out of 1000
symbols compared, 8 errors were detected.
A jittery clock generator was also included in the transmitter PN generator as shown
below.
Selection between a normal clock and the jittery clock generator was possible using
a manual switch. The purpose of the jittery clock generator was to simulate a real-
world system where clock drift and instability would be unavoidable. The internal
structure of the jittery clock generator was as shown in the figure below.
33
A MATLAB function was used [12] to create a clock with jitter to simulate a real
clock which would inevitably suffer from drift and instability. The Rate Transition
block was used to ensure that only discrete samples were used in the system. Most of
the blocks in the system required discrete samples hence the need for this block.
The figure below shows the output of the jittery clock generator.
4. System Performance
This section describes the performance of the direct-sequence spread-spectrum system. For a
spread-spectrum system, the parameters of interest are usually the acquisition time and the bit
error rate (BER). In this system, acquisition is instantaneous since no delay is introduced in
the channel. However, the BER performance of the system is investigated with regard to two
conditions: system driven by a normal clock and system driven by a jittery clock.
The BER, also known as the probability of bit error, denoted by 𝑃𝑒 , is a measure of the
level of deterioration in a digital communication system. The BER for modulation
schemes in an AWGN channel is found using the 𝑄-function of the distance between the
signal points. The 𝑄-function is defined as [8]
∞
1 𝑥2
𝑄(𝑧) = ∫ exp (− ) 𝑑𝑥 (4.1)
√2𝜋 2
𝑧
2𝐸𝑏
𝐵𝐸𝑅𝐵𝑃𝑆𝐾 = 𝑄 (√ ) (4.2)
𝑁0
Here, 𝐸𝑏 is the energy per bit and 𝑁0 is the power spectral density of the noise in the
channel (in this case, white noise).
Simulations were run on the DS-SS system using Simulink. Two conditions were
investigated, namely, system with normal clock and system with jittery clock. The number
of symbols compared was 104 . The tables below show the BER performance of the system
under both conditions.
35
Normal clock
𝑬𝒃 ⁄𝑵𝟎 (𝒅𝑩) BER
0 0.1594
1 0.1332
2 0.1051
3 0.0816
4 0.0590
5 0.0416
6 0.0252
7 0.0143
8 0.0071
9 0.0021
10 0.0008
Jittery clock
𝑬𝒃 ⁄𝑵𝟎 (𝒅𝑩) BER
0 0.1594
1 0.1332
2 0.1051
3 0.0816
4 0.0590
5 0.0416
6 0.0252
7 0.0143
8 0.0071
9 0.0021
10 0.0008
The following MATLAB code snippet was written to plot the data above, as well as the
theoretical BER to provide a visual comparison between the systems.
From the graphs above, it can be seen that for both systems, the performance is as expected:
the BER improves as the SNR is increased. For the system driven by a normal clock, it can
37
be seen that at an SNR of 10 dB, a BER of 0.0008 is achieved, which is quite close to the
figure usually used in industry which is around 10−5.
When the system is driven by a jittery clock, it is found to have exactly the same
performance as the system with the normal clock. This demonstrates that the acquisition
system works as expected and acceptable reception is gotten at the receiver.
38
5. Conclusion
This project was established to investigate code acquisition in direct-sequence spread-spectrum
communication systems. The serial-search acquisition method was implemented using a non-
coherent correlator. A working model was built using Simulink and was tested. It was
demonstrated in the previous chapter that the acquisition method works and the overall system had
a bit error rate performance comparable to that required in practice.
A fuller treatment of direct-sequence spread-spectrum communication systems would investigate
the performance of the system in fading channels, in addition to AWGN channels. Delays could
be introduced in the channel and the time the system took to acquire acquisition would be a
performance parameter. Further, the system could be modified to compute probabilities of false
alarm and false detection and these two parameters could be used to plot the receiver operating
characteristics of the system.
39
%%
%% The setup method is used to setup the basic attributes of the
%% S-function such as ports, parameters, etc. Do not add any other
%% calls to the main body of the function.
%%
setup(block);
%endfunction
% Register parameters
block.NumDialogPrms = 3;
block.DialogPrmsTunable = {'Nontunable','Nontunable','Nontunable'};
%% -----------------------------------------------------------------
%% Options
%% -----------------------------------------------------------------
% Specify if Accelerator should use TLC or call back into
% M-file
block.SetAccelRunOnTLC(false);
%% -----------------------------------------------------------------
%% The M-file S-function uses an internal registry for all
%% block methods. You should register all relevant methods
%% (optional and required) as illustrated below. You may choose
%% any suitable name for the methods and implement these methods
%% as local functions within the same file.
%% -----------------------------------------------------------------
block.RegBlockMethod('CheckParameters', @CheckPrms);
block.RegBlockMethod('PostPropagationSetup', @DoPostPropSetup);
block.RegBlockMethod('Start', @Start);
block.RegBlockMethod('Outputs', @Outputs);
block.RegBlockMethod('Update', @Update);
%% -------------------------------------------------------------------
%% The local functions
%% -------------------------------------------------------------------
%% -------------------------------------------------------------------
%% Local Function to Error Check the Block Parameters
%% -------------------------------------------------------------------
function CheckPrms(block)
%% --------------------------------------------------------------------
%% Local Function to define the 3 Work Vectors used to store state info
%% --------------------------------------------------------------------
function DoPostPropSetup(block)
block.NumDworks = 3;
block.Dwork(1).Dimensions = 1;
block.Dwork(1).DatatypeID = 0; % double
block.Dwork(1).Complexity = 'Real'; % real
block.Dwork(1).UsedAsDiscState = true;
% The second work vector is used to store the next nominal sample time
block.Dwork(2).Name = 'NextNomTs';
block.Dwork(2).Dimensions = 1;
block.Dwork(2).DatatypeID = 0; % double
block.Dwork(2).Complexity = 'Real'; % real
block.Dwork(2).UsedAsDiscState = true;
% The third work vector is used to store the half the nominal period
block.Dwork(3).Name = 'HalfNomP';
block.Dwork(3).Dimensions = 1;
block.Dwork(3).DatatypeID = 0; % double
block.Dwork(3).Complexity = 'Real'; % real
block.Dwork(3).UsedAsDiscState = false;
%% --------------------------------------------------------------------
%% Local Function to read/store state info
%% --------------------------------------------------------------------
function Start(block)
%% --------------------------------------------------------------------
%% Local Function to define block outputs
%% --------------------------------------------------------------------
function Outputs(block)
% Calculate the time of the next sample hit, which is the next nominal time
% plus a random term the size of the user specified window.
block.NextTimeHit = block.Dwork(2).Data + ...
2*(rand-0.5)*block.DialogPrm(2).Data;
%% --------------------------------------------------------------------
%% Local Function to define block discrete state updates
%% --------------------------------------------------------------------
function Update(block)
C. References
[6] S. Haykin, Communication Systems, USA: John Wiley and Sons, Inc., 2001.
[7] T. S. Rappaport, Wireless Communications: Principles and Practice, India: Pearson, 2010.
[8] L. W. Couch, Digital and Analog Communication Systems, India: Pearson Education, 2001.
[9] H. K. a. A. G. Markey, "Secret Communication System". United States of America Patent 397,412,
10 June 1941.
[10] J. Meel, "Spread Spectrum (SS): Introduction," Sirius Communications, Belgium, 1999.
[11] R. Gold, "Optimal Binary Sequences for SS Multiplexing," in IEEE Transactions on Information
Theory, United States of America, 1967.