Sei sulla pagina 1di 23

NATIONAL INSTITUTE OF TECHNOLOGY, DURGAPUR

Gold Code Sequences


Project Report
2007-2008
| | | | | | Mohammed Zishan Ansari 04/351 Shobhit Mangla 04/355 Arijit Chattopadhyaya 04/356 Deepak Gahlawat 04/389 Puneet Shah 04/390 Vaibhav Singh 04/404

Acknowledgement
We would like to express our gratitude to our Project guide Mr. A. Chandra for giving us the opportunity and suggesting us a very useful topic to be taken as the final year B.Tech project for the academic session 2007-2008. The work which we have done in this project wouldnt have been possible without his support. He guided us by enlightening our path through out the project and his attitude has been a moral booster for all of us and we could complete the project in stipulated time. It has been a pleasure to be working under him, and we would like to thank him for his support and guidance. Looking forward, to his support in all future endeavors.

Index
Sl. No. 1. 2. 3. 4.

Topic Acknowledgment Abstract Introduction Theory Spread Spectrum Fundamentals DSSS and FHSS Ways of generation of PN Sequence Maximal Length PN Sequence Gold Code Transmitter Block Receiver Block Matlab Program & simulation for Baseband DSSS Cross and Auto correlation of gold and PN sequences Matlab Program & simulation for cross & auto correlation Conclusion Bibliography

Page no.
2 4 5

5 68 9 10 10 11 12 13 17 18 18 21 22 23

5. 6. 7. 8. 9. 10. 11.

ABSTRACT:

In modern communication systems, spread spectrum is playing an increasingly important role day by day due to its inherent advantages like noise immunity and also due its practical applications like mobile communications in CDMA. Our project is in accordance with this increasingly important communication technology. This project aims to Generate Gold Code sequence and modulate a message signal to produce a corresponding spreaded baseband modulated signal which is actually used in much higher proportions for transmission of voice and data signals in technologies like CDMA. The project also incorporates a receiver unit which demodulates the entire received signal with the assistance of the same gold code to generate the original message signal. An addition to this primary aim of our project is to study the cross correlation of two Gold Codes sequences and two Pseudo Noise sequences to ascertain which is a better tool for modulating the given message signal in terms of better noise immunity and security with the help of graphs using the MATLAB programming language.

I. Introduction
As the wireless personal communications field has grown over the last few years, the method of communication known as spread spectrum has gained a great deal of prominence. Spread spectrum involves spreading the desired signal over a bandwidth much larger than the minimum bandwidth necessary to send the signal. It was originally developed by the military as a method of communications that is less sensitive to intentional interference or jamming by third parties, but has become very popular in the realm of personal communications recently. Spread spectrum methods can be combined with Code Division Multiple Access (CDMA) methods to create multi-user communications systems with very good interference performance. This paper will cover the details behind the method of Spread Spectrum communications, as well as analyze two main types of Spread Spectrum systems, Direct-Sequence Spread Spectrum (DS-SS) and FrequencyHopped Spread Spectrum (FH-SS). Finally, a general comparison between the two will be given, trying to indicate the positives and negatives for each with respect to the other, and to indicate when one might system might be preferable over the other.

II. Spread Spectrum


As stated before, spread spectrum systems afford protection against jamming (intentional interference) and interference from other users in the same band as well as noise by spreading the signal to be transmitted and performing the reverse de-spread operation on the received signal at the receiver. This de-spreading operation in turn spreads those signals which are not properly spread when transmitted, decreasing the effect that spurious signals will have on the desired signal. Spread Spectrum systems can be thought of as having two general properties: first, they spread the desired signal over a bandwidth much larger than the minimum bandwidth needed to send the signal, and secondly, this spreading is carried out using a pseudorandom noise (PN) sequence. In a general sense, we will see that the increase in bandwidth above the minimum bandwidth in a spread spectrum system can be thought of as applying gain to the desired signal with respect to the undesirable signals. We can now define the processing gain GP as

Where BWRF is the bandwidth that the signal has been increased, and BWinfo is the minimum bandwidth necessary to transmit the information or data signal. Processing gain can be thought of as the improvement over conventional communication schemes due to the spreading done on the signal. Often, a better measure of this gain is given by the jamming margin, MJdB=GPdB SNRmin Which indicates the amount of interference protection offered before the signal is corrupted. The spreading function is achieved through the use of a pseudorandom noise sequence (PN sequence). The data signal is combined with the PN sequence such that each data bit is encoded with several if not all the bits in the PN sequence. In order to achieve the same data rate as was desired before spreading, the new data must be sent at a rate equal to the original rate multiplied by the number of PN sequence bits used to encode each bit of data. This increase in bandwidth is the processing gain, which is a measure of the noise and interference immunity of this method of transmission. To see how the spreading process helps protect the signal from outside interference, let us look at the types of interference that are possible. The three major types of interference that can arise when using wireless networks are: (1) noise, (2) intentional interference from a jammer or other source trying to disrupt

6 communications, and (3) unintentional interference from other users of the same frequency band. Noise can be considered as background white Gaussian noise (WGN), and can be said to have power spectral density N0. Since the noise is white, the spreading of the bandwidth does not have much of an effect here. The noise power is constant over the entire bandwidth, so increasing the bandwidth actually lets more noise into the system, which might be seen as detrimental. However, we will see that this is not really a problem. Intentional interference comes from sources who are actively trying to corrupt the data transmission by sending power transmissions in the same band as the intended transmission. The big difference between intentional interference and noise is that intentional interference is, by its very nature, a finite power signal, since it must be transmitted from a real source. Thus the spreading performed on the data signal allows the signal to hide itself in a larger bandwidth, forcing the jamming signal to distribute its power over this new much larger bandwidth, and thus intuitively diminishing the effect that the jamming signal has on the data signal. The third major source of signal corruption comes from unintentional interference due to other users using the same frequency band, and here, the system uses the PN sequence and the technique of CDMA to combat this type of interference. In a wireless communications network, all the signals propagate through the air by way of electromagnetic waves, thus there is no way to ensure that one user will receive only the signal he or she desires; that user will receive all the signals being sent in that band. By giving each of the signals to be transmitted in the frequency band its own code (CDMA) which is orthogonal to the other codes used in that band, the effect of these other signals will effectively be zero at the receiver (when the receiver correlates the input signal it receives with the code of the transmission it wants to receive, only the desired signal will Remain). The following sections will analyze and derive the specifics of the two major types of spread spectrum systems, Direct Sequence and Frequency Hop. Since the mechanisms by which the above advantages are achieved vary between the two methods, the analysis has been left until those sections.

III. Direct Sequence Spread Spectrum (DS-SS)


Direct Sequence Spread Spectrum (DS-SS) is the most common version of spread spectrum in use today, due to its simplicity and ease of implementation. The two major spread spectrum methods differ mainly in the way the encode the data with the PN sequence. In DS-SS, the carrier (data signal) is modulated by the PN code sequence, which is of a much higher frequency than the desired data rate. Let f be the frequency of the data signal, with appropriate pulse time T=1/f. Let the PN sequence be transmitted at a rate fc, so that the increase in the data rate is fc/f. The frequency fc is known as the chipping rate, with each individual bit in the modulating sequence known as a chip. Thus the width of each pulse in the modulating sequence is TC, or a chip time. The following figure illustrates the two signals, the data signal for one pulse width, and the PN sequence over the same time (since the PN sequence takes values of 1, the indicated PN sequence also indicates a normalized version of the signal to be transmitted).

As a result, the frequency domain will look something like the diagram shown in Figure 2.

Mathematically, the following happens. Let the data signal be D(t), transmitted at frequency f, and let the PN sequence be PN(t), with frequency fc. So the transmitted signal is

The PN sequence is designed such that it has very good autocorrelation properties:

Where N is the length of the PN sequence, therefore, when the signal is correlated with the PN sequence at the receiver, the received signal will be recovered exactly (assuming that there is synchronization between the send and receive PN sequences), i.e.

8 Now, if we allow both noise and a jamming signal J(t) with finite power distributed evenly across the frequency band, the received signal at the input to the receiver, Y(t), is

. Now, when the signal is correlated with the PN sequence, the data signal portion of Y(t) is de-spread giving us the original D(t). However, the effect of multiplying J(t) and N(t) with the signal in effect spreads the signal out to have bandwidth fc, whereas the signal D(t) now has returned to its original frequency f=1/T. So a filter following the signal correlation can recapture the signal D(t) with a reduced amount of jamming power. The jamming power that can pass through the filter is now decreased by a factor fc/f, which was introduced earlier as the processing gain GP, i.e. GP=(BWRF/BWinfo)=(fc/f). So we see that the data signal has been made immune to the effect of a malevolent third party jammer. As stated earlier, even though a factor of fC/f more noise was let into the system by the increased bandwidth, the effect of that noise was also reduced by fc/f due to the processing gain of the system, and thus the effect of WGN has not been increased by this DSSS system.

IV. Frequency-Hopped Spread Spectrum (FH-SS)


Frequency-Hopped Spread Spectrum is the other major type of spread spectrum system in use today. In FHSS, the signal itself is not spread across the entire large bandwidth; instead the wide bandwidth is divided into N sub-bands, and the signal hops from one band to the next in a pseudorandom manner. The center frequency of the signal changes from one hop to the next, changing from one sub-band to another, as shown in Figure 4.

As we can see, a large frequency band of width Nfb centered at FC has been divided into N sub-bands of width fb. The bandwidth fb must enough to transmit the data signal D(t), and at a predetermined time interval, the center frequency of the data signal is changed from one sub-band to another in a pseudorandom manner. In the example given in the diagram, the data signal hops from band N (F C+(N/2)fb f FC+(N/2)fbto band 2 to band N-2, and so on. Usually, the width of each sub-band is set so that the amount of signal that overlaps with adjacent sub-bands is minimal, and is thus approximately the bandwidth of the original data signal. Two different kinds of FH-SS are used; slow FH and fast FH. In slow FH-SS, several bits are sent for each hop, so the signal stays in a particular sub-band for a long time relative to the data rate. In fast-SS, the

9 reverse is true. The signal switches sub-bands several times for each bit transmitted, so the signal stays in a sub-band for a very short time relative to the data rate. There are people who say that slow FH is not really a spread spectrum technique, since this does not really spread the system (since the time spent in one subband is very large, the corresponding width of the band can be small, thus possibly violating the first tenet of a spread spectrum system, namely that the spread bandwidth must be much greater than the un spread bandwidth). In the fast FH case, again, the performance of the system with respect to white Gaussian Noise is not changed, as in the DS-SS case. The noise power seen at the receiver is approximately the same as that in the un-hopped case, since each sub-band is approximately the same size as the original data signals bandwidth. And just as in the DS-SS case, the effect of a jammer is decreased by the spreading of the signal. Here, if we again assume that the jamming signal J(t) is distributed uniformly over the entire band, it is clear that the only portion of the jamming signal that affects the data is the part within the band of width fb, and thus the jamming signal is reduced by the factor of the processing gain Gp which here is .

Thus in the frequency hop case, the protection afforded is equal to the number of frequency bands used. However, in this case, the best way for a jammer to disrupt the signal is NOT to spread his power equally over the entire band, but to concentrate his power among a few bands. In this case, the jammer is more effective, because he can assuredly disrupt certain bits of data. The probability of a bit being in error is then given by p=J/N, where J is the number of channels selectively jammed, and N is the number of frequencies available to the hopper, which is basically the probability that the jammer guessed which frequencies to jam correctly. This can still give high bit error rates (BER). For example, a possible scenario would be where the jammer jams 10 out of a possible 1000 frequencies, giving a highly unacceptable BER of 10-2. However, fast FH allows us to very simply decrease the BER. If we choose to have a large number of chips per bit (here a chip represents a hop), then we can use a simple majority function to determine what the bit sent was. We are assuming that the number of available hop channels is a good deal larger than the number of channels being jammed (define a successful jamming as when the power of the jamming signal is greater than or equal to that of the data signal). If the simple majority function is being used, then the formula for the error rate becomes

where c is the number of chips per bit (hops per bit), r is the number of chip errors necessary to cause a bit error (for a simple majority function, this is just c/2 rounded to the nearest integer), p is the probability of 1 bit error (J/N), and q is the probability of no error for a chip, or 1-p. By just increasing the number of chips per bit from 1 to 3 (thus r is 2) for our previous example, we find that the error rate is now

Thus by just increasing the hopping rate from once per bit to three times per bit, the bit error rate can be decreased dramatically. So the immunity to jamming provided by spread spectrum works in the FH-SS system as well, even for the clever jammer who tailors his interference to the particular system. The only

10 penalty to be paid here is the increased frequency with which the spread signal must be sent, and with the state of technology today, that is easily surmounted. The PN sequence is used here to determine the hopping sequence. So in order to transmit the signal, the data signal must be modulated up the center frequency of the band determined by the PN sequence. Therefore, the structure of the transmitter is as shown in Fig 5a. The Data signal is modulated up to the transmit frequency by the frequency produced by the frequency synthesizer, which takes as its input the output of the PN sequence generator (a band-pass filter is also required at the output of the transmitter - it was omitted to simplify the structure). The receiver structure is simply the reverse of the transmitter. The frequency synthesizer demodulates the signal down to an intermediate frequency (or base-band if desired), then the signal is filtered so only the desired data signal is passed through, and finally the signal is decoded. Again, to get multiple users using the same wide frequency band, CDMA techniques must be used.

V. Gold Sequences
Gold sequences help generate more sequences out of a pair of m-sequences giving now many more different sequences to have multiple users. Gold sequences are based on preferred pairs m-sequences. For example, take the polynomials and :

Figure: Example of gold sequence generator using one preferred pair of m-sequences:

and

Remember m-sequences gave only one sequence of length . By combining two of these sequences, we can obtain up to 31 ( ) plus the two m-sequences themselves, generate 33 sequences (each one length ) that can be used to spread different input messages (different users CDMA). The m-sequence pair plus the Gold sequences form the available sequences to use in DSSS. The wanted property about Gold codes is that they are balanced (i.e. same number of 1 and -1s).

11

TRANSMITTER BLOCK
The Transmitter part of the Matlab program had the following three basic blocks :1) Generation of the message signal using the rand function of Matlab which generates a random array of numbers and stores them in a matrix of given dimension. 2) Generation of Gold Code with the help of two PN (Pseudo Noise) sequences PN1 and PN2. 3) Modulation of the message signal generated in step 1 with the Gold Code produced in step 2 to produce the Base Band modulated signal.

MESSAGE SIGNAL

MODULATOR

BASE BAND modulated SIGNAL

GOLD CODE GENERATOR

Block Diagram of Transmitter

GENERATION of GOLD CODE sequences


The steps that were followed to generate the gold code are :-

Two PN sequences PN1 and PN2 are produced, each of 20 bit long by XORing specific following a prescribed pattern and shifting each of them continuously. For PN1 the XORing pattern was by taking bit 1, 4, 6, 7, 13, 19 For PN2 the XORing pattern was by taking bit 1, 2, 3, 5, 7, 9, 10, 13, 14, 16, 17 Each output bit from the two sequences were XORed and stored in an array called gold.

12

Modulation of the Message signal with GOLD Code


The basic idea behind modulation was that we have to replace each 0 in the 20 bit message signal with the Original Gold Code and each 1 in the message signal with the Inverted 20 bit Gold Code thus converting the 20 bot message signal into a 400 (20 x 20) bit spreaded signal. Message signal :

Gold Code:

Spreaded Signal:

