You are on page 1of 145

Lecture 6 Review

• Analog Data, Digital Signals


– Pulse code modulation
• Sampling
• Quantization
– signal-to-noise ratio for quantizing noise
– nonlinear quantization
• PCM encoding
– Delta modulation: σ T
• Analog Data, Analog Signals
– AM
– Angle modulation:PM & FM
Wireless
Comminication

Chapter 5: Spread Spectrum


Spread Spectrum

• The spread spectrum techniques was


developed initially for military and intelligence
requirements.
• The essential idea is to spread the information
signal over a wider bandwidth to make
jamming and interception more difficult.
• In this chapter, we will look some spread
spectrum techniques and multiple access
technique based on spread spectrum.
Outline

5.1 Concept of Spread Spectrum

5.2 Frequency-Hopping Spread Spectrum

5.3 Direct Sequence Spread Spectrum

5.4 Code Division Multiple Access

5.5 Generation of Spreading Sequences


Concept of Spread Spectrum

• General model of spread spectrum digital


Analog signal with
communication system.
To increase the
a relatively narrow
bandwidth of the
bandwidth
signal
Concept of Spread Spectrum

• Input is fed into a channel encoder


– Produce an analog signal with a relatively narrow bandwidth around
some center frequency.
• Further modulated using a sequence of digits known as a
spreading code or spreading sequence.
– The spreading code is generated by a pseudonoise, or pseudorandom
number generator.
– The effect of this modulation is to increase significantly the bandwidth
(spread the spectrum) of the signal to be transmitted.
• At the receiver, the same digit sequence is used to demodulate
the spread spectrum signal.
• The signal is fed into a channel decoder to recover the data.
Concept of Spread Spectrum

• What can we gain from this apparent waste of


spectrum?
– Gain immunity from various kinds of noise and
multipath distortion
– Can be used for hiding and encrypting signals.
Only a recipient who knows the spreading code
can recover the encoded information.
– Several users can independently use the same
higher bandwidth with very little interference
(CDMA).
Outline

5.1 Concept of Spread Spectrum

5.2 Frequency-Hopping Spread Spectrum

5.3 Direct Sequence Spread Spectrum

5.4 Code Division Multiple Access

5.5 Generation of Spreading Sequences


Frequency-Hopping Spread Spectrum

 Basic Approach

 FHSS Using MFSK

 FHSS Performance
Basic Approach

• Frequency-Hopping Spread Spectrum -- FHSS


– Signal is broadcast over a seemingly random series
of radio frequencies, hopping from frequency to
frequency at fixed intervals.
– A receiver, hopping between frequencies in
synchronization with the transmitter, picks up the
message.
Basic Approach

• Advantages
– Attempts to jam the signal on one frequency only
knock out a few bits of it.
– Would-be eavesdroppers hear only unintelligible
blips
Basic Approach

• An example of frequency-hopping signal


• A number of channels
are allocated for the
FH signal.
• Typically, there are 2k
carrier frequencies
forming 2k channels.
• The width of each
channel corresponds to
the bandwidth of the
input signal.
Basic Approach

• The transmitter operates in


one channel at a time for a
fixed interval.
• During that interval, some
number of bits are transmitted
using some encoding scheme.
• The sequence of channels
used is dictated by a spreading
code.
• Both transmitter and
receiver use the same code to
tune into a sequence of
channels in synchronization.
Basic Approach
Basic Approach

• Typical block diagram for a FH system

Generate
spreading code
Basic Approach

• Binary data are fed into a modulator using some modulation


scheme (FSK or BPSK)
• Spreading code (generate by PN sourse) serves as an index
into a table of frequencies
• Each k bits of the spreading code specifies one of the 2k carrier
frequencies. At each k PN bits, a new carrier frequency is
selected.
• The signal produced from the initial modulator is modulated
by this frequency.
• Produce a new signal with the same shape but now centered on
the selected carrier frequency.
[Example] An FHSS system employs a total
bandwidth of Ws=400MHz and an individual
channel bandwidth of 100Hz. What is the
minimum number of PN bits required for each
frequency hop?
Basic Approach

The question is: How does the FH spreader


work? (How it move the signal frequency to
the selected frequency?)
Basic Approach

• Assuming we are using BFSK as the data


modulation scheme.
• Then the output signal from modulator or the
input signal to the FH spreader can be defined
as:  A cos(2f1 t ) binary1
sd ( t )  
 A cos(2f 2 t ) binary0
where
A  amplitude of signal
f1 , f 2  carrier frequency of BFSK
Basic Approach

• The frequency synthesizer generates a constant-


frequency tone.
– The frequency hops among a set of 2k frequencies.
– The hopping pattern determined by k bits from the PN
sequence.
• Assume the duration of one hop is the same as
the duration of one bit.
• Ignore phase differences between sd(t) and the
spreading signal c(t), or chipping signal.
Basic Approach

• If the frequency of the signal generated by the


frequency synthesizer during the ith hop is fi, the
product signal p(t) during the ith hop is:
 A cos(2f1t ) cos(2f i t ) binary1
p( t )  sd ( t )c( t )  
 A cos(2f 2 t ) cos(2f i t ) binary0

• Using the trigonometric identity:


cos( x) cos( y)  (1 2)(cos( x  y)  cos( x  y))
Basic Approach

• We can easily get

 0.5 Acos(2 ( f1  f i )t )  cos(2 ( f1  f i )t ) binary1


p( t )  
0.5 Acos(2 ( f 2  f i )t )  cos(2 ( f 2  f i )t ) binary0

• The bandpass filter is used to block the difference


frequency and pass the sum frequency, then the
spread spectrum signal is
 0.5 A cos(2 ( f1  f i )t ) binary1
s( t )  
0.5 A cos(2 ( f 2  f i )t ) binary0
Basic Approach

• Thus, during the ith bit interval, the frequency


of the spread spectrum signal is f1+fi if the data
bit is 1 and f2+fi if the data bit is 0.

• The central frequency is now moved to f2+fi or


f1+fi.
Problems

[Problems]
1. How does the FH spreader work when we use
BPSK modulation? (How it move the signal
frequency to the selected frequency when BPSK is
used?)
Basic Approach
Basic Approach

• On reception, a signal of the form s(t) just defined


will be received.
• The spread spectrum signal is demodulated using the
same sequence of PN-derived frequencies.
• Then demodulated to produce the output data.
• How does the receiver work?
Basic Approach

• Signal s(t) is multiplied by a replica of the spreading


signal to yield a product signal of the form:

 0.5 A cos(2 ( f1  f i )t ) cos(2f i t ) binary1


p ( t )  s( t )c( t )  
'

0.5 A cos(2 ( f 2  f i )t ) cos(2f i t ) binary0


• Again using the trigonometric identity

 0.25 Acos(2 ( f1  2 f i )t )  cos(2f1 t ) binary1


p (t )  
'

0.25 Acos(2 ( f 2  2 f i )t )  cos(2f 2 t ) binary0


Basic Approach

• At the receiver, the bandpass filter is used to


block the sum frequency and pass the
difference frequency, then a signal of the form
'
s
of d ( t ) is yielded.
 0.25 A cos(2f1t ) binary1
s (t )  
'

0.25 A cos(2f 2 t ) binary0


d
Problems

[Problems]
2. How does the FH despreader work when we use
BPSK modulation? (How it move the signal
frequency back to the carrier frequency when
BPSK is used?)
Frequency-Hopping Spread Spectrum

 Basic Approach

 FHSS Using MFSK

 FHSS Performance
FHSS using MFSK

• MFSK is a common modulation technique used in


conjunction with FHSS.
• Recall: MFSK uses M=2L different frequencies to
encode the digital input L bits at a time.

MFSK s(t )  A cos( 2f it ) 1  i  M


where
f i  the carrier frequencie s
M  number of different signal elements  2 L
L  number of bits per signal element
FHSS using MFSK

• For FHSS, the MFSK signal is translated to a new


frequency every Tc seconds by modulating the MFSK
signal with the FHSS carrier signal.
• The effect is actually to translate the MFSK signal
into the appropriate FHSS channel.
• For a data rate of R, the duration of a bit is T=1/R
seconds and the duration of a signal elements is
Ts=LT seconds.
FHSS using MFSK

• If Tc is greater than or equal to Ts the


spreading modulation is referred to as slow-
frequency-hop spread spectrum
• Otherwise it is known as fast-frequency-hop
spread spectrum.
FHSS using MFSK

[Example 1] If we use the MFSK example from


last chapter.

• M=4, which means that four different frequencies are


used to encode the data input 2 bits at a time.
FHSS using MFSK

• Each signal element is a discrete frequency tone. The


total MFSK bandwidth is Wd=Mfd.
• If we use an FHSS scheme with k=2, there are 4=2k
different channels, each of width Wd. The total FHSS
bandwidth is Ws=2kWd.
• Each 2 bits of the PN sequence is used to select one
of the four channels. That channel is held for a
duration of two signal elements, or four bits
(Tc=2Ts=4T)
FHSS using MFSK
PN sequence
Input binary data
Frequency

Slow FHSS
[Example 2] Using the same MFSK example.
M=4 and k=2. Wd=Mfd and Ws=2kWd.
However in this case, each signal element is
represented by two frequency tones. Then
Ts=2Tc=2T.
PN sequence
Input binary data
Frequency

Fast FHSS
• Another two example
time
Frequency
time
Frequency
Frequency-Hopping Spread Spectrum

 Basic Approach

 FHSS Using MFSK

 FHSS Performance
FHSS Performance

• Typically, a large number of frequencies are used in


FHSS so that Ws is much larger than Wd.
• Large value of k results in a system that is quite
resistant to jamming.
• Suppose MFSK has bandwidth Wd and noise jammer
has the same bandwidth. If the jammer has a fixed
power Sj on the signal carrier frequency, then the ratio
of signal energy per bit to noise power density is:
Eb Eb EbWd
 
N j S j / Wd Sj
• If frequency hopping is used, the jammer must jam all
2k frequencies.
• For fixed noise power, since Ws=2kWd, this reduces
the jamming power density to Sj/(2k Wd). Then
Eb Eb EbWd
'
 k
 k
N j S j /( 2 Wd ) 2 S j
• The gain in signal-to-noise ratio (the processing gain)
is
Ws
GP   2k
Wd
[Example] An FHSS system using MFSK with
M=4 employs 1000 different frequencies.
What is the processing gain?
[Example] The following table illustrates the operation
of an FHSS system for one complete period of the
PN sequence.
a. What is the period of the PN sequence?
b. The system makes use of a form of FSK, what form of FSK
is it?
c. What is the number of bits per symbol?
d. What is the number of FSK frequencies?
e. What is the length of PN sequence per hop?
f. Is this a slow or fast FH system?
g. What is the total number of possible hops?
Time 0 1 2 3 4 5 6 7 8 9 10 11

Input data 0 1 1 1 1 1 1 0 0 0 1 0

Frequency f1 f3 f27 f26 f8 f10

PN sequence 001 110 011

Time 12 13 14 15 16 17 18 19
Input data 0 1 1 1 1 0 1 0
Frequency f1 f3 f2 f2
PN sequence 001 001
[Example] The following table illustrates the operation
of an FHSS system for one complete period of the
PN sequence.
a. What is the period of the PN sequence?
b. The system makes use of a form of FSK, what form of FSK
is it?
c. What is the number of bits per symbol?
d. What is the number of FSK frequencies?
e. What is the length of PN sequence per hop?
f. Is this a slow or fast FH system?
g. What is the total number of possible hops?
Time 0 1 2 3 4 5 6 7 8 9 10 11

Input data 0 1 1 1 1 1 1 0 0 0 1 0

Frequency f1 f21 f11 f3 f3 f3 f22 f10 f0 f0 f1 f22


001 110 011 001 001 001 110 011 001 001 001 110
PN sequence

Time 12 13 14 15 16 17 18 19
Input data 0 1 1 1 1 0 1 0
Frequency f9 f1 f3 f3 f22 f11 f3 f3
011 001 001 001 110 011 001 001
PN sequence
Outline

5.1 Concept of Spread Spectrum

5.2 Frequency-Hopping Spread Spectrum

5.3 Direct Sequence Spread Spectrum

5.4 Code Division Multiple Access

5.5 Generation of Spreading Sequences


Direct Sequence Spread Spectrum

 DSSS Using BPSK

 DSSS Performance
DSSS Using BPSK

• Direct Sequence Spread Spectrum – DSSS


– Each bit in the original signal is represented by
multiple bits in the transmitted signal, using a
spreading code.
– The spreading code spreads the signal across a
wider frequency band in direct proportion to the
number of bits used.
– A 10-bit spreading code spreads the signal across a
frequency band that is 10 times greater than a 1-bit
spreading code.
DSSS Using BPSK

• One technique with DSSS is to combine the digital


information stream with the spreading code bit stream
using an exclusive-OR (XOR).
• The XOR obeys the following rules:

0  0  0 11  0 0 1  1 1 0  1
DSSS Using BPSK
DSSS Using BPSK

• This example shows that


– An information bit of one inverts the spreading
code bits in the combination
– An information bit of zero causes the spreading
code bits to be transmitted withoout inversion.
– The combination bit stream has the data rate of the
original spreading code sequence, so it has a wider
bandwidth than the information stream.
– In this example, the rate of spreading code bit
stream is four times the information rate.
DSSS Using BPSK

• A BPSK signal can be expressed as:


BPSK eBPSK  s (t ) A cos( 2f c t )
where s (t ) is bipolar NRZ signal
  1 binary 1
s(t)  
 1 binary 0
• To produce the DSSS signal, we multiply the
above by c(t), which is the PN sequence taking
on values of +1 and -1.

eDSSS  As(t )c(t ) cos(2f ct )


DSSS Using BPSK

• At the receiver, the incoming signal is


multiplied by c(t). Because c(t)×c(t)=1, the
original signal is recovered:
eDSSSc(t )  As(t )c(t ) cos(2f ct )c(t )  eBPSK
DSSS Using BPSK

• The DSSS signal expression can be interpreted


in two ways, leading two different
implementations.
– First multiply s(t) and c(t) together and then
perform the BPSK modulation.
– Alternatively, we can first perform the BPSK
modulation on the data stream s(t) to generate the
data signal eBPSK. This signal can then be multiplied
by c(t).
DSSS Using BPSK

• Transmitter using the second interpretation:


DSSS Using BPSK

• Receiver using the second interpretation:


DSSS Using BPSK

[Example]
DSSS Using BPSK
Direct Sequence Spread Spectrum

 DSSS Using BPSK

 DSSS Performance
DSSS Performance

• The information signal has a bit width of T,


which is equivalent to a data rate of 1/T. the
spectrum of the signal depending on the
encoding technique, is roughly 2/T.
• Similarly, the spectrum of the PN signal is
2/Tc.
• The amount of spreading that is achieved is a
direct result of the data rate of the PN stream.
DSSS Performance
DSSS Performance

• Effectiveness against jamming


– Assume a simple jamming signal at the center
frequency of the DSSS system. The jamming
signal is:
s j (t )  2 S j cos( 2f c t )
– The received signal is
er (t )  eDSSS (t )  s j (t )  n(t )
where S j  jammer signal power
er (t )  received signal
n(t )  additive white noise
DSSS Performance

• The despreader at the receiver multiplies er(t) by c(t), so the


signal component due to the jamming signal is:

yi (t )  2S j c(t ) cos( 2f ct )


• This is simply a BPSK modulation of the carrier tone. Thus
the carrier power Sj is spread over a bandwidth of
approximately 2/Tc.
• The BPSK demodulator following the DSSS despreader
includes a bandpass filter matched to the BPSK with
bandwidth of 2/T.
• Most of the jamming power is filtered.
DSSS Performance

• As an approximation, the jamming power passed by


the filter is
S j F  S j (2 / T ) /( 2 / Tc )  S j (Tc / T )
• The jamming power has been reduced by a factor of
(Tc/T) through the use of spread sprectrum.
• The gain in signal-to-noise ratio is:
T Rc Wc
GP   
Tc R Wd
where R  data rate Rc  spreading bit rate
Wd  signal bandwidth
Wc  spread spectrum signal bandwidth
Outline

5.1 Concept of Spread Spectrum

5.2 Frequency-Hopping Spread Spectrum

5.3 Direct Sequence Spread Spectrum

5.4 Code Division Multiple Access

5.5 Generation of Spreading Sequences


Code Division Multiple Access

 Basic Principles

 CDMA for DSSS


Code Division Multiple Access

• CDMA is a multiplexing technique used with


spread spectrum.
– Assuming data signal with rate D, break each bit
into k chips according to a fixed pattern that is
specific to each user, called the user’s code.
– The new channel has a chip data rate of kD chips
per second.
Code Division Multiple Access
• A simple example with k=6. It is simplest to
characterize a code as a sequence of 1s and -1s.
Code Division Multiple Access

• Three users A, B and C, each of which is


communicating with the same base station
receiver R. The code for each user:
– CA= < 1 -1 -1 1 -1 1>
– CB= < 1 1 -1 -1 1 1>
– CC= < 1 1 -1 1 1 -1>
• The base station receiver is assumed to know
user A B C’s code.
Code Division Multiple Access

• At the receiver
– If the receiver receives a chip pattern d=<d1 d2 d3
d 4 d 5 d 6>
– The receiver has user u’s code Cu=< c1 c2 c3 c4 c5
c6 >
– The receiver performs electronically the following
decoding function
Su (d )  d1  c1  d 2  c2  d 3  c3  d 4  c4  d 5  c5  d 6  c6
Code Division Multiple Access

• User A:
– If A wants to send a ‘1’ bit, A transmits its code as
a chip pattern d=< 1 -1 -1 1 -1 1>.
– If A wants to send a ‘0’ bit, A transmits the
complement of its code (1s and -1s reversed) as a
chip pattern d=<-1 1 1 -1 1-1>.
– The code for user A is c=CA= < 1 -1 -1 1 -1 1>
Code Division Multiple Access

• User A:
– If A sends a ‘1’ bit,
S A (1,1,1,1,1,1)  1  1  ( 1)  (1)  ( 1)  (1)  
1  1  ( 1)  (1)  1  1  6
– If A sends a ‘0’ bit
S A (1,1,1,1,1,1)  -1  1  1  (1)  1  (1)  
(1)  1  1  (1)  (1)  1  6
– Note that it is always the case that -6≤SA(d)≤6 no
matter what d is.
Code Division Multiple Access
Code Division Multiple Access

• User A:
• The only d’s resulting in the extreme values of
6 and -6 are A’s code and its complement
respectively.
– If SA produces a +6, received a 1 bit from A
– If SA produces a -6, received a 0 bit from A
– Otherwise we assume that someone else is sending
information or there is an error.
Code Division Multiple Access

• If user B is sending and we try to received it with SA,


that means we are decoding the received chip pattern
with the wrong code (CA).
– If B sends a 1 bit, then d= < 1 1 -1 -1 1 1>, c=CA= < 1 -
1 -1 1 -1 1>
S A (1,1,1,-1,1,1)  (1)  1  (1)  (1)  1  (1)  
1  1  (1)  (1)  (1)  1  0
– Since SA=0, we know that someone else apart from A is
sending information (in this case is user B).
– If B had sent a 0 bit, the decoder would produce a value of
0 for SA again.
Transmit (data bit = 0) -1 -1 1 1 -1 -1
Receiver codeword 1 -1 -1 1 -1 1
Multiplication -1 1 -1 1 1 -1 =0
Code Division Multiple Access

• If the decoder is linear and if A and B transmit


signals dA and dB respectively, at the same
time, then S (d  d )  S (d )  S (d )  S (d ) since S (d )
A A B A A A B A A A B

equal to 0 when it is decoded by A’s code.


• The code of A and B that have the property
that S A (CB )  SB (C A )  0 are called orthogonal
code.
Code Division Multiple Access

Transmission from A and B, receiver attempts to recover A’s transmission


A (data bit = 1) 1 -1 -1 1 -1 1
B (data bit = 1) 1 1 -1 -1 1 1
Combined signal 2 0 -2 0 0 2
Receiver codeword 1 -1 -1 1 -1 1
Multiplication 2 0 2 0 0 2 =6

Transmission from A and B, receiver attempts to recover B’s transmission

Combined signal 2 0 -2 0 0 2
Receiver codeword 1 1 -1 -1 1 1
Multiplication 2 0 2 0 0 2 =6
Code Division Multiple Access

Transmission from A and B, receiver attempts to recover A’s transmission


A (data bit = 1) 1 -1 -1 1 -1 1
B (data bit = 0) -1 -1 1 1 -1 -1
Combined signal 0 -2 0 2 -2 0
Receiver codeword 1 -1 -1 1 -1 1
Multiplication 0 2 0 2 2 0 =6

Transmission from A and B, receiver attempts to recover B’s transmission

Combined signal 0 -2 0 2 -2 0
Receiver codeword 1 1 -1 -1 1 1
Multiplication 0 -2 0 -2 -2 0 = -6
Code Division Multiple Access

• Such code are very nice but there are not many
of them. More common is the case that S (C ) is
X Y

small in absolute value when X≠Y.


• Then it is easy to distinguish between the two
cases when X=Y and when X≠Y.
• In our example, S A (CC )  SC (C A )  0 but
S B (CC )  SC (C B )  2 , in the latter case the C
signal would make a small contribution to the
decoded signal.
Code Division Multiple Access

Transmit (data bit = 0) -1 -1 1 -1 -1 1


Receiver codeword 1 1 -1 -1 1 1
Multiplication -1 -1 -1 1 -1 1 = -2
Code Division Multiple Access

Transmission from B and C, receiver attempts to recover C’s transmission


Combined signal 2 2 -2 0 2 0
Receiver codeword 1 1 -1 1 1 -1
Multiplication 2 2 2 0 2 0 =8
Code Division Multiple Access

(f) Transmission from B and C, receiver attempts to recover B’s transmission


B (data bit = 1) 1 1 -1 -1 1 1
C (data bit = 0) -1 -1 1 -1 -1 1
Combined signal 0 0 0 -2 0 2
Receiver codeword 1 1 -1 -1 1 1
Multiplication 0 0 0 2 0 2 =4

Transmission from B and C, receiver attempts to recover C’s transmission

B (data bit = 1) 1 1 -1 -1 1 1
C (data bit = 0) -1 -1 1 -1 -1 1
Combined signal 0 0 0 -2 0 2
Receiver codeword 1 1 -1 1 1 -1
Multiplication 0 0 0 -2 0 2 =0
Code Division Multiple Access

• Using the decoder Su, the receiver can sort out


transmission from u even when there may be other
users broadcasting in the same cell.
• In practice, the CDMA receiver can filter out the
contribution from unwanted users or they appear as
low-level noise.
• However the system breaks down:
– if there are many users competing for the channel with the
user the receiver is trying to listen to
– if the signal power of one or more competing signals is too
high (perhaps because it is very near the receiver)
Lecture 7 Review

• Spread spectrum
– Concept of spread spectrum
– FHSS
• Basic Approach
• FHSS with MFSK
• Performance
– DSSS
• Basic Approach
• DSSS with BPSK
• Performance
– CDMA
Code Division Multiple Access

 Basic Principles

 CDMA for DSSS


CDMA for DSSS

• Look at CDMA from the viewpoint of a DSSS system using


BPSK.
CDMA for DSSS

• There are n users, each transmitting using a different


orthogonal PN sequence.
• For each user, the data stream di(t) is BPSK
modulated to produce a signal with a bandwidth of Ws
and then multiplied by the spreading code ci(t) for
that user.
• All of the signals, plus noise, are received at the
receiver’s antenna.
CDMA for DSSS

• Suppose that the receiver is attempting to recover the


data of user 1. The incoming signal is multiplied by
the spreading code of user 1 and them demodulated.
• The effect of this is to narrow the bandwidth of that
portion of the incoming signal corresponding to user
1 to the original bandwidth of unspread signal, which
is proportional to the data rate.
• Because the remainder of the incoming signal is
orthogonal to the spreading code of user 1, that
remainder still has the bandwidth Ws.
CDMA for DSSS

• Thus the unwanted signal energy remains


spread over a large bandwidth and the wanted
signal is concentrated in a narrow bandwidth.
• The bandpass filter at the demodulator can
therefore recover the desired signal.
Outline

5.1 Concept of Spread Spectrum

5.2 Frequency-Hopping Spread Spectrum

5.3 Direct Sequence Spread Spectrum

5.4 Code Division Multiple Access

5.5 Generation of Spreading Sequences


Generation of Spreading Sequences

• Spreading consists of multiplying the input


data by the spreading sequence, where the bit
rate of the spreading sequence is higher than
that of the input data.
• When the signal is received, the spreading is
removed by multiplying with the same
spreading code, exactly synchronized with the
received signal.
Generation of Spreading Sequences

• Spreading code:
– There should be an approximately equal number of
ones and zeros in the spreading code.
– Few or no repeated patterns
– In CDMA application, further requirement of lack
of correlation
• Two general categories of spreading
sequences:
– PN sequences
– Orthogonal codes
Generation of Spreading Sequences

 PN Sequences

 Orthogonal Code

 Multiple Spreading
Generation of Spreading Sequences

 PN Sequences
 PN Properties

 LFSR implementation

 M-Sequences Properties
PN Sequences

• Ideal spreading sequence would be a random


sequence of binary ones and zeros.
• It is required that transmitter and receiver must
have a copy of the random bit stream.
• A predictable way is needed to generate the
same bit stream at the transmitter and receiver
and also retain the desirable properties of a
random bit stream.
• A PN generator can meet this requirement.
PN Sequences

• A PN generator will produce a periodic sequence that


eventually repeats but that appears to be random.
• PN sequences are generated by an algorithm using
some initial value called the seed.
– The algorithm is deterministic and therefore produces
sequences of numbers that are not statistically random.
– But if the algorithm is good, the resulting sequences will
pass many reasonable tests of randomness.
– Such numbers are often referred to as pseudorandom
numbers, or pseudorandom sequences.
– Unless you know the algorithm and the seed, it is
impractival to predict the sequence.
PN Sequences

• PN properties:
– Randomness
• Two criteria are used to validate that a sequence
of numbers is random
– Uniform distribution
– Independence

– Unpredictability
PN Sequences

• Uniform distribution:
– The distribution of numbers in the sequence should
be uniform
– The frequency of occurrence of each of the
numbers should be approximately the same.
– For a stream of binary digits, we need to expand
on this definition.
PN Sequences

– For a stream of binary digits, two properties are


desired:
• Balance property: in a long sequence the fraction of
binary ones should approach ½.
• Run property: a run is defined as a sequence of all 1s or
a sequence of all 0s. The appearance of the alternate
digit is the beginning of a new run. About ½ of the runs
should be of length 1, ¼ of length 2, 1/8 of length3, and
so on.
PN Sequences

• Independence:
– No one value in the sequence can be inferred from
the others.
– No such test to “prove” independence
– A number of tests can be applied to demonstrate
that a sequence does not exhibit independence.
– General strategy is to apply a number of such tests
until confidence that independence exists is
sufficiently strong.
PN Sequences

• In applications such as spread spectrum,


Correlation property is required.
– If a period of the sequence is compared term by
term with any cycle shift of itself, the number of
terms that are the same differs from those that are
different by at most 1.
Generation of Spreading Sequences

 PN Sequences
 PN Properties

 LFSR implementation

 M-Sequences Properties
LFSR implementation

• Linear Feedback Shift Register Implementation: a


circuit consisting of XOR gates and a shift register
implementing the PN generator for spread spectrum
– A string of 1-bit storage devices.
– Each device has an output line, which indicates the value
currently stored, and an input line.
– At discrete time instants, known as clock times, the value in
the storage device is replaced by the value indicated by its
input line.
– The entire LFSR is clocked simultaneously, causing a 1-bit
shift along the entire register.
LFSR implementation

• The circuit is implemented as follows:


– The LFSR contains n bits.
– There are from 1 to (n-1) XOR gates.
– The presence or absence of a gate corresponds to
the presence or absence of a term in the generator
polynomial (explained subsequently), P(X),
excluding the Xn term.
LFSR implementation

• Two equivalent ways of characterizing the PN


LFSR:
– A sum of XOR terms
Bn  A0 B0  A1 B1  A2 B2    An1 Bn1

– Generator polynomial

P ( X )  A0 X 0  A1 X 1  A2 X 2    An1 X n1  X n
LFSR implementation

Fig: Binary Linear Feedback Shift Register Sequence Generator


LFSR implementation

• An actual implementation would not have the


multiple circuits; instead, for Ai=0, the corresponding
XOR circuit is eliminated.
[Example] A 4-bit LFSR:
B3  B0  B1


LFSR implementation

• Advantages of shift register technique:


– The sequences generated can be nearly random
with long periods
– LFSRs are easy to implement in hardware and can
run at high speeds (this is important because the
spreading rate is higher than the data rate)
LFSR implementation

• Output of n-bit LFSR:


– Is periodic with maximum period N=2n-1.
– All-zeros sequence occurs
• if the initial contents of the LFSR are all zero
• or the coefficients of Bn are all zero (no feedback)
– When a period of N is given, a feedback
configuration can always be found, the resulting
sequence are called maximal-length sequences, or
m-sequences.
LFSR implementation

• Step-by-step operation of
the 4-bit LFSR with an
initial state of 1000
(B3=1, B2=0, B1=0,
B1=0).
The values that
The values currently The value of the
appear at the output
stored in the four shift output bit, which is B0
of the XOR circuit
register elements in this example.

LFSR implementation

• The period of the sequence, or the length of the


m-sequence: 24-1=15. the output repeats after
15 bits.
• The same periodic m-sequence is generated
regardless of the initial state of the LFSR
(except for 0000).
• With each different initial state, the m-
sequence begins at a different point in its
cycle.
LFSR implementation

• For any given size of LFSR, a number of


different unique m-sequences can be generated
by using different values for the Ai.
• The table next page shows the sequence length
and number of unique m-sequences that can be
generated for LFSRs of various sizes, also an
example generating polynomial.
LFSR implementation
Bn for
LFSR implementation

• One useful attribute of the generator


polynomial is that it can be used to find
sequence generated by the corresponding
LFSR, by taking the reciprocal of the
polynomial.
[Example] A three bit LSFR with
P(X)=1+X+X3, we perform the division
1/(1+X+X3).
LFSR implementation

Watch out: The


subtractions are done
modulo 2, or using
the XOR function, in
this case, subtraction
produces the same
result as addition.
LFSR implementation

• So the result of 1/(1+X+X3) is


1+X+X2 +(0×X3)+X4+(0×X5) +(0×X6)
after which the pattern repeats.
• This means that the shift register output is
1110100
• Because the period of this sequence is 7=23-1,
this is an m-sequence.
Generation of Spreading Sequences

 PN Sequences
 PN Properties

 LFSR implementation

 M-Sequences Properties
M-Sequences

• M-sequences have several properties that make


them attractive for spread spectrum
applications:
– Property 1. m-sequence has 2n-1 ones and 2n-1-1
zeros.
– Property 2. If we slide a window of length n along
the output sequence for N shifts (where N=2n-1),
each n-tuple appears exactly once.
1 1 1 0 1 0 0 1 1 1 0 1 0
– 111, 110, 101, 010, 100, 001, 011
M-Sequences

– Property 3. There is one run of ones of length n;


one run of zeros of length n-1; one run of ones and
one run of zeros of length n-2; two runs of ones
and two runs of zeros of length n-3; and in general,
2n-3 runs of ones and 2n-3 runs of zeros of length 1.
– When n=4, N=15, 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1
• 1 run of ‘1’s of length 4
• 1 run of ‘0’s of length 3
• 1 run of ‘1’s and 1 run of ‘0’s of length 2
• 2 runs of ‘1’s and 2 runs of ‘0’s of length 1 (2n-3 =2)
M-Sequences

• Correlation is the concept of determining how much


similarity one set of data has with another.
• Correlation is defined with a range between -1 and 1
with the following meanings:
– Value 1, the second sequence matches the first sequence
exactly
– Value 0, there is no relation at all
– Value -1, the two sequences are mirror images of each
other.
– Other value indicate a partial degree of correlation.
• Autocorrelation is the correlation of a sequence with
all phase shifts of itself.
N
1
R( ) 
N
B B
k 1
k k 

• Cross correlation function: the comparison is made


between two sequences from different sources ranther
than a shifted copy of a sequence with itself. It is
defined as: 1 N
R( ) 
N
 AB
k 1
k k 
M-Sequences

– Property 4. For many applications, the 0,1


sequence is changed to a ±1 sequence. The
periodic autocorrelation of the resulting sequence
is: N
1
R( ) 
N
B B
k 1
k k 

The periodic autocorrelation of a ±1 m-sequence


is:
 τ  0, N, 2N, ...
 11
R   
 otherwise

 N
M-Sequences
M-Sequences

• The cross correlation between an m-sequence and


noise is low
– This property is useful to the receiver in filtering out noise
• The cross correlation between two different m-
sequences is low
– This property is useful for CDMA applications
– Enables a receiver to discriminate among spread spectrum
signals generated by different m-sequences
Generation of Spreading Sequences

 PN Sequences

 Orthogonal Code

 Multiple Spreading
Orthogonal Code
• Orthogonal Code: a set of sequences in which all
pairwise cross correlations are zero.
• An orthogonal set of sequences is characterized by
the following equality:
M 1

  k  k   0
k 0
i j i j

where M  the length of each sequence in the set


i ,  j are the ith and jth members of the set
  bit duration
• For CDMA, each user uses one of the sequences in
the set as a spreading code, providing zero cross
correlation among all users.
Generation of Spreading Sequences

 Orthogonal Code
 Walsh Codes

 Variable-length Orthogonal code


Walsh Codes

• Walsh codes: the most common orthogonal


codes used in CDMA applications.
– A set of Walsh codes of length n consists of the n
rows of an n×n Walsh matrix.
– The matrix is defined recursively as:
 Wn Wn 
W1  0 W2 n   
 Wn Wn 
– Where n is the dimension of the matrix and the
overscore denotes the logical NOT of the bits in
the matrix.
Walsh Codes

• The Walsh matrix has the property that every


row is orthogonal to every other row and to the
logical NOT of every other row.
• The next figure shows the Walsh matrices of
dimensions 2, 4 and 8. Recall that to compute
the cross correlation, we replace 1 with +1 and
0 with -1.
Walsh Codes
Generation of Spreading Sequences

 Orthogonal Code
 Walsh Codes

 Variable-length Orthogonal code


Variable-length Orthogonal code

• 3G mobile CDMA systems are designed to


support users at a number of different data
rates.
• Effective support can be provided by using
spreading codes at different rates while
maintaining orthogonality.
• Suppose that the minimum data rate to be
supported is Rmin and that all other data rate are
related by power of 2.
Variable-length Orthogonal code

• If a spreading sequence of length N is used for the


Rmin data rate, such that each bit of data is spread by
N=2n bits of the spreading sequence, then the
transmitted data rate is NRmin.
• For a data rate of 2Rmin, a spreading sequence of
length N/2=2n-1 will produce the same output rate of
NRmin.
• In general, a code length of 2n-k is needed for a bit
rate of 2kRmin.
• E.H. Dinan and B. Jabbari, Spreading codes for direct
sequence CDMA and wideband CDMA cellular networks,
IEEE Comm. Mag. 36 (September 1998)
Generation of Spreading Sequences

 PN Sequences

 Orthogonal Code

 Multiple Spreading
Multiple Spreading

• When sufficient bandwidth is available, a multiple


spreading techniques can prove highly effective. A
typical approach is:
– Spread the data rate by an orthogonal code to provide
mutual orthogonality among all users in the same cell
– To further spread the result by a PN sequence to provide
mutual randomness between users in different cells.
– In such a two-stage spreading, the orthogonal codes are
referred to as channelization codes, and the PN codes are
referred to as scrambling codes.
– Stallings W. Wireless Communications and Networks
chapter 10.
[Example] A CDMA receiver receives a signal
[-1 +1 -3 +1 -1 -3 +1 +1]. If the codewords for
4 users are:

The bits transmitted by these 4 users are:


• =+8
• =-8
• =0
• =+8

• User A and D sent bit 1, user B sent bit 0, and user C keep
silence.
Review Questions

[Review Questions]

You might also like