⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bpskgood.m

📁 bpsk调制解调M文件
💻 M
字号:
sr=256000.0;
ml=1;
br=sr.*ml;
nd=1000;
ebn0=0.001;
IPOINT=8;
irfn=21;
alfs=0.5;
[xh]=hrollfcoef(irfn,IPOINT ,sr,alfs,1);
[xh2]=hrollfcoef(irfn,IPOINT,sr,alfs,0);
for  i=1:1:10000
    data=rand(1,nd)>0.5;
    data1=(data.*2)-1;
    [data2]=oversamp(data1,nd,IPOINT);
    data3=conv(data2,xh);
    spow=sum(data3.*data3)/nd;
    attn=0.5*spow*sr/br*10.^(-ebn0/10);
    attn=sqrt(attn);
    inoise=randn(1,length(data3)).*attn;
    data4=data3+inoise;
    data5=conv(data4,xh2);
    sampl=irfn*IPOINT+1;
    data6=data5(sampl:8:8*nd+sampl-1);
    demodata=data6>0;
    noe2=sum(abs(data-demodata));
    nod2=length(data);
    ber=noe2/nod2;
    shu(1,i)=ber;
    ebn0=ebn0+0.001;
    %fprintf('%d\t%e\n',i,shu);
end
x=0.001:0.001:10;
y=shu;
n=3;
p=polyfit(x,y,n);
xi=linspace(0,1,1000);
z=polyval(p,xi);
plot(x,y,'o',xi,z,'k:',x,y,':r');
%legend('原始数据','3阶曲线')


%fprintf('%d\t%d\t%d\t%e\n',ebn0,noe2,nod2,noe2/nod2);
%fid=fopen('BERbpskfad.dat','a');
%fprintf(fid,'%d\t%e\t%f\t%f\t\n',ebn0,noe2,nod2,noe2/nod2);
%fclose(fid);





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -