《基于某MATLAB的2FSK调制.doc》由会员分享,可在线阅读,更多相关《基于某MATLAB的2FSK调制.doc(10页珍藏版)》请在课桌文档上搜索。
1、word2FSK一个信号可以看成是两个不同载波的2ASK信号的叠加。其解调和解调方法和ASK差不多。2FSK信号的频谱可以看成是f1和f2的两个2ASK频谱的组合1FSK程序:2FSK图形(包含误码率分析):close allclear allti=0;fpefsk=;startn=-6;endn=18;for ti=startn:endnn=1000;f1=18000000;f2=6000000;bitRate=1000000;N=50;noise=ti;signal=source(n,N);transmittedSignal=fskModu(signal,bitRate,f1,f2,N);
2、signal1=gussian(transmittedSignal,noise);configueSignal=demoFSK(signal1,bitRate,f1,f2,N);configueSignal;P=CheckRatePe(signal,configueSignal,n)fpefsk=fpefsk,P;endfigure(8);semilogy(startn:length(fpefsk)+startn-1,fpefsk);grid on;title(Bit Error Rate Of FSK);xlabel(r/dB);ylabel(PeFSK);load PeRatesave P
3、eRate.mat fpefsk fpeask1.随机信号的产生2.FSK信号调制3.信道加噪声后信号4.接收信号的解调5.解调出的二进制信号误码率分析附录:程序FSKclear all close all 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; for n=1:10 if a(n)=1; st2(n)=0; else st2(n)=1; end end
4、; figure(1); subplot(411); plot(t,st1); title(基带信号); axis(0,5,-1,2); subplot(412); plot(t,st2); title(基带信号反码); axis(0,5,-1,2); %载波信号s1=cos(2*pi*f1*t) s2=cos(2*pi*f2*t) subplot(413),plot(s1); title(载波信号1); subplot(414),plot(s2); title(载波信号2); %调制F1=st1.*s1;%参加载波1 F2=st2.*s2;%参加载波2 figure(2); subplot(
5、411); plot(t,F1); title(s1*st1); subplot(412); plot(t,F2); title(s2*st2); e_fsk=F1+F2; subplot(413); plot(t,e_fsk); title(2FSK信号) nosie=rand(1,j); fsk=e_fsk+nosie; subplot(414); plot(t,fsk); title(加噪声信号) %相干解调st1=fsk.*s1;%与载波1相乘f,sf1 = T2F(t,st1);%通过低通滤波器t,st1 = lpf(f,sf1,2*fm); figure(3); subplot(3
6、11); plot(t,st1); title(与载波1相乘后波形); st2=fsk.*s2;%与载波2相f,sf2 = T2F(t,st2);%通过低通滤波器t,st2 = lpf(f,sf2,2*fm); subplot(312); plot(t,st2); title(与载波2相乘后波形); for m=0:i-1; %抽样判决if st1(1,m*500+250)0.25; for j=m*500+1:(m+1)*500; at(1,j)=0; end else for j=m*500+1:(m+1)*500; at(1,j)=1; end end end; subplot(313); plot(t,at); axis(0,5,-1,2); title(抽样判决后波形)10 / 10