Sunteți pe pagina 1din 52

Demonstration of Spread Spectrum Communication through Mathematical Simulation

Karthik Uppuluri University College University of Denver TELE 4901: Capstone Project December 9, 2007

______________________________ Carl M. Shinn, Jr. Capstone Advisor

______________________________ Thomas J. Tierney Academic Director of Telecommunications

Upon the Recommendation of the Department: ______________________________ James R. Davis Dean

Karthik-ii

1 ABSTRACT
This project demonstrates how a direct-sequence spread spectrum (DSSS) transceiver works under the influence of an Additive White Gaussian Noise (AWGN) channel. The DSSS system is designed so that the signal is varied along with the Pseudo-random Noise (PN) sequence and modulated with Binary Phase Shift Keying (BPSK). Receiver system is also is designed to get back the original signal using error correction and BPSK demodulation. The fundamental components of the DSSS as well as its intermediate signals and their interaction are made visible in this presentation, which thus serves as a superior learning/visualization tool.

Karthik-iii Table of contents: Title page .......................................................................................................................... i ABSTRACT ....................................................................................................................... ii 1. INTRODUCTION .......................................................................................................... 5 2. SPREAD SPECTRUM AND ITS TECHNIQUES ........................................................ 6 3. DIRECT SEQUENCE SPREAD SPECTRUM (DSSS)............................................... 10 4. DSSS TRANSMITTER ................................................................................................ 11 4.1. Transmitter Scope Results ..................................................................................... 12 5. TRANSMITTER COMPONENTS AND RESULTS .................................................. 14 5.1. Random Integer Generator..................................................................................... 14 5.2. Unipolar to Bipolar ................................................................................................ 16 5.3. PN-Sequence Generator......................................................................................... 18 5.4. Spreader ................................................................................................................. 22 5.5. Bipolar to Unipolar Converter ............................................................................... 24 5.6. Band Pass Shift Keying Modulator........................................................................ 24 5.7. Normalized Gain.................................................................................................... 30 6. AWGN CHANNEL COMPONENTS.......................................................................... 31 7. DSSS RECEIVER ........................................................................................................ 34 7.1 Receiver Scope results.35 8. RECEIVER COMPONENTS AND RESULTS........................................................... 37 8.1. M-ary PSK Demodulator ....................................................................................... 37 8.2. Despreader ............................................................................................................. 40 8.3. Tapped Delay......................................................................................................... 41

Karthik-iv 8.4. Integrate and Dump................................................................................................ 42 8.5. Error rate calculator ............................................................................................... 45 9. COMPLETE DSSS SYSTEM ...................................................................................... 45 10. CONCLUSION........................................................................................................... 48 11. REFERENCES ........................................................................................................... 49 12. APPENDIX................................................................................................................. 50

Karthik-5

1. INTRODUCTION
The spread spectrum concept originated in the period from 1920 to 1960, which led to the development of spread-spectrum communication systems (IEEE Trans Communication 1982, 882). During those times the communication was done using techniques like FDMA and TDMA, which are vulnerable to attack. The bandwidth needed is also high for these legacy systems, which was not a

major issue in the military. But those methods were highly insecure in terms of confidentiality. The spread spectrum technique was introduced in the 1920s, which brought a drastic change in the communication world. These spread spectrum systems were used mainly for the military purpose so that signal can be sent securely without jamming. The main advantage of this technique is that spread signal appears like a random noise, which is difficult to demodulate by anybody other than the authorized receiver. During that time, lot of research was going to change the wired telephone systems to wireless, resulting in major breakthroughs in the communication world. All these techniques were applied in wireless technology that changed the face of the corporate world.

There are two types of spread spectrum techniques that are used widely: Direct Sequence Spread Spectrum (DSSS) and Frequency

