?? ber_fsk.m
字號(hào):
%Programme to plot the BER performance curves for coherent and non-coherent
%binary FSK.
%Written by Andrew Bateman.
%set up figure numbers and location on the screen
figure(1)
close
h=figure('position',[90 341 394 369],'color',[1,1,0]);
h=axes('position',[100,331,404,379],'color',[0,1,0]);
clf
%initialise vectors
Pcohfsk=[];
Pnoncfsk=[];
xaxis1=[];
xaxis2=[];
%Calculate BER results
for j = 1:100
i=j/5;
EbNo=10^(i/10);
cohfsk= 0.5*(erfc(sqrt(EbNo/2)));
if cohfsk < 1e-6, ,break, end
Pcohfsk(j)=cohfsk;
xaxis1(j)=i;
end
for j = 1:100
i=j/5;
EbNo=10^(i/10);
noncfsk=0.5*exp(-EbNo/2);
if noncfsk < 1e-6, ,break, end
Pnoncfsk(j)=noncfsk;
xaxis2(j)=i;
end
figure(1)
semilogy(xaxis1,Pcohfsk,'-g','linewidth',2);
hold on
semilogy(xaxis2,Pnoncfsk,'-y','linewidth',2);
title('BER curves for FSK')
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -