?? sttrellis.m
字號(hào):
function [x1 x2 bin] = stTrellis(G)
% Create space time trellis structure
% G : generator matrix
%
% x1 : matrix of current states trellis
% x2 : matrix of next states trellis
% bin : matrix of binary bits order: 0,1,2,... 2^col
%
%
% Copyright Bagawan S. Nugroho, 2006
[row col] = size(G);
% M-ary, QPSK
m = 4;
% Initialize the trellis
N = 2^col;
bin = zeros(1, col);
x = zeros(N, 2);
% Generate the trellis
for i = 1:N
% Get the binary vector with type of char and convert into numeric
b = int8(dec2bin(i - 1)) - 48;
% Fill-in into size(1, col) vector
bin(i, col - length(b) + 1:col) = b;
% Get the trellis output
x(i,:) = mod((bin(i,:) * G'), 4);
end
% States trellis
x1 = (reshape((x(:,1))', m, N/m))';
x2 = (reshape((x(:,2))', m, N/m))';
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -