| Communications Toolbox |  |
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
Input | Current
Shift Register | Current Output | Contents of Shift Registers |
| 1 | 1 | 1 | |
| 2 | 2 | 0 | |
| 3 | 3 | 0 | |
| 4 | 1 | 4 | |
| 5 | 2 | 2 | |
| 6 | 3 | 0 | |
| 7 | 1 | 7 | |
| 8 | 2 | 5 | |
| 9 | 3 | 3 | |
| 10 | 1 | 10 | |
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.
| Convolutional Interleaving Features of the Toolbox | | Delays of Convolutional Interleavers |  |
© 1994-2005 The MathWorks, Inc.