资源简介
采用阿拉木梯的空时编码方法 BPSK调制2x2天线的配置 适用于学习空时编码
代码片段和文件信息
% script for computing the BER for BPSK modulation in a
% Rayleigh fading channel with Alamouti Space Time Block Coding
% Two transmit antenna 1 Receive antenna
clear
N = 10^6; % number of bits or symbols
Eb_N0_dB = [0:25]; % multiple Eb/N0 values
for ii = 1:length(Eb_N0_dB)
% Transmitter
ip = rand(1N)>0.5; % generating 01 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 0
% Alamouti STBC
sCode = zeros(2N);
sCode(:1:2:end) = (1/sqrt(2))*reshape(s2N/2); % [x1 x2 ...]
sCode(:2:2:end) = (1/sqrt(2))*(kron(ones(1N/2)[-1;1]).*flipud(reshape(conj(s)2N/2))); % [-x2* x1* ....]
h = 1/sqrt(2)*[randn(1N) + j*randn(1N)]; % Rayleigh channel
hMod = kron(reshape(h2N/2)ones(12)); % repeating the same channel for two symbols
n = 1/sqrt(2)*[randn(1N) + j*randn(1N)]; % white gaussian noise 0dB variance
% Channel and noise Noise addition
y = sum(hMod.*sCode1) + 10^(-Eb_N0_dB(ii)/20)*n;
% Receiver
yMod = kron(reshape(y2N/2)ones(12)); % [y1 y1 ... ; y2 y2 ...]
yMod(2:) = conj(yMod(2:)); % [y1 y1 ... ; y2* y2*...]
% forming the equalization matrix
hEq = zeros(2N);
hEq(:[1:2:end]) = reshape(h2N/2); % [h1 0 ... ; h2 0...]
hEq(:[2:2:end]) = kron(ones(1N/2
评论
共有 条评论