資源簡(jiǎn)介
直接序列擴(kuò)頻的MATLAB仿真,以及代碼對(duì)應(yīng)說明文檔,學(xué)習(xí)的下載

代碼片段和文件信息
x_code=sign(mgen(19112000)-0.5);?%PN碼
pn=rectpulse(x_code8);%每個(gè)偽碼元內(nèi)采樣8個(gè)點(diǎn)
plot(pn);
axis([0?1000?-1.5?1.5]);
title(‘偽隨機(jī)碼序列‘);
grid?on;
figure(2)
code_length=20;??%信息碼元個(gè)數(shù)
N=1:code_length;
rand(‘seed‘0);
x=sign(rand(1code_length)-0.5);??%信息碼從0、1序列變成-1、1序列
x1=rectpulse(x800);%每個(gè)碼元內(nèi)采樣800個(gè)點(diǎn)
plot(x1);
axis([0?16000?-1.5?1.5]);
title(‘信源信息碼序列‘);
grid?on;
figure(3)
gt=x1.*pn;
plot(gt);
axis([0?1000?-1.5?1.5]);
title(‘復(fù)合碼序列‘);
grid?on;
figure(4);
%用BPSK調(diào)制
%fs=20e6;??
%f0=30e6;
f0=6000;%載波頻率
fs=5*f0;%采樣頻率
for?i=1:2000
????AI=2;
????dt=fs/f0;
????n=0:dt/7:dt;???%一個(gè)載波周期內(nèi)采樣8個(gè)點(diǎn)
????cI=AI*cos(2*pi*f0*n/fs);
????x_bpsk((1+(i-1)*8):i*8)=gt((1+(i-1)*8):i*8).*cI;
end
subplot(311)
plot(x_bpsk);
axis([0?200?-2.5?2.5]);
title(‘BPSK調(diào)制后的波形‘);
grid?on;
%gt1=multipath(x_bpskfs);%調(diào)用已經(jīng)編寫好的多徑函數(shù),形成帶多徑干擾的接收信號(hào)
SNR=10;
gt1=awgn(x_bpskSNR);%加高斯白噪聲形成接收信號(hào)
%sigma=0;
%nt=sigma*randn(120);
%nt1=rectpulse(nt800);
%gt1=gt+nt1;
%fs=20e6;??
%f0=30e6;
f0=6000;%載波頻率
fs=5*f0;%采樣頻率
for?i=1:2000
????dt=fs/f0;
????n=0:dt/7:dt;???%一個(gè)載波周期內(nèi)采樣8個(gè)點(diǎn)
????cI=cos(2*pi*f0*n/fs);
????x_bpsk1((1+(i-1)*8):i*8)=gt1((1+(i-1)*8):i*8).*cI;
end
subplot(313)
plot(x_bpsk1);
axis([0?200?-2.5?2.5]);
title(‘加噪后已調(diào)波的波形‘);
grid?on;
figure(6)
?%解調(diào)
for?i=1:2000?
????dt=fs/f0;
????n=0:dt/7:dt;?%一個(gè)載波周期內(nèi)采樣八個(gè)點(diǎn)
????cI=cos(2*pi*f0*n/fs);
????s((1+(i-1)*8):i*8)=?x_bpsk1((1+(i-1)*8):i*8).*cI;
end
plot(s);
axis([0?200?-2.5?2.5]);
title(‘解調(diào)后的波形‘);
grid?on;
figure(7)
%相關(guān)解擴(kuò)
jk_code=s.*pn;
%低通濾波
wn=1/500;??
b=fir1(16wn);
H=freqz(b116000);
xx=filter(b1jk_code);
plot(xx);
axis([0?16000?-1.5?1.5]);
title(‘解擴(kuò)并濾波后的波形‘);
grid?on;
for?i=1:16000
?????if?xx(i)<0
????????xx1(i)=-1;
????else
????????xx1(i)=1;
?????end
end
%信源信息碼與收端恢復(fù)出的波形的比較
figure(8)
subplot(211);
plot(x1);
axis([0?16000?-1.5?1.5]);
title(‘信源信息碼序列‘);
grid?on;
subplot(212);
plot(xx1);
axis([0?16000?-1.5?1.5]);
title(‘收端接收到的波形‘);
grid?on;
[mn]=symerr(xx1x1);%m表示誤碼個(gè)數(shù),n表示誤碼率
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????2233??2013-05-10?14:30??擴(kuò)頻通信\kuopin2.m
?????文件????????223??2013-05-09?18:25??擴(kuò)頻通信\mgen.m
?????文件?????308224??2013-05-08?21:29??擴(kuò)頻通信\基于matlab的擴(kuò)頻通信設(shè)計(jì).doc
?????文件?????335872??2013-05-10?09:38??擴(kuò)頻通信\基于MATLAB的直接序列擴(kuò)頻通信系統(tǒng)課程設(shè)計(jì)報(bào)告.doc
?????文件?????296584??2013-05-08?21:28??擴(kuò)頻通信\直接序列擴(kuò)頻系統(tǒng)matlab仿真.doc
?????目錄??????????0??2013-05-13?15:47??擴(kuò)頻通信
-----------?---------??----------?-----??----
???????????????943136????????????????????6
評(píng)論
共有 條評(píng)論