LMS2DChannelEstimationAlgorithm.m
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:3k
源码类别:

传真(Fax)编程

开发平台:

Matlab

  1. %----Version1.0: To Zhao for 863 Project.----%
  2. function EstimatedChannelData = LMS2DChannelEstimationAlgorithm(   ...
  3.                                 ReceivedChannelData,     ... %接收到的帧数据
  4.                                 FrameStruct,             ... %信道帧结构参数
  5.                                 DetectionMaximumTapline ... %信道最强径位置
  6.                                 )
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8. %本算法命名为2D-LMS,是基于OFDM蜂窝系统的二维自适应信道估计算法。
  9. %特点:算法复杂度稍高,但性能优于目前已有的各种基于OFDM蜂窝系统
  10. %的信道估计算法。
  11. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  12. [nSubCarrier, nPilotSymbol] = size(ReceivedChannelData);
  13. nSymbol = FrameStruct.N_ts * FrameStruct.N_sym_ts;
  14. nPilotinSlot = length(FrameStruct.Pos);
  15. if(nPilotinSlot * FrameStruct.N_ts ~= nPilotSymbol)
  16.     errordlg('输入信道数据和帧结构不一致!');
  17.     EstimatedChannelData = [];
  18.     return
  19. end
  20. %根据导频信道进行插值
  21. ReceivedChannelDatabyInterp = zeros(nSubCarrier, nSymbol);
  22. xi = 1:FrameStruct.N_sym_ts;
  23. for index = 1:FrameStruct.N_ts
  24.     yi = interp1(FrameStruct.Pos,transpose(ReceivedChannelData(:,(index-1) * nPilotinSlot + 1:index * nPilotinSlot)),xi,'linear');
  25.     ReceivedChannelDatabyInterp(:,(index-1) * FrameStruct.N_sym_ts + 1:index * FrameStruct.N_sym_ts) ...
  26.        = transpose(yi);
  27. end
  28. %最强径检测或LS-DFT
  29. PatternDD = zeros(nSubCarrier, nSymbol);
  30. if nargin == 3 %最强径检测
  31.         L = length(DetectionMaximumTapline);
  32.         for index = 1:L
  33.             PatternDD(DetectionMaximumTapline(index),:) = 1;
  34.         end
  35. elseif nargin == 2 %LSDFT
  36.         PatternDD(1:nSubCarrier/4,:) = 1;
  37. end
  38. ReceivedChannelDataDD = ifft(ReceivedChannelDatabyInterp);
  39. ReceivedChannelDataDD = ReceivedChannelDataDD .* PatternDD;
  40. ReceivedChannelDataDD = fft(ReceivedChannelDataDD);
  41. % 根据Doppler计算相关OFDM符号个数算法参数设置
  42. % 假设200Hz Doppler时,相关时间取5; 1000Hz Doppler时,相关时间取2。其余按照线性关系取。
  43. correlateTimeLength = round( -3/800 * FrameStruct.fd + 23/4 );
  44. %correlateTimeLength = 6 ;
  45. %算法实现
  46. EstimatedChannelData = zeros(nSubCarrier, nSymbol); %放置信道估计的结果
  47. G = ones(nSubCarrier, nSubCarrier * correlateTimeLength); %初始化算法迭代过程中需要的变量
  48. G = mk_stochastic(G);
  49. p = ReceivedChannelDatabyInterp(:,1:correlateTimeLength);            % 步长参数用插值后的信道响应计算   
  50. p = p(:);
  51. step = 1 / (p' * p);
  52. for index = correlateTimeLength + 1 : nSymbol %算法迭代过程
  53.     
  54.     hEstimate = G * p;
  55.     
  56.     EstimatedChannelData(:,index) = hEstimate;      
  57.     
  58.     e = ReceivedChannelDataDD(:,index) - hEstimate;         % 误差信号用LS-DFT STC 改进的信道估计做参考信道
  59.     
  60.     G = G + step * e * p';
  61.     
  62.     p = ReceivedChannelDatabyInterp(:,index-correlateTimeLength+1:index);    % 步长参数用插值后的信道响应计算         
  63.     p = p(:);
  64.     
  65.     step = 1 / (p' * p);
  66.     
  67. end
  68. % 前面correlateTimeLength + 3个OFDM符号的估计用LS-DFT STC代替
  69. EstimatedChannelData(:,1:correlateTimeLength + 3) = ReceivedChannelDataDD(:,1:correlateTimeLength + 3);