📄 vblast_encoder.m
字号:
function [encoder_output,Padding_Bit_Length] = vblast_encoder(Tx_n, encoder_input)
% Tx_n : the Tx antenna number
% encoder_input :bit stream of 0, 1
% if the length of encoder_input is not multiple of Tx_n,
% it will be padded with 0
% encoder_output's size is[Tx_n, length(encoder_input)/Tx_n)
%------------------------------------------------------------
%for debug
%Tx_n = 2;
%encoder_input = ones(1,100);
%encoder_input(2:3:end) = 2;
%encoder_input(3:3:end) = 3;
%end debug
%------------------------------------------------------------
input_length = length(encoder_input);
temp = mod(input_length, Tx_n);
if temp == 0
column_num = input_length / Tx_n;
Padding_Bit_Length = 0;
else
column_num = (input_length - temp) / Tx_n + 1;
Padding_Bit_Length = Tx_n - temp;
encoder_input(input_length+1 : input_length+Padding_Bit_Length) = 0;
end
encoder_output = zeros(Tx_n, column_num);
for col = 1:column_num
for row = 1:Tx_n
encoder_output(row, col) = encoder_input((col-1)*Tx_n + row);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -