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

📄 alamouti.m

📁 国外大学的同志作出来的好程序
💻 M
字号:
function [st, st_rate]=alamouti(x1, x2);
%Get the Alamouti matrix.
%x1 and x2 can be vectors.
%
%
if size(x1, 1)>1 && size(x1, 2)>1 | size(x2, 1)>1 && size(x2, 2)>1,
    disp('[alamouti]Error: Input should be vectors.');
    st=[];
    return;
end
if length(x1)~=length(x2),
    disp('[alamouti]Error: Two input vector should have the same length.');
end

%make x1 and x2 vectors.
if size(x1, 2)>1,
    x1=x1.';
end
if size(x2, 2)>1,
    x2=x2.';
end

%dimension of the space-time code
%p is the number of inputs for a block per transmitter
%q is the number of outputs for a block per transmitter
%space_len is the number of transmitters
space_len=2;p=2;q=2;
time_len=q*length(x1);

%rate of the orthogonal codes.
st_rate=p/q;

%construct Alamouti matrix.
st=zeros(time_len, space_len);
index1=1:q:time_len;
index2=index1+1;
st(index1, :)=[x1 x2];
st(index2, :)=[-conj(x2) conj(x1)];

⌨️ 快捷键说明

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