deintrlv
Restore ordering of symbols
Description
restores the original ordering of the elements of deintrlved
= deintrlv(data
,elements
)data
by
acting as an inverse of intrlv
.
Examples
Apply Interleaving to Reorder and Deinterleaving to Restore Vector Data Order
Use the intrlv
function to rearrange the elements of a vector to a random permutation vector determined by the randperm
function. Use the deintrlv
function to restore the element order of the initial vector by reusing the same random permutation vectorThis illustrates the inverse relationship between the intrlv
and deintrlv
functions.
Generate an input signal, data
, and a permutation vector, elements
.
data = 10:10:100
data = 1×10
10 20 30 40 50 60 70 80 90 100
elements = randperm(10) % Permutation vector
elements = 1×10
6 3 7 8 5 1 2 4 9 10
Permute the input signal according to the permutation vector by using the intrlv
function and the restore the input signal order by using the deintrlv
function.
a = intrlv(data,elements)
a = 1×10
60 30 70 80 50 10 20 40 90 100
b = deintrlv(a,elements)
b = 1×10
10 20 30 40 50 60 70 80 90 100
Apply Interleaving to Reorder and Deinterleaving to Restore Matrix Data Order
Use the intrlv
function to rearrange the elements in the columns of a matrix to a random permutation vector determined by the randperm
function. Use the deintrlv
function to restore the element order of the initial matrix by reusing the same random permutation vector. This illustrates the inverse relationship between the intrlv
and deintrlv
functions.
Generate an input signal, data
, and a permutation vector, elements
.
data(:,1) = 10:10:100
data = 10×1
10
20
30
40
50
60
70
80
90
100
data(:,2) = 0.1:0.1:1
data = 10×2
10.0000 0.1000
20.0000 0.2000
30.0000 0.3000
40.0000 0.4000
50.0000 0.5000
60.0000 0.6000
70.0000 0.7000
80.0000 0.8000
90.0000 0.9000
100.0000 1.0000
elements = randperm(10) % Permutation vector
elements = 1×10
6 3 7 8 5 1 2 4 9 10
Permute the input signal according to the permutation vector by using the intrlv
function, and then restore the input signal order by using the deintrlv
function.
a = intrlv(data,elements)
a = 10×2
60.0000 0.6000
30.0000 0.3000
70.0000 0.7000
80.0000 0.8000
50.0000 0.5000
10.0000 0.1000
20.0000 0.2000
40.0000 0.4000
90.0000 0.9000
100.0000 1.0000
b = deintrlv(a,elements)
b = 10×2
10.0000 0.1000
20.0000 0.2000
30.0000 0.3000
40.0000 0.4000
50.0000 0.5000
60.0000 0.6000
70.0000 0.7000
80.0000 0.8000
90.0000 0.9000
100.0000 1.0000
Input Arguments
data
— Input signal
vector | matrix
Input signal, specified as a vector or matrix. If
data
is a matrix with multiple rows and columns,
the function processes the columns independently.
If data
is a length-N vector or an N-row matrix,
elements
is a length-N vector that permutes the
integers from 1 to N. To use this function as an inverse of the
intrlv
function, use the same
elements
input in both functions. In that case, the
two functions are inverses in the sense that applying
intrlv
followed by deintrlv
leaves data unchanged.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| fi
Complex Number Support: Yes
elements
— Permutation vector
integer vector
Permutation vector, specified as an integer vector. The permutation vector
specifies the mapping used to restore the input signal. The permutation
vector length must equal the input signal length and contain for each
integer k in the range [1
length
(x
,1)]. If
data
is a length-N vector or an
N-row matrix, elements
must be a
length-N vector and contain each integer in the range
[1 length
(x
,1)]. The sequence in
elements
is the sequence in which elements from
data
or its columns appear in
deintrlved
.
Data Types: double
Output Arguments
deintrlved
— Deinterleaved data
vector | matrix
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)