Main Content

convdeintrlv

R2026b

Restore ordering of symbols using shift registers

Description

deintrlvd = convdeintrlv(data,nrows,slope) restores the ordering of elements in data by using a set of nrows internal shift registers. slope is the register length step.

To use this function as an inverse of the convintrlv function, use the same nrows and slope inputs in both functions. In that case, the two functions are inverses in the sense that applying convintrlv followed by convdeintrlv leaves data unchanged, after you take their combined delay of (nrows×(nrows–1)×slope) into account. For information about delays, see Delays of Convolutional Interleaving and Deinterleaving.

example

[deintrlvd,state] = convdeintrlv(data,nrows,slope) returns a structure that holds the final state of the shift registers.

[deintrlvd,state] = convdeintrlv(data,nrows,slope,init_state) initializes the shift registers with the symbols contained in init_state.value and directs the first input symbol to the shift register referenced by init_state.index.

Examples

collapse all

When you use a convolutional interleaver followed by a corresponding convolutional deinterleaver, the internal registers in the interleaver and deinterleaver cause a delay in the recovered data output from the deinterleaver. To compare the two data sets directly, you must take the delay into account by using appropriate truncating or padding operations.

Typical ways to compensate for a delay of D in an interleaver/deinterleaver pair include:

  • Approach 1 — Interleave a version of the original data that is padded with D extra symbols at the end. Before comparing the original data with the recovered data, omit the first D symbols of the recovered data. In this approach, no data is lost. All the original symbols appear in the recovered data.

  • Approach 2 — Before comparing the original data with the recovered data, omit the last D symbols of the original data and the first D symbols of the recovered data. In this approach, data is lost. Some of the original symbols are left in the shift registers of the deinterleaver and do not appear in the recovered data.

This code illustrates these approaches by computing a symbol error rate for the interleaving/deinterleaving operation and the length of the recovered data vector.

Configure simulation

Generate a signal to interleave. Define interleaver parameters and compute the delay of the interleaver and deinterleaver pair. Create an error rate computation object.

x = randi([0 63],20,1);
nrows = 3; slope = 2;
D = nrows*(nrows-1)*slope;
errRate = comm.ErrorRate(ReceiveDelay=D);

Approach 1

To flush all data out of the shift registers, pad x with D extra symbols at the end before interleaving.

x_padded = [x; zeros(D,1)];

a1 = convintrlv(x_padded,nrows,slope);
b1 = convdeintrlv(a1,nrows,slope);

Omit input padding and the first D symbols of the recovered data and compare.

servec1 = errRate(x_padded,b1);
ser1 = servec1(1);

Approach 2

Interleave x instead of x_padded to omit last D symbols of the input signal and first D symbols of the recovered data

release(errRate);
a2= convintrlv(x,nrows,slope);
b2 = convdeintrlv(a2,nrows,slope);

Omit the last D symbols of the original data and the first D symbols of the recovered data and compare.

servec2 = errRate(x,b2);
ser2 = servec2(1);

Display the symbol error rates and length of the deinterleaved output vector for the two approaches. The zero values of ser1 and ser2 indicates correct alignment of the original and recovered data before computing the symbol error rates. The output vectors result in different amounts of deinterleaved data.

fprintf('Symbol Error Rate for Approach 1: %.4f\n',ser1);
Symbol Error Rate for Approach 1: 0.0000
fprintf('Length of recovered data for Approach 1: %d\n',length(b1));
Length of recovered data for Approach 1: 32
fprintf('Symbol Error Rate for Approach 2: %.4f\n',ser2);
Symbol Error Rate for Approach 2: 0.0000
fprintf('Length of recovered data for Approach 2: %d\n',length(b2));
Length of recovered data for Approach 2: 20

Input Arguments

collapse all

Interleaved signal, specified as a vector or matrix. If data is a matrix with multiple rows and columns, the function processes the columns independently.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32
Complex Number Support: Yes

Number of internal shift registers, specified as a positive integer. For more information, see Delays of Convolutional Interleaving and Deinterleaving.

Register length step, specified as a positive integer. For more information, see Delays of Convolutional Interleaving and Deinterleaving.

Initial state of registers, typically specified by using the state output from a previous call to this same function. The initial state of registers is unrelated to the corresponding interleaver.

Output Arguments

collapse all

Deinterleaved data, returned with the same dimensions and data type as the input data.

Final state of the shift registers after the previous call to this function, returned as a structure with these fields:

Unshifted symbols, returned as a vector.

Index of the next register to be shifted, returned as a positive integer.

More About

collapse all

References

[1] Heegard, Chris and Stephen B. Wicker. Turbo Coding. Boston: Kluwer Academic Publishers, 1999.

Version History

Introduced before R2006a