Karthik-6 Hopping Spread Spectrum (FHSS) technique. Spread Spectrum systems have found their use in the corporate world primarily for wireless digital communication. Code division multiple access (CDMA) is one of the best applications of spread spectrum system in this corporate world. CDMA mainly uses DSSS; for simplicity sake it is explained clearly in the project for single user. Bluetooth is the major application for Frequency Hopping Spread spectrum technique. A DSSS transceiver model is developed in the project. Some basic concepts that are very important for these technologies are also discussed in succeeding sections.

2. SPREAD SPECTRUM AND ITS TECHNIQUES


The general model of Spread spectrum Technique is shown in Figure 1. It shows that the data signal to be transmitted is multiplied by the spreading code (This is the general case and it can be any kind of sequence.). Then the spread signal is transmitted. The receiving side acquires the transmitted signal, which is then multiplied by a spreading code again, so that the original signal is recovered. It can be observed that the desired signal gets multiplied twice but the interference gets multiplied only once, which is a huge advantage and will reduce the interference. (Simon, et al. 1994)

Karthik-7

Data Signal Filter

Recovered Signal

Spreading Code Signal

Spreading Code Signal

Figure 1: Basic model of spread spectrum technique (Simon, et al. 1994).

The main property of the spreading signal is the bandwidth expansion factor (Be=Width/Datarate), which is much greater than unity, which means the redundancy involved in the spread signal can easily overcome the interference. The basic block diagram referenced in the project is shown in Figure 2.

Karthik-8

Pseudorandom Pattern Generator

Channel Encoder

Modulator

Channel Decoder

De-Modulator

C H A N N E L

Pseudorandom Pattern Generator

Figure 2: Block diagram showing the basic spread spectrum digital communication System (Proakis 2000).

The project is designed from above basic model using MATLAB/Simulink. In the above block diagram the digital signal is inserted at the transmitter end and received at the receiver end after proper manipulation. During this transmission the signal goes through a modulator and a demodulator for mixing with patterns created by pseudorandom number (PN) generators. Synchronization of the PN-generators is important for the receiver side to demodulate. The PN-generator is used along with a Phase Shift

Karthik-9 Keying (PSK) modulator and demodulator to change the phase of the signal.

The above discussion applies only for a single user as mentioned above due to the complexities associated with designing a system for multiple users. The encoding and decoding techniques are same for both. They can be distinguished from each other by superimposing a differential pseudorandom pattern called a code for the transmitted signal. (Simon, et al. 1994)

Reducing the transmitted power of the spread signal along its whole bandwidth can also hide the signal. This type of signal is called a Low Probability of Intercept (LPI) signal. Superimposing a pseudorandom code, which is the kind of technique that has been used in the project, attains the privacy of the message. (Ziemer and Peterson 1985)

This concludes the discussion of different ways of transmitting a signal. The next part explains the particular simulation of a DSSS system.

Karthik-10

3. DIRECT SEQUENCE SPREAD SPECTRUM (DSSS)


This is the spreading technique that is mainly used in the CDMA transmission system. With DSSS, multiple bits in the transmitted signal represent each bit in the original signal, using a spreading code .The spreading code spreads the signal across a wide frequency band in direct proportion to the number of bits used. Therefore, a ten-bit spreading code spreads the signal across a frequency band that is ten times greater than a one-bit spreading code. When the signal spreads ten times greater, the energy will vary. Normalized gain is used in the simulations to keep the energy constant. (Stallings 2004) More information on how a signal is transmitted and received is clearly explained in Sections 4 through 7 below.

The DSSS model includes these major components: 1. Transmitter 2. Receiver 3. Channel

Karthik-11

4. DSSS TRANSMITTER
Figure 3 shows the Simulink transmitter design. The input to the transmitter is given from the random integer generator. This random integer sequence simulates information generated by a user. The output from the random integer generator is converted to bipolar waveform.

Figure 3: Simulink transmitter design.

As the signal needs to be spread, a PN sequence generator is used, which generates a random binary sequence. The output from the PN

Karthik-12 sequence generator is also converted to a bipolar waveform from the unipolar waveform. Now both the information sequence and the PN-sequence are multiplied, resulting in the spreader signal. The next stage is modulation where the spread signal is modulated. An M-ary Phase Shift Keying (M-PSK) modulator is used and the parameters are set in such a way that it works as a Binary Phase Shift Keying (BPSK) Modulator. The output of a BPSK modulator is a sine wave where it changes its phase by 180 degrees. Now the information is ready for transmission but the energy when spread will be less than the original signal, so normalized gain is used to restore the energy of the signal. The output from different blocks is given to the scope, where the output is plotted. The snapshots of these results are captured at the same time and are shown in the following sections.

4.1. Transmitter Scope Results

Figure 4 below shows the outputs from all the blocks on the transmitter side. The result is discussed in detail in the next section which explains each block separately.

Karthik-13

Figure 4: The transmitters output with all the scopes together.

Karthik-14

5. TRANSMITTER COMPONENTS AND RESULTS


This section discusses the transmitter blocks completely with the scope results after each block.

5.1. Random Integer Generator The random integer generator uniformly distributes random integers in the range (0, M-1), where M is the number of the array. Assuming the M value is 2, the integers range is (0,1). The random integer generator is conventional to use as a source.

The following parameters are to be defined for this block and are selected randomly to get the desired output waveform: 1) M-array number. 2) Initial seed: Vector length seed determines length of output vector and by default it is set to 37 3) Sample time is chosen as .01sec 4) Samples per frame These are parameters used for the random integer generator; the parameter block is pasted from MATLAB/Simulink.

Karthik-15

Figure 5: Parameter block of Random Integer Generator

Figure 6 is an oscilloscope result that shows the random integer generator output, generating uniformly distributed random integers in the range [0, M-1], where M is an M-array number.

Karthik-16

Figure 6: Random Integer Generator Scope

5.2. Unipolar to Bipolar 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. For an example if the input is [0; 1; 2; 3], the M-ary number parameter is 4, and the Polarity parameter is Positive, then the output is [-3; -1; 1; 3]. Changing the Polarity parameter to Negative changes the output to [3; 1; -1; -3]. Figure 7 shows the parameter settings for the unipolar to bipolar converter.

Karthik-17

Figure 7: Parameters of Unipolar to Bipolar Converter

Figure 8 shows a scope result with a bipolar output signal. If the input is from 0 to M-1 integers, then the output consists of integers (M-1) and (M-1).

Figure 8: Random Unipolar to Bipolar Signal.

Karthik-18 5.3. PN-Sequence Generator A pseudo noise (PN) generator creates a pseudo random sequence to simulate a noise signal. The generated PN sequence is not completely random, but the PN code is a deterministic periodic signal that is known to both the transmitter and receiver. (A random signal cannot be predicted, but its future can be determined statistically.) PN is called so because its statistical properties are the same as sampled white noise (Sklar 2001).

The DSSS is simulated using MATLAB/Simulink software and the block used is a PN-sequence generator. It uses a sequence of shift registers to generate the sequence as shown in the Figure 9. In Figure 9, the adder performs the modulo 2 addition. All the registers that are represented by square boxes get updated every time form the earlier one. The generation polynomial can be represented as
g n z n + g n 1 z n 1 + g n 2 z n 2 + ................... + g 0.

The leading term is g n and constant term g o.

Karthik-19

gn

gn-1

gn-2

g1

g0

o/p

Figure 9: PN Generator Showing shift Registers In MATLAB/Simulink this can be represented in two ways. The first is like a vector that lists the coefficients of the polynomial; second one is like a vector containing the exponents of Z in descending order of power. The parameters are set and discussed in Figure 10.

Karthik-20

Figure 10: Parameters of PN generator

As the scope result shows in Figure 11, the PN sequence generator generates random sequences.

Karthik-21

