直序擴(kuò)頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES
《直序擴(kuò)頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES》由會(huì)員分享,可在線閱讀,更多相關(guān)《直序擴(kuò)頻通信-matlab仿真DIRECT-SEQUENCE-SPREAD-SPECTRUM-TECHNIQUES(17頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、精選優(yōu)質(zhì)文檔-----傾情為你奉上 Lab2 Direct Sequence Spread Frequency Techniques 直序擴(kuò)頻通信仿真 Content Abstract-------------------------------------------------------------------------------------------3 Experiment Background----------------------------------------------------------------------3 Experiment Pro
2、cedure------------------------------------------------------------------------5 Analysis and Conclusion---------------------------------------------------------------------10 Reference --------------------------------------------------------------------------------------10 Appendix---------------
3、-------------------------------------------------------------------------12 1. Abstract The objective of this lab experiment is to learn the fundamentals of the direct sequence spread spectrum and code division multiple address techniques. To get familiar with the dir
4、ect sequence spread spectrum modulator and demodulator. And the direct sequence spread spectrum system can be shown as: Figure 1. Direct sequence spread spectrum system 2. Experiment Background 2.1 Introduction of Direct Sequence Spread Spectrum [1] In , direct-sequence spread spect
5、rum (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 carrier signals occur over the full bandwidth (spectrum) of a device's transmitting frequency.
6、 Figure 2.1 Procedure to generate a DSSS signal 2.2 Generation of Direct Sequence Spread Spectrum To generate a spread spectrum signal one requires: 1. A modulated signal somewhere in the RF spectrum 2. A PN sequence to spread it 2.3 Features of Direct Sequence Spread Spectrum DSS
7、S 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. Therefore, the is much higher than the signal . 2. DSSS us
8、es 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 information signal. 2.4 Transmission of Direct Sequenc
9、e Spread Spectrum Direct-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 spreading the energy of the original signal
10、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 1 × 1 = 1, and ?1 × ?1 = 1). This pr
11、ocess, 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 the receiver to synchroni
12、ze its sequence with the transmitter's 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 make between them can be u
13、sed to determine relative timing, which, in turn, can be used to calculate the receiver's 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 longer PN sequence
14、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 in no processing
15、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-shaped envelo
16、pe 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 in a uni
17、form frequency distribution whose width is determined by the output range of the pseudo-random number generator. 3. Experiment Procedure 3.1. Generate the pseudo random numbers sequences (m sequence) with a polynomial as following The polynomial is corresponding to the LFSR of the Figure
18、3.1, where denotes a connection. Figure 3.1 Linear feedback shift register As the polynomial shows, we can get the LFSR in this experiment with 14 orders (n=14). Figure 3.2 n=15 LFSR As Figure 3.2 shows, the feedback output has a relationship with the registers. Hence, we can get the l
19、ongest m sequence as. In 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
20、 waveform of M sequences and message (input data) as follows: Figure 3.3 Input message data waveform Figure 3.4 M sequences waveform In 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
21、, which are easy to produce the BPSK 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 (
22、0,1) and -1 at the interval (1,2), the d(t) is reversed 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 sig
23、nal of spreading sequences d(t). In this experiment, I take the 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
24、 between the transmitter and receiver. 3.4. In an AWGN channel to transmit the BPSK signal. First of all, I get the AWGN signal as follow Figure 3.7 AWGN signal We can find that the AWGN signal has large number of harmonics and it’s power spectral density is uniform and it’s amplitude dist
25、ribution obeys the Gauss distribution. In our transmitting channel, I add the noise to 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 AWGN 3.4. Recover our message data b(t) Firstly, I use two synchronized circuit
26、to despread and demodulate the receiving signal. Then I use a matching filter to take the value at the 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 dif
27、ferences. 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 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 la
28、st time will be Tb, to be inverse, the recovery bit will be -1. Here I can find that the output signal in our receiver is the same as that in transmitter. Figure 3.11 Output signal on the receiver 4. Analysis and Conclusion 4.1. Spectrum Spread Digital communication has played a
29、more important role than analog communication. In digital communication, the fastest speed of data transmission is seen to be the bandwidth of digital 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, b
30、ecause of the Shannon theorem: B is the bandwidth of frequency spectrum. Obviously, when I enlarge the capacity, the bandwidth will be wider. This is also the reason I use the high baud rate m sequence to spread the message data bandwidth. 4.2. Matching Filter In this experiment, the matchi
31、ng 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 we know, in fact, matching filter is just like an autocorrelation calculating function. 4.3. The advantages of m sequence (double polar)
32、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 that in this experiment, . This is very good for the multichannel processing. In CDMA system, I take orthogonal code to encode d
33、ifferent users’ message data. However, the characteristics of cross-correlation and autocorrelation of orthogonal code is bad for the multichannel systems. In order to improve this phenomenon, I should multiple m sequences to the orthogonal codes. APPENDIX Some Parts of Matlab Codes I. DSSS
34、 (main function) clear; %the PAM input digital sequence and the first input of PN producer p=[1 0 1 1 0 1 1 1 0 1 1 0 0];%get 0 1 0 0 1 pn_in=[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0];%get 0 0 0 0 0 0 0 0 0 0 0 %the period of input signal Tb=1; %the period of PN sequence signal Tc=1/256; %produce
35、 the PN sequence pn_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 spreading frequcecy operation b_dou=PN_Signal(p_dou,pn_dou,Tb,
36、Tc); %the synchronization of PN p_syn=PN_Syn(p_dou,pn_dou,Tb,Tc); %the carry signal period T_carry=1/512; %get the carry signal by PSK wc=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); %plot(tpsk,psks); %axis([0 1.6 -2 2]
37、); %grid on; %add the noise to the PSK signal by AWGN in_signal=awgn(psks,10);%the SNR is 20 %fs=b1-1; %N=400; %FSpectrum(in_signal,fs,N); %plot(tpsk,in_signal); %the recovery signal signal_corr=Signal_Recover(in_signal,tpsk,p_syn,wc,Tc,Tb); II. PN_Producer (produce the m-sequence) fu
38、nction 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 1 [l_min,l_max]=size(m_sq(1).c); n=2; %the first digit of m-sequence pn_out(1)=m_sq(2).a(1); %the m-sequence producer for shifting first time m_
39、sq(2).a(l_max)=m_sq(1).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; 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-
40、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 whether the m-sequence becomes back to the original sequence if isequal(m_sq(3).a,m_sq(1).a) pn_check=1; else pn_check=0; end %the whole shifting operation and produce the PN while pn_check==0 m_sq
41、(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).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
42、(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 code for i4=1:1:(n-2) y(i4)=pn_out(i4);
43、 end end III. 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 c>0 for j=0:1:c pn_in=horzcat(pn_in,pn_original); end else pn_
44、in=pn_in; end s1=1; e1=N; for i=1: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 end end end
45、 IV. 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:2 for i=1:1:b start1=(i-1)*Tb; end1=i*Tb;%Tb is the period of PN sequence Tcs(i).s=linspace(start1,end1,50); if x(i)==
46、1 c_sq(i).s=sin(wc*Tcs(i).s); else c_sq(i).s=(-1)*sin(wc*Tcs(i).s); end end 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 end V. PN_Syn (generate the synchronized PN sequence) function y=PN_S
47、yn(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 c>0 for j=0:1:c pn_in=horzcat(pn_in,pn_original); end else pn_in=pn_in; end s1=1; e1=N; for i=1:1:b for m=s1:1:e1 y(m)=pn_in(m);
48、 s1=1+N*i; e1=N+N*i; end end end VI. Signal_Recover (receiver) function y=Signal_Recover(x,tpsk,pn_syn,wc,Tb,Tc) m_signal=sin(wc*tpsk); [t_sqr,pn_syn_sqr]=square_wave(pn_syn,Tb); c_psk=x.*pn_syn_sqr; N=fix(Tc/Tb); [a2,b2]=size(tpsk); t_gap=b2/50/N; m
49、id=50*N; for i2=1:1:mid t_corr_mid(i2)=tpsk(i2); end [t_corr,t_corr_mid]=corr_x(t_corr_mid,Tb,N); for k=1:1:t_gap for k2=1:1:(50*N) k3=k2+(k-1)*50*N; in_psk(k).s(k2)=c_psk(k3); in_sin(k).s(k2)=m_signal(k3); end ym=xcorr(in_psk(k).s,in_sin(k).s);
50、 %[t_corr,t_corr_mid]=corr_x(t_corr_mid,Tb,N); if ym(mid)>0 y(k)=1; else y(k)=0; end if k==2 plot(t_corr,ym,'g*:'); axis([0 2 -2000 2000]); hold on; grid on; %elseif k==3 %plot(t_corr,ym,'mx:'); %axis([0 12.8 -2000 2000]);
51、%hold on; %grid on; else disp('nice'); end end end VII. square_wave (generate the square wave signal) function [fss,sqrs]=square_wave(p,g) %square wave sampling frequency fs(1).s=linspace(0,g,50); [a,b]=size(p); %discrete ones in different time point for i=1:1:(b-
52、1) if p(i)==1 sqr_p(i).s=ones(1,50); else sqr_p(i).s=(-1)*ones(1,50); end fs(i+1).s=linspace(0+g*i,g+g*i,50); end %the last time interval if p(b)==1 sqr_p(b).s=ones(1,50); else sqr_p(b).s=(-1)*ones(1,50); end fss=fs(1).s; sqrs=sqr_p(1).s;
53、 for i2=1:1:(b-1) fss=horzcat(fss,fs(i2+1).s); sqrs=horzcat(sqrs,sqr_p(i2+1).s); end end VIII. zero_double (cover the single polar signal to the double polar signal) function y=zero_double(x) [a,b]=size(x); for i=1:1:b if x(i)==0 y(i)=-1; else y(i)=x(i); end end end 專心---專注---專業(yè)
- 溫馨提示:
1: 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 6.煤礦安全生產(chǎn)科普知識(shí)競(jìng)賽題含答案
- 2.煤礦爆破工技能鑒定試題含答案
- 3.爆破工培訓(xùn)考試試題含答案
- 2.煤礦安全監(jiān)察人員模擬考試題庫(kù)試卷含答案
- 3.金屬非金屬礦山安全管理人員(地下礦山)安全生產(chǎn)模擬考試題庫(kù)試卷含答案
- 4.煤礦特種作業(yè)人員井下電鉗工模擬考試題庫(kù)試卷含答案
- 1 煤礦安全生產(chǎn)及管理知識(shí)測(cè)試題庫(kù)及答案
- 2 各種煤礦安全考試試題含答案
- 1 煤礦安全檢查考試題
- 1 井下放炮員練習(xí)題含答案
- 2煤礦安全監(jiān)測(cè)工種技術(shù)比武題庫(kù)含解析
- 1 礦山應(yīng)急救援安全知識(shí)競(jìng)賽試題
- 1 礦井泵工考試練習(xí)題含答案
- 2煤礦爆破工考試復(fù)習(xí)題含答案
- 1 各種煤礦安全考試試題含答案