📄 stbcg2_rx.m
字号:
function [Svest,Gest,shat]=stbcG2_rx(rx,H)
%This is modified version code G2. Here the rx data has already been
%determined. This is b/c this routine can be run multiple times and we don't
%want to keep genearation new random data.
%Routine that preforms simulations based on PSK Mary modulation
%and using coding scheme G2.
%G2 : | x1 x2 |
% | -x2* x1* |
%rx is the received data
%H is the ESTIMATED channel matrix
%soft are
global nTx nRx Mary Smap
%Initialize vectory
shat = zeros(nTx,1);
soft = zeros(nTx,Mary);
%Demodulate
%Detecting s1 and s2, minimize decision metric
S1=0; S2=0; Hnorm=0;
for j=1:nRx,
S1 = S1 + rx(j,1)*H(j,1)' + rx(j,2)'*H(j,2);
S2 = S2 + rx(j,1)*H(j,2)' - rx(j,2)'*H(j,1);
Hnorm = Hnorm + H(j,:)*H(j,:)';
end
for L=1:Mary
Con = (-1 + Hnorm) * Smap(L) * Smap(L)';
%For s1
soft(1,L) = soft(1,L) + real( (S1 - Smap(L))*(S1 - Smap(L))' + Con);
%For s2
soft(2,L) = soft(2,L) + real( (S2 - Smap(L))*(S2 - Smap(L))' + Con);
end
%Choose symbols that minimize the est_* vectors
%Decide in favour of min value
[A,B]=min(soft(1,:));
shat(1)=B;
[A,B]=min(soft(2,:));
shat(2)=B;
%Form coding matrix G from estimated symbols
%G2 : | x1 x2 |
% | -x2* x1* |
[Svest]=psk_gen(Mary,shat);
Gest = [ Svest(1) -Svest(2)';
Svest(2) Svest(1)'];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -