📄 lms2dchannelestimationalgorithm2.m
字号:
%----Version1.0: To Zhao for 863 Project.----%
function EstimatedChannelData = LMS2D( ...
ReceivedChannelData, ... %接收到的帧数据
FrameStruct, ... %信道帧结构参数
ChannelParameter, ... %信道参数
DetectionMaximumTapline ... %信道最强径位置
)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%本算法命名为2D-LMS,是基于OFDM蜂窝系统的二维自适应信道估计算法。
%特点:算法复杂度稍高,但性能优于目前已有的各种基于OFDM蜂窝系统
%的信道估计算法。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[nSubCarrier, nPilotSymbol] = size(ReceivedChannelData);
nSymbol = FrameStruct.N_ts * FrameStruct.N_sym_ts;
SubCarrierNumber = ChannelParameter.SubCarrierNumber;
TxAntennaNumber = ChannelParameter.TxAntennaNumber;
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);
ReceivedChannelDatabyInterp(:,(index-1) * FrameStruct.N_sym_ts + 1:index * FrameStruct.N_sym_ts) ...
= transpose(yi);
end
%最强径检测或LS-DFT
PatternDD = zeros(nSubCarrier, nSymbol);
if nargin == 4 %最强径检测
L = length(DetectionMaximumTapline);
for index = 1:L
PatternDD(DetectionMaximumTapline(index),:) = 1;
end
elseif nargin == 3 %LSDFT
PatternDD(1:nSubCarrier/4,:) = 1;
end
ReceivedChannelDataDD = ifft(ReceivedChannelDatabyInterp);
ReceivedChannelDataDD = ReceivedChannelDataDD .* PatternDD;
ReceivedChannelDataDD = fft(ReceivedChannelDataDD);
%算法参数设置
correlateTimeLength = 5;
%算法实现
EstimatedChannelData = zeros(SubCarrierNumber, nSymbol); %放置信道估计的结果
if SubCarrierNumber == nSubCarrier
EstimatedChannelData(:,1:correlateTimeLength) = ReceivedChannelDatabyInterp(:,1:correlateTimeLength);
else %对参考信号和初始(相关长度)数据进行频域插值
nTxAntenna = SubCarrierNumber/nSubCarrier;
x = TxAntennaNumber:nTxAntenna:SubCarrierNumber;
xi = 1:SubCarrierNumber;
EstimatedChannelData(:,1:correlateTimeLength) = ...
interp1(x,ReceivedChannelDatabyInterp(:,1:correlateTimeLength),xi,'spline','extrap');
ReceivedChannelDataDD = interp1(x,ReceivedChannelDataDD,xi,'spline','extrap');
end
G = ones(SubCarrierNumber, nSubCarrier * correlateTimeLength); %初始化算法迭代过程中需要的变量
G = mk_stochastic(G);
p = ReceivedChannelDatabyInterp(:,1:correlateTimeLength);
p = p(:);
power = p' * p;
step = 1 / power;
for index = correlateTimeLength + 1 : nSymbol %算法迭代过程
hEstimate = G * p;
EstimatedChannelData(:,index) = hEstimate;
e = ReceivedChannelDataDD(:,index) - hEstimate;
G = G + step * e * p';
p = ReceivedChannelDatabyInterp(:,index-correlateTimeLength+1:index);
p = p(:);
power = power - ...
ReceivedChannelDatabyInterp(:,index-correlateTimeLength)' * ReceivedChannelDatabyInterp(:,index-correlateTimeLength) ...
+ ReceivedChannelDatabyInterp(:,index)' * ReceivedChannelDatabyInterp(:,index);
step = 1 / power;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -