资源描述:
《实现信道估计算法的matlab仿真》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实现信道估计算法的matlab仿真clearall;%closeall;i=sqrt(-1);Rayleigh=1;AWGN=0; %forAWGNchannelMMSE=0; %estimationtechniqueNsc=64; %NumberofsubcarriersNg=16; %CyclicprefixlengthSNR_dB=[051015202530354
2、0]; %SignaltonoiseratioMt=2; %NumberofTxantennasMr=2; %NumberofRxantennaspilots=[1:Nsc/Ng:Nsc]; %pilotsubcarriersDS=5; %Delayspreadofchanneliteration_max=200;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Channeli
3、mpulseresponse%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if(Rayleigh) N=50; fm=100; B=20e3; fd=(rand(1,N)-0.5)*2*fm; theta=randn(1,N)*2*pi; c=randn(1,N); c=c/sum(c.^2); t=0:fm/B:10000*fm/B; Tc=zeros(size(t)); Ts=zeros(size(t)); fork=1:N Tc=c(k)*cos(2*pi*fd(k)*
4、t+theta(k))+Tc; Ts=c(k)*sin(2*pi*fd(k)*t+theta(k))+Ts; end r=ones(Mt*Mr,1)*(Tc.^2+Ts.^2).^0.5; index=floor(rand(Mt*Mr,DS)*5000+1);endMEE1=zeros(1,length(SNR_dB));MEE2=zeros(1,length(SNR_dB));forsnrl=1:length(SNR_dB) snrl estimation_error1=zeros(Mt*Mr,Nsc
5、); estimation_error2=zeros(Mt*Mr,Nsc); R1=besselj(0,2*pi*fm*(Nsc+Ng)/B); sigma2=10^(-SNR_dB(snrl)/10); aa=(1-R1^2)/(1-R1^2+sigma2); bb=sigma2*R1/(1-R1^2+sigma2); foriteration=1:iteration_max %iteration ifAWGN==1 h=ones(Mt*Mr,1); els
6、e phi=rand*2*pi; h=r(index+iteration)*exp(j*phi); %h=rand(Mt*Mr,DS); h=h.*(ones(Mt*Mr,1)*(exp(-0.5).^[1:)S])); h=h./(sqrt(sum(abs(h).^2,2))*ones(1,DS)); end CL=size(h,2); %channellength
7、 data_time=zeros(Mt,Nsc+Ng); data_qam=zeros(Mt,Nsc); data_out=zeros(Mr,Nsc); output=zeros(Mr,Nsc); fortx=1:Mt data_b=0*round(rand(4,Nsc)); %data data_qam(tx,:)=j*(2*(mod(data_b(1,:)+data_b(2,:),2)+2*data
8、_b(1,:))-3)+... 2*(mod(data_b(3,:)+data_b(4,:),2)+2*data_b(3,:))-3; forloop=1:Mt data_qam(tx,pilots+loop-1)=(1+j)*(loop==tx); %pilots