` Figure 11: PN Sequence Generator

Figure 12 shows the same signal after the unipolar to bipolar converter. It can be seen that the output now varies from -1 to 1.

Karthik-22

Figure 12: PN Unipolar to Bipolar Converter.

5.4. Spreader The spreader is nothing but a multiplier. There are three input variables in the parameters block shown in Figure 13. The number of inputs determines how many inputs should be multiplied and also the multiplication is element wise. By default the sample time is -1. The spreader multiplies the PN sequence times the data signal that represents the user signal (voice or data). Figure 14 shows an example of the spreader output signal.

Karthik-23

Figure 13: Parameters of the Spreader

Figure 14: Spreader output signal example

Karthik-24 5.5. Bipolar to Unipolar Converter Since certain inputs to certain blocks can not be bipolar, this converter changes from bipolar to unipolar. A typical configuration is shown in Figure 15.

Figure 15: Parameters of Bipolar to Unipolar Converter

5.6. Band Pass Shift Keying Modulator Modulation is the process of transforming digital symbols into waveforms, which can be sent through specific channels. (Sklar 2001)

In this case a desired information signal modulates a sinusoidal signal called a carrier wave. Since this spread spectrum communication project is using it for telecommunication purposes,

Karthik-25 the carrier is converted to an electro magnetic signal that can be transmitted by an antenna. To increase the frequency so that a smaller antenna can be used, a modulator combines the signal with a carrier.

Other advantages of band pass modulation are multiplexing signals and minimizing interference. The next section explains digital modulation as implemented in the project.

An information signal is converted into a sinusoidal wave and a duration T is referred as digital symbol. Any signal can be varied by three factors: amplitude, frequency and phase. In Pass Band, all three factors can be varied in accordance with the information to be transmitted. (Sklar 2001)

s (t ) = A(t ) cos[0t + (t )]

(t ) is phase
A(t ) is amplitude

0 (t ) is Angular Frequency

There are two types of digital modulation techniques, coherent detection and non-coherent detection. If the receiver utilizes the

Karthik-26 carrier properties such as the phase, then it is called coherent detection. During non-coherent detection, the receiving side doesnt need the carrier. This DSSS simulation uses coherent detection.

In ideal coherent detection there are prototypes available at the receiver side. These waveforms attempt to duplicate the transmitted signal in every aspect. During detection, the receiver multiplies and integrates (correlates) the incoming signal.( Sklar 2001) For phase shift keying, the general expression can be given as

Si (t ) =

2E Cos (0t + i (t )) T 0t T i = 1, 2,.......M

Where the phase term can be represented as

i (t ) =

2 i M T = Symbol duration E = Symbol Energy.

In this project Binary Phase Shift Keying (BPSK) is used, where the signal shifts the phase of the waveform. There are two states of change either from 0 to 180 or vice versa. Figure 16 shows how the waveform varies.

Karthik-27

Figure 16: Figure showing the phase changes. (Stallings 2004)

If the modulating signal has zeros and ones, then there will be a change in a signals phase during its transmission. This kind of signal can be represented as vectors on a polar plot. While changing the complex part to real and imaginary parts in an M-array, the signal phase relates to m-1 sets. Few blocks have been changed in the project to represent this kind of signal. These types of signals are called antipodal signals. The parameter settings of the Binary

PSK modulator are shown in Figure 17 and are explained in order..

Karthik-28

Figure 17: Parameters of M-ary Phase Shift Keying modulator.

Since the project uses BPSK modulation, M=2. The input type and constellation parameters are bits and as B stands for binary, the third parameter is binary. A symbol period of 1/800 has been selected, resulting in the carrier frequency 2 * Pi * F, which is approximately 8000. And the final one is the output sample time which is 1/400,000.

Karthik-29

Figure 18 shows the result after the BPSK modulator and the changes in the sine wave are clearly seen.

Figure 18: Scope showing the phase changes after the M-PSK Modulator.

Karthik-30

Figure 19: Figure showing the phase changes. (Stallings 2004)

Figure 19 shows the theoretical result and it is exactly same as Figure 18 from the simulation.

5.7. Normalized Gain The input bits are spread after passing through the spreader, but the total energy must remain unchanged. Supposing three bits of original input are converted to six bits after spreading. Then the energy in six bits after spreading must be equal to the energy of three bits in the original message. To keep the energy constant, normalizing gain is used.

Karthik-31

Figure 20: Parameters showing the Normalized Gain.

Figure 20 shows a typical normalized gain setting block from MATLAB/Simulink.

6. AWGN CHANNEL COMPONENTS


This simulation models real world conditions by the linear addition of white noise with constant spectral density and Gaussian distribution of amplitude. This simulation channel produces similar results to those when a real signal comes across thermal noise, short noise and black body radiation. After the signal is transmitted in the simulation, it is sent to an AWGN channel that acts like a noisy

Karthik-32 channel. The output from AWGN channel is the information signal mixed with noise.

Figure 21: Parameters of AWGN channel

Figure 21 shows the settings for the AWGN channel. Figure 22 shows the signal after it is passed through the addition of noise by the AWGN channel.

Karthik-33

Figure 22: AWGN Channel output showing signal with noise added.

Karthik-34

7. DSSS RECEIVER

Figure 23: Receiver Side Block Diagram

The receiver (whose block diagram is shown in Figure 23) has the task of recovering the original transmitted signal. First, the noisy signal is demodulated and changed to a bipolar signal. The signal is then unbundled by combining it with the PN sequence. When both the signals are multiplied, the original signal is obtained. Then the

Karthik-35 signal is sent to the integrate and dump function, which integrates the input signal in discrete time and sees that it is between the absolute value of K-integers. The result is sent to dump and resets itself for next input. The signal is then sent to a zero order hold to restore the signal properties. At last the signal is again sent to bipolar to unipolar converter and the output is plotted on the scope.

7.1 Receiver scope results Figure 24 shows simulated signals at various points in the receiver. The DSSS function is especially highlighted by comparing the first (AWGN channel) and last (Received Signal).

Karthik-36

Figure 24: The Receiver output as one scope.

Karthik-37

8. RECEIVER COMPONENTS AND RESULTS


This section discusses all of the receiver components and shows the oscilloscope traces of all output signals after each component.

8.1. M-ary PSK Demodulator The receiving signal is fed directly into a demodulator where it is demodulated with the same parameters as that of the modulator. The parameters that are used are shown in Figure 25. Figure 26 shows that the demodulation is finished while Figure 27 shows the result after synchronization.

Karthik-38

Figure 25: Parameters of M-PSK Demodulator

Karthik-39

Figure 26: M-PSK Demodulator Pass Band before synchronization.

Figure 27:

M-PSK Demodulator Pass Band after synchronization.

Karthik-40 8.2. Despreader The despreader is similar to the spreader. In this case the PN sequence is multiplied by the incoming signal, so that the signal is decoded completely. Similarly the despreader parameters are shown in Figure 28. The resulting waveform is shown in Figure 29.

Figure 28: Parameters of Despreader.

Karthik-41

Figure 29: Despreading Signals.

8.3. Tapped Delay Before it is fed to the error rate calculator, the signal is delayed. The Tapped Delay block delays its input by the specified number of sample periods, and outputs the same signal with this constant delay.

This block provides a mechanism for discretizing a signal in time, or resampling the signal at a different rate. The time samples specify the time between samples with the Sample time parameter. A

value of -1 instructs the block to inherit the number of delays by backpropagation. Each delay is equivalent to the z-1 discrete-time operator, which is represented by the Unit Delay block.

Karthik-42 The Tapped Delay function block (shown in Figure 30) accepts one scalar input and generates an output for each delay. The input must be a scalar. Oldest orders the output. So for error rate calculation, prior to comparison, the input signal is delayed for 1 sample time.

Figure 30: Parameters of Tapped Delay.

8.4. Integrate and Dump This block integrates the input signal in discrete time and sees that it is between the absolute value of K-integers. As it resets itself after certain time, the signal integrates and sends the result to the output port and clears the internal state for the next time step. Figure 31 shows the parameters of the Integrate and Dump function block.

Karthik-43

Figure 31: Parameters of Integrate and Dump Figure 32 shows the Integrate and Dump output and demonstrates that it integrates the despreaded signal.

Figure 32: Integrate and Dump.

Karthik-44 The last section to be discussed is the Error Corrector, where the error is corrected in order to get back the original signal. In Figure 33 are two scope displays taken before and after error correction. It is easily seen that the received signal is not identical to the transmitted signal. The reason is that the signal is passed through a error rate calculator which is set to the incorrect parameters shown in Figure 34. The appropriate correction is revealed in Section 9 below.

Figure 33: Transmitted signal (above) and received signal (below) before error correction.

Karthik-45 8.5. Error rate calculator

Figure 34: Parameters of Error Correction.

9. COMPLETE DSSS SYSTEM


This section discusses in detail the complete DSSS transceiver designed with the basic blocks. This section summarizes all topics discussed in the project. BPSK is implemented as the spreading modulation technique. An ideal BPSK modulation results in instantaneous phase change of the carrier by 1800. These results illustrate why the BPSK modulator falls under the coherent systems category. Figure 35 is the comprehensive block diagram of the complete DSSS transmitter/receiver link. Resulting transmitted and received signals created by the simulator are shown in Figure 36.

Karthik-46

Figure 35: DSSS Simulink Block Diagram

Figure 36 displays the result that the transmitted signal and the received signal are identical. This indicates that the signal has been successfully communicated using DSSS technology.

Karthik-47

Figure 36: Transmitted Signal (above), Received signal (below), after error correction.

Karthik-48

10. CONCLUSION
This project provides a tool for understanding spread spectrum technology and its implementation. A DSSS transceiver is designed and demonstrated via simulation using a tool called MATLAB/Simulink. Simulation components used include a basic BPSK modulator along with a PN generator. Internal signals within the simulated transmitter and receiver are captured to reveal the DSSS operation. This project enables convenient exploration of spread spectrum. The project could also be useful in research by permitting observation of the results when DSSS parameters and configurations are changed.

Karthik-49

11. REFERENCES
Sklar, Bernard.. 2001. Digital communications fundamentals and applications. New York: Prentice Hall Professional Technical Reference. The Mathworks MATLAB and Simulink for technical computing. https://mathworks.com (Accessed October 10th, 2007) Proakis, John. 2000. Digital communications. New York: McGraw-Hill Companies. Simon, Marvin K., Jim K. Omura, Robert A. Scholtz, and Barry K. Levitt. 1994. Spread Spectrum Communications Handbook. New York: McGraw-Hill, Inc. Stallings, William. 2004. Wireless communications and networks. New York: Prentice Hall. Ziemer, Rodger E. and Roger L Peterson. 1985. Digital Communications and spread spectrum systems. New York: Prentice Hall. Scholtz, R. 1982. The origins of spread spectrum communications. IEEE Trans Communication 882-854

Karthik-50

12. APPENDIX LIST OF FIGURES:

FIGURE

Name

1 2 3 4 5 6 7 8 9 10 11 12 13

Basic Model of Spread Spectrum Technique Basic Spread Spectrum Digital Communication System Simulink DSSS Transmitter Design DSSS Transmitter Result Random Integer Generator Random Integer Generator Scope Random Unipolar to Bipolar Random Unipolar to Bipolar Scope PN Generator showing Shift Register PN-Sequence Generator PN-Sequence Generator Scope PN-Unipolar to Bipolar Scope Spreader

Karthik-51

14

Spreader Scope

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Bipolar to Unipolar Figure Showing the Phase change M-PSK Modulator M-PSK Modulator Scope Figure Showing the Phase change Normalized Gain AWGN Channel AWGN Channel Scope Simulink DSSS Receiver Design DSSS Receiver output Scope M-PSK Demodulator M-PSK Demodulator Scope After Synchronization Scope Despreader Despreader Scope Tapped Delay Integrate and Dump Integrate and Dump Scope

Karthik-52 33 34 35 36 Tx signal,Rx signal Scope(Before error correction) Integrate and Dump Simulink DSSS Transceiver Design Tx signal,Rx signal Scope(After error correction)

S-ar putea să vă placă și