RECEIVER BLOCK
What we are doing in receiver is that we are simply demodulating the received spreaded signal with the gold code to produce the original message signal. Steps for DEMODULATION are: Since both the original message signal as well as the gold code are 20 bit long, we xor each successive 20 bit of the received spreaded signal with the 20 bit gold code and store the result in an array. Since each 20 bit block of the message signal consists of either the gold code or the inverted gold code, XORing with the gold code will give us a result either 0 or 1. If the result is 0, then we store 0 in an array called despreaded_signal and if the result is 1, we store 1. The process is repeated for each set of 20 bit till all the 400 bits of the received signal are covered. The array despreaded signal ultimately gives us the original message signal.

RECEIVED SIGNAL

DEMODULATOR

MESSAGE SIGNAL

GOLD CODE GENERATOR

13

MATLAB Code for BASE BAND DSSS using Gold Code:


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BASE BAND Direct Sequence Spread Spectrum using GOLD CODE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clc; clear all; close all; %-------------------------------------------------------------------------%------------------------------TRANSMITTER----------------------%-------------------------------------------------------------------------% Generating the bit pattern with each bit 6 samples long b=round(rand(1,20)); pattern=[]; for k=1:20 if b(1,k)==0 sig=zeros(1,6); else sig=ones(1,6); end pattern=[pattern sig]; end b1=b; message = b1 message1 = pattern; subplot(3,2,1); plot(pattern); axis([-1 120 -.5 1.5]); ylabel('\bf Original Bit Sequence'); title('\bf\it TRANSMITTED MESSAGE'); %-------------------------------------------------------------------------% Generation of Gold code No. 1 G=20; % Code length K=1; % Number of Codes or code sequences %..............Generation of first PN sequence............... lsr1 =randsrc(1,20,[0 1]); PN1=[]; for j=1:G PN1=[PN1 lsr1(1)]; temp1 = xor(lsr1(4),lsr1(1)); temp2 = xor(lsr1(6),temp1); temp3 = xor(lsr1(7),temp2); temp4 = xor(lsr1(13),temp3); temp5 = xor(lsr1(19),temp4); for i=1:G-1 lsr1(i)=lsr1(i+1); %----Shifting---end lsr1(20)=temp5; end %..............Generation of Second PN sequence.............. lsr2 =randsrc(1,20,[0 1]); PN2=[]; for j=1:G PN2=[PN2 lsr2(1)]; temp1 = xor(lsr2(2),lsr1(1)); temp2 = xor(lsr2(3),temp1); temp3 = xor(lsr2(5),temp2); temp4 = xor(lsr2(7),temp3); temp5 = xor(lsr2(9),temp4); temp6 = xor(lsr2(10),temp5); temp7 = xor(lsr2(13),temp6);

14
temp8 = xor(lsr2(14),temp7); temp9 = xor(lsr2(16),temp8); temp10 = xor(lsr2(17),temp9); temp11 = xor(lsr2(19),temp10); for i=1:G-1 lsr2(i)=lsr2(i+1); %----Shifting---end lsr2(20)=temp11; end %..............Generation of Gold Codes.................... Code_Matrix=[]; for codes=1:K code=[]; for j=1:G code=[code xor(PN1(j),PN2(j))]; end Code_Matrix=[Code_Matrix code']; end gold_1 = Code_Matrix'; Gold_Code = gold_1 pattern=[]; for k=1:20 if gold_1(1,k)==0 sig=zeros(1,6); else sig=ones(1,6); end pattern=[pattern sig]; end gold = pattern; subplot(3,2,3); plot(gold); axis([-1 120 -.5 1.5]); ylabel('\bf Gold Code'); %--------------------------------------% b1 = Message Matrix (1,20) % gold_1 = Gold Matrix (1,20) %--------------------------------------% Spreading the pattern with the gold code k=1; for i=1:20 for j=1:20 spread(1,k)=xor(b1(1,i),gold_1(1,j)); k=k+1; end end spread; subplot(3,2,5); plot(spread); axis([-1 400 -.5 1.5]); ylabel('\bf Spreaded Sequence'); %-------------------------------------------------------------------------%-------------------------------------------------------------------------%--------------------------------RECEIVER---------------------------%-------------------------------------------------------------------------subplot(3,2,2); plot(spread); axis([-1 400 -.5 1.5]); ylabel('\bf Received Sequence'); title('\bf\it RECEIVED MESSAGE'); %------GOLD CODE sequence used----gold_2=gold_1; pattern=[]; for k=1:20

15
if gold_2(1,k)==0 sig=zeros(1,6); else sig=ones(1,6); end pattern=[pattern sig]; end gold = pattern; subplot(3,2,4); plot(gold); axis([-1 120 -.5 1.5]); ylabel('\bf Gold Code'); %-------Demodulation to get original message signal--------gold_2inv = xor(1,gold_2); i=1; k=1; while k < 400 s=0; for j=1:20 temp(1,j) = xor(spread(1,k),gold_2(1,j)); k=k+1; s=s+temp(1,j); end if(s==0) b2(1,i) = 0; else b2(1,i) = 1; end i=i+1; end despreaded_signal = b2 %-----Plotting Despreaded signal-----pattern=[]; for k=1:20 if b2(1,k)==0 sig=zeros(1,6); else sig=ones(1,6); end pattern=[pattern sig]; end subplot(3,2,6); plot(pattern); axis([-1 120 -.5 1.5]); ylabel('\bf Despreaded Sequence'); % Plotting the FFT of DSSS signal % figure,plot([1:400],abs(fft(spread)),[1:20],abs(fft(b2)))

16

MATLAB Simulation result:

Modulation of message signal

Waveforms for the Transmitter

17

MATLAB Simulation result:

Demodulation of received signal

Waveforms for the Receiver

18

Cross Correlation of Gold Code 1 & 2 and PN sequence 1 & 2


This part is an addition to the original aim of the project which was to generate gold code and modulate a message signal and subsequently demodulate the received signal to get the original message signal . We need cross correlation of the 2 gold codes and 2 PN sequences to judge which one is better for modulating a signal for spread spectrum base band transmission in terms of randomness and hence in terms of better noise reduction and interference. To generate the gold code we use a prescribed sequence of XOR operation for the two PN sequences. They are :For PN code 1 i.e. PN1 :- bits 1, 2, 3, 4, 7, 8 For PN code 2 i.e. PN2 :- bits 1, 3, 5, 6, 7, 8 Here in order to take a maximal length PN sequence, we have used the PN sequences as well as Gold Code of 8 bits. During Plotting we take 5 consecutive sets of both gold codes so that the ultimate cross correlation takes place between two gold codes each of 40 bit length and two PN sequences of 40 bit length.

MATLAB Code for Cross and Auto Correlation of GOLD CODE 1 & 2 and Cross correlation of PN sequence 1 & 2
%-----------------------------------------------% % CROSS and AUTO Correlation of GOLD CODE 1 & 2 % %-----------------------------------------------% clc; clear all; close all; %-------------------------------------------------------------------------% Generation of Gold codes G=8; % Code length K=2; % Number of Codes or code sequences x=[];y=[]; %..............Generation of first PN sequence............... Code_Matrix=[]; for codes=1:K lsr1 =randsrc(1,8,[0 1]); PN1=[]; for j=1:G PN1=[PN1 lsr1(1)]; temp1 = xor(lsr1(1),lsr1(2)); temp2 = xor(lsr1(3),temp1); temp3 = xor(lsr1(4),temp2); temp4 = xor(lsr1(7),temp3); temp5 = xor(lsr1(8),temp4); for i=1:G-1 lsr1(i)=lsr1(i+1); %----Shifting---end lsr1(G)=temp5; end

19
%..............Generation of Second PN sequence.............. lsr2 =randsrc(1,8,[0 1]); PN2=[]; for j=1:G PN2=[PN2 lsr2(1)]; temp1 = xor(lsr2(1),lsr1(3)); temp2 = xor(lsr2(5),temp1); temp3 = xor(lsr2(6),temp2); temp4 = xor(lsr2(7),temp3); temp5 = xor(lsr2(8),temp4); for i=1:G-1 lsr2(i)=lsr2(i+1); %----Shifting---end lsr2(G)=temp5; end code=[]; for j=1:G code=[code xor(PN1(j),PN2(j))]; end Code_Matrix=[Code_Matrix code']; if codes==1 x=code; else y=code; end end gold = Code_Matrix %-------------------------------------------------------------------------i=1; n=5; for k=1:n for j=1:8 gold_x(i)=x(j); i=i+1; end end i=1; for k=1:n for j=1:8 gold_y(i)=y(j); i=i+1; end end i=1; for k=1:n for j=1:8 PNS1(i)=PN1(j); i=i+1; end end i=1; for k=1:n for j=1:8 PNS2(i)=PN2(j); i=i+1; end end M=i-1; %---------------------------------PLOTTING---------------------------------------l1 = M-1; l2 = M-1; l=-max(l1,l2):max(l1,l2); rxy=xcorr(gold_x,gold_y); subplot(4,1,1); plot(l,rxy); title('\bf\it Cross Correlation of Gold Code 1 & 2');

20
p=-l1:l1; rxx=xcorr(gold_x); subplot(4,1,2); plot(p,rxx); title('\bf\it Auto correlation of Gold Code 1'); q=-l2:l2; ryy=xcorr(gold_y); subplot(4,1,3); plot(q,ryy); title('\bf\it Auto correlation of Gold Code 2'); p=-l1:l1; rx=xcorr(PNS1,PNS2); subplot(4,1,4); plot(l,rx); title('\bf\it Cross correlation of PN1 and PN2');

Output of Matlab program

0 0 0 1 0 0 0 1
Here,

1 1 1 1 0 0 1 1

Gold Code # 1 : 0 0 0 1 0 0 0 1 Gold Code # 1 : 1 1 1 1 0 0 1 1

21

MATLAB Simulation result:

22

CONCLUSION:
From the above results and Graphs we can safely conclude the following :

1) We have successfully generated a Gold Code of 20 bit length and modulated a message signal, also of 20 bit length with the Gold Code to produce a spreaded signal of length 400 bits. We have also successfully demodulated the spreaded signal using the same Gold Code sequence to produce the original message signal.

2) We have successfully shown the following in the graphs representing the cross correlation and auto correlation of two Gold Code sequences and cross correlation of two PN sequences : Symmetrical Auto correlation to ensure the validity of the gold codes. Better Auto correlation of the Gold Codes over the PN sequences, thus proving that Gold Code is more suitable for modulation and spreading of a message signal than the Pseudo Noise sequences.

23

Bibliography
[1] Raymond L. Pickholtz, Donald L. Schilling, Laurence B. Milstein. Theory of Spread Spectrum Communications -- A Tutorial, IEEE Transactions on Communications, Vol. COM-30, May 1982, pp. 855-884. [2] Robert C. Dixon. Spread Spectrum Communications, Second Edition, John Wiley and Sons, New York, 1984. [3] Edward A. Lee, David G. Messerchmitt, Digital Communications, Second Edition, Kluwer Academic Publishers, USA, 1994. [4] Marcus C. Wlden, Roger D. Pollard. On the Processing Gain and Pulse Compression Ratio of Frequency Hopping Spread Spectrum Waveforms, IEEE National Telesystems Conference Proceedings, 1993, pp. 215-219. [5] T.S.D. Tsui, T.G. Clarkson. Spread Spectrum Communication Techniques, Electronics and Communication Engineering Journal, Februaru 1994. [6] Laurence B. Milstein, Donal L. Schilling. The Effect of Frequency-Selective Fading on a Noncoherent FH-FSK System Operating with partial Band Tone Interference, IEEE Transactions on Communications, Vol. COM-30, May 1982, pp. 904-912.

Potrebbero piacerti anche