LMS2DChannelEstimationAlgorithm.m
资源名称:MIMO-OFDM.rar [点击查看]
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:3k
源码类别:
传真(Fax)编程
开发平台:
Matlab
- %----Version1.0: To Zhao for 863 Project.----%
- function EstimatedChannelData = LMS2DChannelEstimationAlgorithm( ...
- ReceivedChannelData, ... %接收到的帧数据
- FrameStruct, ... %信道帧结构参数
- DetectionMaximumTapline ... %信道最强径位置
- )
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %本算法命名为2D-LMS,是基于OFDM蜂窝系统的二维自适应信道估计算法。
- %特点:算法复杂度稍高,但性能优于目前已有的各种基于OFDM蜂窝系统
- %的信道估计算法。
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- [nSubCarrier, nPilotSymbol] = size(ReceivedChannelData);
- nSymbol = FrameStruct.N_ts * FrameStruct.N_sym_ts;
- nPilotinSlot = length(FrameStruct.Pos);
- if(nPilotinSlot * FrameStruct.N_ts ~= nPilotSymbol)
- errordlg('输入信道数据和帧结构不一致!');
- EstimatedChannelData = [];
- return
- end
- %根据导频信道进行插值
- ReceivedChannelDatabyInterp = zeros(nSubCarrier, nSymbol);
- xi = 1:FrameStruct.N_sym_ts;
- for index = 1:FrameStruct.N_ts
- yi = interp1(FrameStruct.Pos,transpose(ReceivedChannelData(:,(index-1) * nPilotinSlot + 1:index * nPilotinSlot)),xi,'linear');
- ReceivedChannelDatabyInterp(:,(index-1) * FrameStruct.N_sym_ts + 1:index * FrameStruct.N_sym_ts) ...
- = transpose(yi);
- end
- %最强径检测或LS-DFT
- PatternDD = zeros(nSubCarrier, nSymbol);
- if nargin == 3 %最强径检测
- L = length(DetectionMaximumTapline);
- for index = 1:L
- PatternDD(DetectionMaximumTapline(index),:) = 1;
- end
- elseif nargin == 2 %LSDFT
- PatternDD(1:nSubCarrier/4,:) = 1;
- end
- ReceivedChannelDataDD = ifft(ReceivedChannelDatabyInterp);
- ReceivedChannelDataDD = ReceivedChannelDataDD .* PatternDD;
- ReceivedChannelDataDD = fft(ReceivedChannelDataDD);
- % 根据Doppler计算相关OFDM符号个数算法参数设置
- % 假设200Hz Doppler时,相关时间取5; 1000Hz Doppler时,相关时间取2。其余按照线性关系取。
- correlateTimeLength = round( -3/800 * FrameStruct.fd + 23/4 );
- %correlateTimeLength = 6 ;
- %算法实现
- EstimatedChannelData = zeros(nSubCarrier, nSymbol); %放置信道估计的结果
- G = ones(nSubCarrier, nSubCarrier * correlateTimeLength); %初始化算法迭代过程中需要的变量
- G = mk_stochastic(G);
- p = ReceivedChannelDatabyInterp(:,1:correlateTimeLength); % 步长参数用插值后的信道响应计算
- p = p(:);
- step = 1 / (p' * p);
- for index = correlateTimeLength + 1 : nSymbol %算法迭代过程
- hEstimate = G * p;
- EstimatedChannelData(:,index) = hEstimate;
- e = ReceivedChannelDataDD(:,index) - hEstimate; % 误差信号用LS-DFT STC 改进的信道估计做参考信道
- G = G + step * e * p';
- p = ReceivedChannelDatabyInterp(:,index-correlateTimeLength+1:index); % 步长参数用插值后的信道响应计算
- p = p(:);
- step = 1 / (p' * p);
- end
- % 前面correlateTimeLength + 3个OFDM符号的估计用LS-DFT STC代替
- EstimatedChannelData(:,1:correlateTimeLength + 3) = ReceivedChannelDataDD(:,1:correlateTimeLength + 3);