Example: Convolutional Interleavers

The example below illustrates convolutional interleaving and deinterleaving using a sequence of consecutive integers. It also illustrates the inherent delay of the interleaver/deinterleaver pair.

x = [1:10]'; % Original data
delay = [0 1 2]; % Set delays of three shift registers.
[y,state_y] = muxintrlv(x,delay) % Interleave.
z = muxdeintrlv(y,delay) % Deinterleave.

In this example, the muxintrlv function initializes the three shift registers to the values [], [0], and [0 0], respectively. Then the function processes the input data [1:10]', performing internal computations as indicated in the table below.

Current InputCurrent Shift RegisterCurrent OutputContents of Shift Registers
111
[]
[0]
[0 0]
220
[]
[2]
[0 0]
330
[]
[2]
[0 3]
414
[]
[2]
[0 3]
522
[]
[5]
[0 3]
630
[]
[5]
[3 6]
717
[]
[5]
[3 6]
825
[]
[8]
[3 6]
933
[]
[8]
[6 9]
10110
[]
[8]
[6 9]

The output from the example is below.

y =

     1
     0
     0
     4
     2
     0
     7
     5
     3
    10


state_y = 

    value: {3x1 cell}
    index: 2


z =

     0
     0
     0
     0
     0
     0
     1
     2
     3
     4

Notice that the "Current Output" column of the table above agrees with the values in the vector y. Also, the last row of the table above indicates that the last shift register processed for the given data set is the first shift register. This agrees with the value of 2 for state_y.index, which indicates that any additional input data would be directed to the second shift register. You can optionally check that the state values listed in state_y.value match the "Contents of Shift Registers" entry in the last row of the table by typing state_y.value{:} in the Command Window after executing the example.

Another feature to notice about the example output is that z contains six zeros at the beginning before containing any of the symbols from the original data set. The six zeros illustrate that the delay of this convolutional interleaver/deinterleaver pair is length(delay)*max(delay) = 3*2 = 6. For more information about delays, see Delays of Convolutional Interleavers.


© 1994-2005 The MathWorks, Inc.