ex5_4.m

来自「国外教材MIMOSignalsAndSystems附带的程序」· M 代码 · 共 50 行

M
50
字号
% Example 5-4:
% Simulation of the Alamouti scheme
% With QPSK Modulation

% Ideal constellation points
d1 = 0.5*sqrt(2)*(-1-j);
d2 = 0.5*sqrt(2)*(1-j);
d3 = 0.5*sqrt(2)*(1+j);
d4 = 0.5*sqrt(2)*(-1+j);

x1 = d1;
x2 = d2;

%Set of possible symbols
XP = [d1 d2 d3 d4];

% Complex channel coefficients
h1 = 0.0707 + j*0.0707;
h2 = 0.1500 + j*0.2598;

% Complex AWGN samples
n1 = 0.0100 + j*0.0020;
n2 = -0.0030 + j*0.0030;

alpha = abs(h1)^2 + abs(h2)^2;

% Received signals
y1 = h1*x1 + h2*x2 + n1;
y2 = -h1*conj(x2) + h2*conj(x1) + n2;

% Statistics
x1t = conj(h1)*y1 + h2*conj(y2);
x2t = conj(h2)*y1 - h1*conj(y2);

for p = 1:4
   G1(p) = abs(x1t - alpha*XP(p))^2;
   G2(p) = abs(x2t - alpha*XP(p))^2;
end

[dummy, p1] = min(G1);
[dummy, p2] = min(G2);
x1h = XP(p1)
x2h = XP(p2)






⌨️ 快捷键说明

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