⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 temporal_ml_2x2.m

📁 两发两收的空时分组编码OFDM系统 采用SUI5信道模型
💻 M
字号:
function [H11,H21,H12,H22]=temporal_ml_2x2(R1,R2,chantype,sampletime)
% temporal estimation for 2x2 antenna config
% R1,R2 -- received freq domain signals from Rx1 and Rx2, respectively

switch chantype,
    case 1,
        load Q_inv_sui1.mat;
        tau = [0 0.4 0.9];      % tap delay in us
    case 2,
        load Q_inv_sui2.mat;
        tau = [0 0.4 1.1];
    case 3,
        load Q_inv_sui3.mat;
        tau = [0.0 0.4 0.9];
    case 4,
        load Q_inv_sui4.mat;
        tau = [0 1.5 4];
    case 5,
      %  load Q_inv_sui5.mat;
        tau = [0 4 10];
    case 6,
        load Q_inv_sui6.mat;
        tau = [0 14 20];
    otherwise,
        error('Unknown SUI channel type!');
end
Delay = round(tau/sampletime);       % multipath delay in sample points
L=max(Delay)+1;

PwNorm=sqrt(2048/1702);
% Preamble of Tx 1 and Tx 2
load preamble_cm.mat;
t1=zeros(1,2048);
t2=zeros(1,2048);
t1=2*(0.5-preamble_cm);
t2(1:2:end)=-t1(1:2:end);
t2(2:2:end)=t1(2:2:end);
t1=t1*PwNorm;
t2=t2*PwNorm;

% -------------- Process Rx1 signal: h11, h21 -----------------
rxt1=R1.*t1;
rxt2=R1.*t2;

p1=zeros(L,1);
p2=zeros(L,1);
h11=zeros(L,1);
h21=zeros(L,1);
for loop=1:L
    WN=exp(j*2*pi/2048*(loop-1)*[0:1:2048-1]);
    
    p1(loop)=sum(rxt1.*WN);
    p2(loop)=sum(rxt2.*WN);
end
%h=Q_inv*[p1;p2];
%h11(Delay+1)=h(Delay+1); h21(Delay+1)=h(L+1+Delay);
h=[p1;p2]/2048;
h11=h(1:L); h21=h(L+1:end);
H11=fftshift(fft(h11.',2048));
H11(:,1877:2048)=[]; H11(:,1:173)=[];
H21=fftshift(fft(h21.',2048));
H21(:,1877:2048)=[]; H21(:,1:173)=[];

% -------------- Process Rx2 signal: h12, h22 -----------------
rxt1=R2.*t1;
rxt2=R2.*t2;

p1=zeros(L,1);
p2=zeros(L,1);
h12=zeros(L,1);
h22=zeros(L,1);
for loop=1:L
    WN=exp(j*2*pi/2048*(loop-1)*[0:1:2048-1]);
    
    p1(loop)=sum(rxt1.*WN);
    p2(loop)=sum(rxt2.*WN);
end
%h=Q_inv*[p1;p2];
%h12(Delay+1)=h(Delay+1); h22(Delay+1)=h(L+1+Delay);
h=[p1;p2]/2048;
h12=h(1:L); h22=h(L+1:end);
H12=fftshift(fft(h12.',2048));
H12(:,1877:2048)=[]; H12(:,1:173)=[];
H22=fftshift(fft(h22.',2048));
H22(:,1877:2048)=[]; H22(:,1:173)=[];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -