📄 channel_estimation.asv
字号:
function [H tx_data] =channel_estimation(Data,pilot_Data,Lh,ant_num,pilot_position,sub_num)
%Data ofdm data
%pilot_data pilot data
%N sub_num
%Lh time domain response length
%ant_num antenna number
%pilot_position
pilot_num=length(pilot_position);
F=zeros(sub_num,Lh);
f=zeros(pilot_num,Lh);
f_data=zeros(sub_num-pilot_num,Lh);
tx_data=zeros(sub_num-pilot_num,1);
R=zeros(pilot_num,1);
X=zeros(pilot_num,pilot_num,ant_num);
%%%%%%%%%%%%%%%%
d=pilot_position(2)-pilot_position(1);
temp_k=1;
pilot_k=1;
for k=1:1:sub_num
for m=1:1:Lh
F(k,m)=exp(-i*2*pi*(k-1)*(m-1)/sub_num);
end
if rem(k+3,4)==0
f(pilot_k,:)=F(k,:);
R(pilot_k,1)=Data(k);
pilot_k=pilot_k+1;
else
f_data(temp_k,:)=F(k,:);
tx_data(temp_k,1)=Data(k);
temp_k=temp_k+1;
end
end
for am=1:1:ant_num
for k=1:1:pilot_num
X(k,k,am)=pilot_Data(am,k);
end
end
if ant_num==1
G=X*f;
elseif ant_num==2
G=[X(:,:,1)*f X(:,:,2)*f];
elseif ant_num==3
G=[X(:,:,1)*f X(:,:,2)*f X(:,:,3)*f];
elseif ant_num==4
G=[X(:,:,1)*f X(:,:,2)*f X(:,:,3)*f X(:,:,4)*f];
end
ht=inv(G'*G)*G'*R;
H=zeros(sub_num-pilot_num,ant_num);
for k=1:1:ant_num
H(:,k)=f_data*ht(Lh*(k-1)+1:Lh*k,:);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -