



免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
实现信道估计算法的matlab仿真clear all;%close all;i=sqrt(-1);Rayleigh=1;AWGN=0; % for AWGN channel MMSE=0; % estimation techniqueNsc=64; % Number of subcarriersNg=16; % Cyclic prefix lengthSNR_dB=0 5 10 15 20 25 30 35 40;% Signal to noise ratioMt=2; % Number of Tx antennasMr=2; % Number of Rx antennaspilots=1:Nsc/Ng:Nsc; % pilot subcarriers DS=5; % Delay spread of channeliteration_max=200;% Channel impulse response %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); for k=1:N Tc=c(k)*cos(2*pi*fd(k)*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);for snrl=1:length(SNR_dB) snrl estimation_error1=zeros(Mt*Mr,Nsc); estimation_error2=zeros(Mt*Mr,Nsc); R1=besselj(0,2*pi*fm*(Nsc+Ng)/B); sigma2=10(-SNR_dB(snrl)/10); aa=(1-R12)/(1-R12+sigma2); bb=sigma2*R1/(1-R12+sigma2); for iteration=1:iteration_max %iteration if AWGN=1 h=ones(Mt*Mr,1); else 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); % channel length data_time=zeros(Mt,Nsc+Ng); data_qam=zeros(Mt,Nsc); data_out=zeros(Mr,Nsc); output=zeros(Mr,Nsc); for tx=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_b(1, :)-3)+. 2*(mod(data_b(3, :)+data_b(4,:),2)+2*data_b(3,:)-3; for loop=1:Mt data_qam(tx,pilots+loop-1)=(1+j)*(loop=tx); % pilots end data_time_temp=ifft(data_qam(tx,:); data_time(tx,:)=data_time_temp(end-Ng+1:end) data_time_temp; end for rx=1:Mr for tx=1:Mt output_temp=conv(data_time(tx,:),h(rx-1)*Mt+tx,:); output(rx,:)=output_temp(Ng+1:Ng+Nsc)+output(rx,:); end np=(sum(abs(output(rx,:).2)/length(output(rx,:)*sigma2; noise=(randn(size(output(rx,:)+i*randn(size(output(rx,:)*sqrt(np); output(rx,:)=output(rx,:)+noise; data_out(rx,:)=fft(output(rx,:); end% Channel estimation % H_act=zeros(Mt*Mr,Nsc); H_est1=zeros(Mt*Mr,Nsc); H_est2=zeros(Mt*Mr,Nsc); i=1; for tx=1:Mt for rx=1:Mr H_est_temp=data_out(rx,pilots+tx-1)./data_qam(tx,pilots+tx-1); %H_est_temp2=aa*abs(H_est_temp1)+bb*abs(H_est2(rx-1)*Mt+tx,:); h_time=ifft(H_est_temp); h_time=h_time zeros(1,Nsc-length(h_time); H_est1(rx-1)*Mt+tx,:)=fft(h_time); H_est2(rx-1)*Mt+tx,:)=(aa*abs(H_est1(rx-1)*Mt+tx,:)+bb*abs(H_est2(rx-1)*Mt+tx,:). .*H_est1(rx-1)*Mt+tx,:)./abs(H_est1(rx-1)*Mt+tx,:); if (tx1) H_est1(rx-1)*Mt+tx,:)=H_est1(rx-1)*Mt+tx,Nsc-tx+2:Nsc) H_est1(rx-1)*Mt+tx,1:Nsc-tx+1); H_est2(rx-1)*Mt+tx,:)=H_est2(rx-1)*Mt+tx,Nsc-tx+2:Nsc) H_est2(rx-1)*Mt+tx,1:Nsc-tx+1); end H_act(rx-1)*Mt+tx,:)=fft(h(rx-1)*Mt+tx,:) zeros(1,Nsc-CL); error1=(abs(H_act(rx-1)*Mt+tx,:)-H_est1(rx-1)*Mt+tx,:).2); error2=(abs(H_act(rx-1)*Mt+tx,:)-H_est2(rx-1)*Mt+tx,:).2); %error=(abs(H_act(rx-1)*Mt+tx,:)-H_est(rx-1)*Mt+tx,:).2)./(abs(H_act(rx-1)*Mt+tx,:).2); estimation_error1(rx-1)*Mt+tx,:)=estimation_error1(rx-1)*Mt+tx,:)+error1; estimation_error2(rx-1)*Mt+tx,:)=estimation_error2(rx-1)*Mt+tx,:)+error2; %subplot(Mt*Mr,3,i),plot(0:Nsc-1,abs(H_act(rx-1)*Mt+tx,:); i=i+1; %subplot(Mt*Mr,3,i),plot(0:Nsc-1,abs(H_est(rx-1)*Mt+tx,:); i=i+1; %subplot(Mt*Mr,3,i),plot(0:Nsc-1,abs(error); i=i+1; end end end estimation_error1=estimation_error1/iteration_max; estimation_error2=estimation_error2/iteration_max; %estimation_error=min(estimation_error,10*iteration_max*ones(size(estimation_error); %for i=1:Mt*Mr % subplot(Mt*Mr,2,2*i-1),plot(0:Nsc-1,estimation_error1(i,:); % subplot(Mt*Mr,2,2*i),plot(0:Nsc-1,estimation_error2(i,:); %end MEE1(snrl)=sum(sum(estimation_error1)/(Mt*Mr*Nsc); MEE2(snrl)=sum(sum(estimation_error2)/(Mt*Mr*Nsc);endplot(SNR_dB,10*log10(MEE1); hold on;plot(SNR_dB,10*log10(MEE2),r);%H_act=fft(h_zeros(1,Nsc-CL).;error1=(abs(H_act-H_est1).2)./(abs(H_act).2);error2=(abs(H_act-H_est2).2)./(abs(H_act).2);% Plots %fig=4;i=1;subplot(fig,1,i),plot(0:length(H_act)-1,abs(H_act); i=i+1;subplot(fig,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年事业单位工勤技能-湖北-湖北收银员三级(高级工)历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-湖北-湖北保健按摩师四级(中级工)历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-海南-海南垃圾清扫与处理工五级(初级工)历年参考题库含答案解析
- 2025年绿色金融债券市场发行风险控制与投资策略分析报告
- 2025年事业单位工勤技能-河南-河南计算机信息处理员一级高级技师历年参考题库典型考点含答案解析
- 2025年事业单位工勤技能-河南-河南热处理工二级(技师)历年参考题库含答案解析
- 2025年事业单位工勤技能-河南-河南护理员三级(高级工)历年参考题库典型考点含答案解析
- 2024版重组的婚姻离婚协议书
- 2024版合同管理优化建议
- 2025年事业单位工勤技能-河北-河北水工监测工四级(中级工)历年参考题库含答案解析(5套)
- 老服务伦理与礼仪讲课文档
- DB61T1730-2023公路路面煤矸石基层施工技术规范
- 第四章 土地估价方法-成本法
- GB/T 43198-2023食品包装用聚乙烯吹塑容器
- 从力的做功到平面向量数量积说课稿省名师优质课赛课获奖课件市赛课百校联赛优质课一等奖课件
- 骨科常见体位和摆放课件
- 中国传统文化概论绪论
- 这么写网约车事故索赔误工费的起诉状更容易胜诉
- 固体废物污染环境防治法课件
- 2022年高校教师资格证(高等教育学)考试题库评估300题有解析答案(四川省专用)
- 精装修安全文明施工方案
评论
0/150
提交评论