?? get_x_pinv_2x2.m
字號:
function get_X_pinv_2x2(chantype,sampletime)
% get Pseudoinverse of X
% X: time domain transimitter matrix
PwNorm=sqrt(2048/1702);
switch chantype,
case 1, % SUI-1 Channel
tau = [0 0.4 0.9]; % tap delay in us
case 2, % SUI-2 Channel
tau = [0 0.4 1.1];
case 3, % SUI-3 Channel
tau = [0.0 0.4 0.9];
case 4, % SUI-4 Channel
tau = [0 1.5 4];
case 5, % SUI-5 Channel
tau = [0 4 10];
case 6, % SUI-6 Channel
tau = [0 14 20];
otherwise,
error('Unrecognized channel model');
end
L=max(round(tau/sampletime))+1;
% -----------2x2 MIMO Preamble-----------
load Wk_preamble.mat;
preamdata_tx1=zeros(1,1703);
preamdata_tx2=zeros(1,1703);
preamdata_tx1(2:2:end)=sqrt(2)*sqrt(2)*2*(0.5-Wk_preamble(2:2:end)); % first sqrt(2)--3 dB Boost, second sqrt(2)-- unitary symbol power
preamdata_tx2(1:2:end)=sqrt(2)*sqrt(2)*2*(0.5-Wk_preamble(1:2:end)); % Antenna 1 use even subcarriers, Antenna 2 use odd ones
preamdata_tx1(852)=0; % DC carrier
preamdata_tx2(852)=0;
pream_tx1_freq=[zeros(1,173),preamdata_tx1,zeros(1,172)]*PwNorm;
pream_tx2_freq=[zeros(1,173),preamdata_tx2,zeros(1,172)]*PwNorm;
% IFFT
pream_tx1_time=sqrt(2048)*ifft(fftshift(pream_tx1_freq),2048);
pream_tx2_time=sqrt(2048)*ifft(fftshift(pream_tx2_freq),2048);
% Generate Tx 1 convolutional matrix
x1_row=[pream_tx1_time(1),pream_tx1_time(end:-1:end-L+2)];
x1_column=pream_tx1_time;
x1=toeplitz(x1_column,x1_row);
% Generate Tx 2 convolutional matrix
x2_row=[pream_tx2_time(1),pream_tx2_time(end:-1:end-L+2)];
x2_column=pream_tx2_time;
x2=toeplitz(x2_column,x2_row);
X=[x1,x2];
X_pinv=pinv(X);
switch chantype,
case 1, % SUI-1 Channel
save X_pinv_sui1.mat X_pinv;
case 2, % SUI-2 Channel
save X_pinv_sui2.mat X_pinv;
case 3, % SUI-3 Channel
save X_pinv_sui3.mat X_pinv;
case 4, % SUI-4 Channel
save X_pinv_sui4.mat X_pinv;
case 5, % SUI-5 Channel
save X_pinv_sui5.mat X_pinv;
case 6, % SUI-6 Channel
save X_pinv_sui6.mat X_pinv;
otherwise,
error('Unrecognized channel model');
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -