直序擴頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES_第1頁
直序擴頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES_第2頁
直序擴頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES_第3頁
直序擴頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES_第4頁
直序擴頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES_第5頁
已閱讀5頁,還剩12頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、精選優質文檔-傾情為你奉上精選優質文檔-傾情為你奉上專心-專注-專業專心-專注-專業精選優質文檔-傾情為你奉上專心-專注-專業Lab2 Direct Sequence Spread Frequency Techniques直序擴頻通信仿真ContentAbstract-3Experiment Background-3Experiment Procedure-5Analysis and Conclusion-10Reference -10Appendix-121. Abstract The objective of this lab experiment is to learn the fund

2、amentals of the direct sequence spread spectrum and code division multiple address techniques. To get familiar with the direct sequence spread spectrum modulator and demodulator. And the direct sequence spread spectrum system can be shown as:Figure 1. Direct sequence spread spectrum system2. Experim

3、ent Background2.1 Introduction of Direct Sequence Spread Spectrum 1In , direct-sequence spread spectrum (DSSS) is a technique. As with other technologies, the transmitted signal takes up more than the information signal that is being modulated. The name spread spectrum comes from the fact that the c

4、arrier signals occur over the full bandwidth (spectrum) of a devices transmitting frequency.Figure 2.1 Procedure to generate a DSSS signal2.2 Generation of Direct Sequence Spread SpectrumTo generate a spread spectrum signal one requires: 1. A modulated signal somewhere in the RF spectrum 2. A PN seq

5、uence to spread it2.3 Features of Direct Sequence Spread SpectrumDSSS has some features as following:1. DSSS a with a continuous of (PN) symbols called , each of which has a much shorter duration than an information . That is, each information bit is modulated by a sequence of much faster chips. The

6、refore, the is much higher than the signal .2. DSSS uses a structure in which the sequence of chips produced by the transmitter is known a priori by the receiver. The receiver can then use the same to counteract the effect of the PN sequence on the received signal in order to reconstruct the informa

7、tion signal.2.4 Transmission of Direct Sequence Spread SpectrumDirect-sequence spread-spectrum transmissions multiply the data being transmitted by a noise signal. This noise signal is a pseudorandom sequence of 1 and 1 values, at a frequency much higher than that of the original signal, thereby spr

8、eading the energy of the original signal into a much wider band. The resulting signal resembles , like an audio recording of static. However, this noise-like signal can be used to exactly reconstruct the original data at the receiving end, by multiplying it by the same pseudorandom sequence (because

9、 1 1 = 1, and 1 1 = 1). This process, known as de-spreading, mathematically constitutes a of the transmitted PN sequence with the PN sequence that the receiver believes the transmitter is using.For de-spreading to work correctly, the transmit and receive sequences must be synchronized. This requires

10、 the receiver to synchronize its sequence with the transmitters sequence via some sort of timing search process. However, this apparent drawback can be a significant benefit: if the sequences of multiple transmitters are synchronized with each other, the relative synchronizations the receiver must m

11、ake between them can be used to determine relative timing, which, in turn, can be used to calculate the receivers position if the transmitters positions are known. This is the basis for many .The resulting effect of enhancing on the channel is called . This effect can be made larger by employing a l

12、onger PN sequence and more chips per bit, but physical devices used to generate the PN sequence impose practical limits on attainable processing gain.If an undesired transmitter transmits on the same channel but with a different PN sequence (or no sequence at all), the de-spreading process results i

13、n no processing gain for that signal. This effect is the basis for the (CDMA) property of DSSS, which allows multiple transmitters to share the same channel within the limits of the properties of their PN sequences.As this description suggests, a plot of the transmitted waveform has a roughly bell-s

14、haped envelope centered on the carrier frequency, just like a normal transmission, except that the added noise causes the distribution to be much wider than that of an AM transmission.In contrast, pseudo-randomly re-tunes the carrier, instead of adding pseudo-random noise to the data, which results

15、in a uniform frequency distribution whose width is determined by the output range of the pseudo-random number generator.3. Experiment Procedure3.1. Generate the pseudo random numbers sequences (m sequence) with a polynomial as followingThe polynomial is corresponding to the LFSR of the Figure 3.1, w

16、here denotes a connection.Figure 3.1 Linear feedback shift registerAs the polynomial shows, we can get the LFSR in this experiment with 14 orders (n=14).Figure 3.2 n=15 LFSRAs Figure 3.2 shows, the feedback output has a relationship with the registers.Hence, we can get the longest m sequence as. In

17、this experiment, I take the message data rate as 1bit/s, which means Tb=1. Here, the input sequence is initialized as (1 0 1 1 0 1 1 1 0 1 1 0 0). I take the PN sequence data rate as Tc=1/64bit/s, because the spreading gain is 64, in another word, Tb/Tc=64. And I can get the waveform of M sequences

18、and message (input data) as follows:Figure 3.3 Input message data waveformFigure 3.4 M sequences waveformIn this experiment, in fact, both message data and m sequences are single polar codes. In Matlab we use a simple function to change them into double polar codes, which are easy to produce the BPS

19、K signal (phase reversing).3.2. Generate a spreading signal d(t), and the producing formula as following:Here we can get the waveform of d(t) comparing to b(t) and c(t). Figure 3.5 c(t) (red) and d(t) (green)Because b(t) equals 1 at the interval (0,1) and -1 at the interval (1,2), the d(t) is revers

20、ed at the interval (1,2) as Figure 3.5 shows. Now, I have get the spreading sequences d(t) with the data rate as 64bits/s.3.3. Modulate the spreading sequences d(t) to be the BPSK signal By using the formula of BPSK, I can get the BPSK signal of spreading sequences d(t).In this experiment, I take th

21、e carrier frequency as 128Hz. I can get the BPSK waveform as Figure 3.6.Figure 3.6 BPSK of d(t)At the same time, I should keep a PN sequence signal that has the same length as the spreading signal d(t) to keep the synchronization between the transmitter and receiver.3.4. In an AWGN channel to transm

22、it the BPSK signal.First of all, I get the AWGN signal as followFigure 3.7 AWGN signalWe can find that the AWGN signal has large number of harmonics and its power spectral density is uniform and its amplitude distribution obeys the Gauss distribution. In our transmitting channel, I add the noise to

23、the BPSK signal and I take the SNR equals 10. Then I get the signal as shown in Figure 3.8.Figure 3.8 BPSK signal adding AWGN3.4. Recover our message data b(t)Firstly, I use two synchronized circuit to despread and demodulate the receiving signal. Then I use a matching filter to take the value at th

24、e time Tb. Figure 3.9 Matching filter (1)Figure 3.10 Matching filter (2)As we can see, because of the effect of AWGN, in each Tb time interval, the matching filter output has some differences. However, I can still get the nearly maximum and minimum value at the time points Tb+n*Tb (N=1,2,3,.,N and N

25、 equals the length of the message data).Secondly, I do the judgment for maximum and minimum value. Obviously, the y(Tb) get the maximum value, the recovery bit will be 1 and the last time will be Tb, to be inverse, the recovery bit will be -1. Here I can find that the output signal in our receiver i

26、s the same as that in transmitter.Figure 3.11 Output signal on the receiver4. Analysis and Conclusion4.1. Spectrum SpreadDigital communication has played a more important role than analog communication. In digital communication, the fastest speed of data transmission is seen to be the bandwidth of d

27、igital channel, which is also called the capacity of the channel. We can know that the larger the capacity, the stronger the ability of anti-interference, because of the Shannon theorem:B is the bandwidth of frequency spectrum. Obviously, when I enlarge the capacity, the bandwidth will be wider. Thi

28、s is also the reason I use the high baud rate m sequence to spread the message data bandwidth.4.2. Matching FilterIn this experiment, the matching filter is achieved by using a simple function in Matlab which is xcorr. This is a function used to calculate the cross-correlation of two sequences. As w

29、e know, in fact, matching filter is just like an autocorrelation calculating function.4.3. The advantages of m sequence (double polar)The characteristic of autocorrelation of m sequence is very good. I can know it from the following result.I can find that when the N is very large which is just like

30、that in this experiment, . This is very good for the multichannel processing. In CDMA system, I take orthogonal code to encode different users message data. However, the characteristics of cross-correlation and autocorrelation of orthogonal code is bad for the multichannel systems. In order to impro

31、ve this phenomenon, I should multiple m sequences to the orthogonal codes.APPENDIXSome Parts of Matlab CodesI. DSSS (main function)clear;%the PAM input digital sequence and the first input of PN producerp=1 0 1 1 0 1 1 1 0 1 1 0 0;%get 0 1 0 0 1pn_in=1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;%get 0 0 0 0 0 0 0

32、0 0 0 0%the period of input signalTb=1;%the period of PN sequence signalTc=1/256;%produce the PN sequencepn_sq=PN_Producer(pn_in);pn_dou=zero_double(pn_sq);p_dou=zero_double(p);%square wave%x1,y1=square_wave(p_dou,Tb);%a2,b2=size(x1); %x2,y2=square_wave(pn_dou,Tc);%plot(x1,y1);%get the signal after

33、spreading frequcecy operationb_dou=PN_Signal(p_dou,pn_dou,Tb,Tc);%the synchronization of PNp_syn=PN_Syn(p_dou,pn_dou,Tb,Tc);%the carry signal periodT_carry=1/512;%get the carry signal by PSKwc=2*pi*1/T_carry;psks,tpsk=PSK_Producer(b_dou,wc,Tc);a1,b1=size(tpsk);fs=b1-1;N=400;FSpectrum(psks,fs,N);%plo

34、t(tpsk,psks);%axis(0 1.6 -2 2);%grid on;%add the noise to the PSK signal by AWGNin_signal=awgn(psks,10);%the SNR is 20%fs=b1-1;%N=400;%FSpectrum(in_signal,fs,N);%plot(tpsk,in_signal);%the recovery signalsignal_corr=Signal_Recover(in_signal,tpsk,p_syn,wc,Tc,Tb);II. PN_Producer (produce the m-sequence

35、)function y=PN_Producer(x) m_sq(1).a=x;m_sq(2).a=x;m_sq(1).c=1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 ;%get1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 get1 1 0 0 1l_min,l_max=size(m_sq(1).c);n=2;%the first digit of m-sequencepn_out(1)=m_sq(2).a(1);%the m-sequence producer for shifting first timem_sq(2).a(l_max)=m_sq(1).

36、c(2)*m_sq(1).a(l_max-1);for i=1:1:(l_max-2) if m_sq(2).a(l_max)=(m_sq(1).c(2+i)*m_sq(1).a(l_max-i-1) m_sq(2).a(l_max)=0; else m_sq(2).a(l_max)=1; endend for j=0:1:(l_max-2) m_sq(2).a(1+j)=m_sq(2).a(2+j); end for j1=1:1:(l_max-1) m_sq(3).a(j1)=m_sq(2).a(j1);end pn_out(n)=m_sq(2).a(1);n=n+1;%to check

37、whether the m-sequence becomes back to the original sequenceif isequal(m_sq(3).a,m_sq(1).a) pn_check=1;else pn_check=0;end%the whole shifting operation and produce the PNwhile pn_check=0 m_sq(2).a(l_max)=m_sq(1).c(2)*m_sq(2).a(l_max-1); for i=1:1:(l_max-2) if m_sq(2).a(l_max)=(m_sq(1).c(2+i)*m_sq(2)

38、.a(l_max-i-1) m_sq(2).a(l_max)=0; else m_sq(2).a(l_max)=1; end end for j=0:1:(l_max-2) m_sq(2).a(1+j)=m_sq(2).a(2+j); end for j1=1:1:(l_max-1) m_sq(3).a(j1)=m_sq(2).a(j1); end pn_out(n)=m_sq(3).a(1); if isequal(m_sq(3).a,m_sq(1).a) pn_check=1; else pn_check=0; end n=n+1;end%return the PN codefor i4=

39、1:1:(n-2) y(i4)=pn_out(i4);end endIII. PN_Signal (generate the signal after spreading spectrum)function y=PN_Signal(p,pn_in,Tb,Tc) N=fix(Tb/Tc);a,b=size(p);a1,b1=size(pn_in);c=fix(b*N/b1)pn_original=pn_in; if c0 for j=0:1:c pn_in=horzcat(pn_in,pn_original); endelse pn_in=pn_in;end s1=1;e1=N; for i=1

40、:1:b if p(i)=1 for m=s1:1:e1 y(m)=pn_in(m); s1=1+N*i; e1=N+N*i; end else for m=s1:1:e1 y(m)=p(i)*pn_in(m); s1=1+N*i; e1=N+N*i; end endend endIV. PSK_Producer (generate the BPSK signal)function y,z=PSK_Producer(x,wc,Tb) a,b=size(x);%sampling the PSK signal and produce them the N is 1:2for i=1:1:b sta

41、rt1=(i-1)*Tb; end1=i*Tb;%Tb is the period of PN sequence Tcs(i).s=linspace(start1,end1,50); if x(i)=1 c_sq(i).s=sin(wc*Tcs(i).s); else c_sq(i).s=(-1)*sin(wc*Tcs(i).s); endend y=c_sq(1).s;z=Tcs(1).s; for j=1:1:(b-1) y=horzcat(y,c_sq(j+1).s); z=horzcat(z,Tcs(j+1).s);end endV. PN_Syn (generate the synchronized PN sequence)function y=PN_Syn(p,pn_in,Tb,Tc) N=fix(Tb/Tc);a,b=size(p);a1,b1=size(pn_in);c=fix(b*N/b1);pn_original=pn_in; if c0 for j=0:1:c pn_in=horzcat(pn_in,pn_original); endelse pn_in=pn_in;end s1=1;e1=N; for i=1:1:b for m=s1:1:e1 y(m)=pn_in(m); s1=1+N*i; e1=N+N*i; endend

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論