完整版基于MATLAB的2FSK调制Word格式.docx
《完整版基于MATLAB的2FSK调制Word格式.docx》由会员分享,可在线阅读,更多相关《完整版基于MATLAB的2FSK调制Word格式.docx(9页珍藏版)》请在冰豆网上搜索。
endn
n=1000;
f1=18000000;
f2=6000000;
bitRate=1000000;
N=50;
noise=ti;
signal=source(n,N);
transmittedSignal=fskModu(signal,bitRate,f1,f2,N);
signal1=gussian(transmittedSignal,noise);
configueSignal=demoFSK(signal1,bitRate,f1,f2,N);
configueSignal;
P=CheckRatePe(signal,configueSignal,n)
fpefsk=[fpefsk,P];
end
figure(8);
semilogy(startn:
length(fpefsk)+startn-1,fpefsk);
gridon;
title('
BitErrorRateOfFSK'
);
xlabel('
r/dB'
ylabel('
PeFSK'
loadPeRate
savePeRate.matfpefskfpeask
1.随机信号的产生
2.FSK信号调制
3.信道加噪声后信号
4.接收信号的解调
5.解调出的二进制信号
误码率分析
附录:
程序
FSK
clearall
closeall
i=10;
%基带信号码元数
j=5000;
a=round(rand(1,i));
%产生随机序列
t=linspace(0,5,j);
f1=10;
%载波1频率
f2=5;
%载波2频率
fm=i/5;
%基带信号频率
B1=2*f1;
%载波1带宽
B2=2*f2;
%载波2带宽
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%产生基带信号
st1=t;
forn=1:
10
ifa(n)<
1;
form=j/i*(n-1)+1:
j/i*n
st1(m)=0;
end
else
st1(m)=1;
end
st2=t;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%基带信号求反
j;
ifst1(n)>
=1;
st2(n)=0;
st2(n)=1;
end;
figure
(1);
subplot(411);
plot(t,st1);
基带信号'
axis([0,5,-1,2]);
subplot(412);
plot(t,st2);
基带信号反码'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%载波信号
s1=cos(2*pi*f1*t)
s2=cos(2*pi*f2*t)
subplot(413),plot(s1);
载波信号1'
subplot(414),plot(s2);
载波信号2'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%调制
F1=st1.*s1;
%加入载波1
F2=st2.*s2;
%加入载波2
figure
(2);
plot(t,F1);
s1*st1'
plot(t,F2);
s2*st2'
e_fsk=F1+F2;
subplot(413);
plot(t,e_fsk);
2FSK信号'
)
nosie=rand(1,j);
fsk=e_fsk+nosie;
subplot(414);
plot(t,fsk);
加噪声信号'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%相干解调
st1=fsk.*s1;
%与载波1相乘
[f,sf1]=T2F(t,st1);
%通过低通滤波器
[t,st1]=lpf(f,sf1,2*fm);
figure(3);
subplot(311);
与载波1相乘后波形'
st2=fsk.*s2;
%与载波2相
[f,sf2]=T2F(t,st2);
[t,st2]=lpf(f,sf2,2*fm);
subplot(312);
与载波2相乘后波形'
form=0:
i-1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%抽样判决
ifst1(1,m*500+250)<
0.25;
forj=m*500+1:
(m+1)*500;
at(1,j)=0;
else
at(1,j)=1;
subplot(313);
plot(t,at);
抽样判决后波形'
)