Main Content


Restore ordering of symbols permuted using helintrlv


[deintrlved,state] = heldeintrlv(data,col,ngrp,stp)
[deintrlved,state] = heldeintrlv(data,col,ngrp,stp,init_state)
deintrlved = heldeintrlv(data,col,ngrp,stp,init_state)


[deintrlved,state] = heldeintrlv(data,col,ngrp,stp) restores the ordering of symbols in data by placing them in an array row by row and then selecting groups in a helical fashion to place in the output, deintrlved. data must have col*ngrp elements. If data is a matrix with multiple rows and columns, it must have col*ngrp rows, and the function processes the columns independently. state is a structure that holds the final state of the array. state.value stores input symbols that remain in the col columns of the array and do not appear in the output.

The function uses the array internally for its computations. The array has unlimited rows indexed by 1, 2, 3,..., and col columns. The function initializes the top of the array with zeros. It then places col*ngrp symbols from the input into the next ngrp rows of the array. The function places symbols from the array in the output, intrlved, placing ngrp symbols at a time; the kth group of ngrp symbols comes from the kth column of the array, starting from row 1+(k-1)*stp. Some output symbols are default values of 0 rather than input symbols; similarly, some input symbols are left in the array and do not appear in the output.

[deintrlved,state] = heldeintrlv(data,col,ngrp,stp,init_state) initializes the array with the symbols contained in init_state.value instead of zeros. The structure init_state is typically the state output from a previous call to this same function, and is unrelated to the corresponding interleaver. In this syntax, some output symbols are default values of 0, some are input symbols from data, and some are initialization values from init_state.value.

deintrlved = heldeintrlv(data,col,ngrp,stp,init_state) is the same as the syntax above, except that it does not record the deinterleaver's final state. This syntax is appropriate for the last in a series of calls to this function. However, if you plan to call this function again to continue the deinterleaving process, the syntax above is more appropriate.

Using an Interleaver-Deinterleaver Pair

To use this function as an inverse of the helintrlv function, use the same col, ngrp, and stp inputs in both functions. In that case, the two functions are inverses in the sense that applying helintrlv followed by heldeintrlv leaves data unchanged, after you take their combined delay of col*ngrp*ceil(stp*(col-1)/ngrp) into account. To learn more about delays of convolutional interleavers, see Delays of Convolutional Interleavers.


Because the delay is an integer multiple of the number of symbols in data, you must use heldeintrlv at least twice (possibly more times, depending on the actual delay value) before the function returns results that represent more than just the delay.


Recover interleaved data, taking into account the delay of the interleaver-deinterleaver pair.

col = 4; ngrp = 3; stp = 2; % Helical interleaver parameters
% Compute the delay of interleaver-deinterleaver pair.
delayval = col * ngrp * ceil(stp * (col-1)/ngrp);

len = col*ngrp; % Process this many symbols at one time.
data = randi([0 9],len,1); % Random symbols
data_padded = [data; zeros(delayval,1)]; % Pad with zeros.

% Interleave zero-padded data.
[i1,istate] = helintrlv(data_padded(1:len),col,ngrp,stp);
[i2,istate] = helintrlv(data_padded(len+1:2*len),col,ngrp, ...
i3 = helintrlv(data_padded(2*len+1:end),col,ngrp,stp,istate);

% Deinterleave.
[d1,dstate] = heldeintrlv(i1,col,ngrp,stp);
[d2,dstate] = heldeintrlv(i2,col,ngrp,stp,dstate);
d3 = heldeintrlv(i3,col,ngrp,stp,dstate);

% Check the results.
d0 = [d1; d2; d3]; % All the deinterleaved data
d0_trunc = d0(delayval+1:end); % Remove the delay.
ser = symerr(data,d0_trunc)

The output below shows that no symbol errors occurred.

ser =


Version History

Introduced before R2006a

See Also