%------------------
%系统参数设置
%-----------------
T_start=0;%开始时间
T_stop=10;%截止时间
T=T_stop-T_start;%仿真持续时间
T_sample=1/1000;%采样间隔
f_sample=1/T_sample; % 采样速率
N_sample=T/T_sample;% 采样点数
n=0:N_sample-1;
r_s=100;%transmission rate
alpha=0.25;%df=alpha*rs=25Hz
NumBits=T*r_s;%number of bits
NumCoff=40;%number of coefficients of RRC
SamplingIns=NumCoff/2;
SamplingStart=NumCoff;
%-------------------------------
%Transmitter
%-------------------------------
g_T=firrcos(NumCoff,r_s/2,alpha*r_s,f_sample);%transmission filter
b1=sign(rand(1,NumBits)-0.5);%original bits
b2=zeros(f_sample/r_s,NumBits);
b2(1,:)=b1;
b3=reshape(b2,1,f_sample/r_s*NumBits);
s=conv(b3,g_T);%transmitted signal
%--------------------------------
%AWGN channel
%--------------------------------
N_0=10^(-9);
noise_w=wgn(1,length(s),N_0*f_sample,'linear');%产生白噪声
r=s+noise_w;
%figure(1)
%plot(s)
%hold on
%plot(r)
%-
现代通信原理A.5:数字基带传输系统误码性能仿真
最新推荐文章于 2023-10-12 13:31:34 发布