www.pudn.com > space-timecodingBrankaVuceticJinhongYuan.rar > trellis_encoder.m, change:2004-03-10,size:1253b


function enc_data = trellis_encoder(data,dlt,slt) 
 
%************************************************************************** 
%   Space-time trellis channel encoder 
%   Q = TRELLIS_ENCODER(D,DLT,SLT) performs the data (D) encoding based on  
%   the DLT and SLT look-up tables. The tables for AT&T space-time codes  
%   these tables may be easily obtained from the LTABLE function. In fact  
%   the structure of look-up tables is as general as possible.  
%   The encoder doesn't care about the content of the look-up tables.  
%   This feature allows you to force the encoder's operation mode into  
%   the arbitrary scheme. Even an encoding based on block codes may be 
%   performed using the space function. This is when the slt table is 
%   filled with equal entries.  
%************************************************************************** 
 
[fr_length,l,frames] = size(data); 
 
s = 1; % setting up initial state 
 
for k = 1:frames 
	for i = 1:fr_length   
		d = data(i,1,k) + 1; % data_dim=1       % stc encoder                       
    enc_data(i,:,k) = dlt(s,d,:) ;              % stc encoder 
    s = slt(s,d,:)  ;                           % stc encoder 
    end                                         % stc encoder 
 
end