资源描述:
《基于某MATLAB的2FSK调制.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、2FSK一个FSK信号可以看成是两个不同载波的2ASK信号的叠加。其解调和解调方法和ASK差不多。2FSK信号的频谱可以看成是f1和f2的两个2ASK频谱的组合1FSK程序:2FSK图形(包含误码率分析):closeallclearallti=0;fpefsk=[];startn=-6;endn=18;forti=startn:endnn=1000;f1=18000000;f2=6000000;bitRate=1000000;N=50;noise=ti;signal=source(n,N);transmittedSigna
2、l=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];endfigure(8);semilogy(startn:length(fpefsk)+startn-1,fpefsk);gridon;ti
3、tle('BitErrorRateOfFSK');xlabel('r/dB');ylabel('PeFSK');loadPeRatesavePeRate.matfpefskfpeask1.随机信号的产生2.FSK信号调制3.信道加噪声后信号4.接收信号的解调5.解调出的二进制信号误码率分析附录:程序FSKclearallclosealli=10;%基带信元数j=5000;a=round(rand(1,i));%产生随机序列t=linspace(0,5,j);f1=10;%载波1频率f2=5;%载波2频率fm=i/5;%基带
4、信号频率B1=2*f1;%载波1带宽B2=2*f2;%载波2带宽%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%产生基带信号st1=t;forn=1:10ifa(n)<1;form=j/i*(n-1)+1:j/i*nst1(m)=0;endelseform=j/i*(n-1)+1:j/i*nst1(m)=1;endendendst2=t;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%基带信号求反forn=1:j;ifst1(n)>=1;st2(n)=0;elsest2(n)=1;ende
5、nd;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('
6、载波信号2');%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%调制F1=st1.*s1;%加入载波1F2=st2.*s2;%加入载波2figure(2);subplot(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;subplo
7、t(414);plot(t,fsk);title('加噪声信号')%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%相干解调st1=fsk.*s1;%与载波1相乘[f,sf1]=T2F(t,st1);%通过低通滤波器[t,st1]=lpf(f,sf1,2*fm);figure(3);subplot(311);plot(t,st1);title('与载波1相乘后波形');st2=fsk.*s2;%与载波2相[f,sf2]=T2F(t,st2);%通过低通滤波器[t,st2]=lpf(f,sf2,2
8、*fm);subplot(312);plot(t,st2);title('与载波2相乘后波形');form=0:i-1;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%抽样判决ifst1(1,m*500+250)<0.25;forj=m*500+1:(m+1)*500;at(