toeplitz
Toeplitz matrix
Description
T = toeplitz( returns
a nonsymmetric Toeplitz
matrix with c,r)c as its first column and r as
its first row. If the first elements of c and r differ, toeplitz issues
a warning and uses the column element for the diagonal.
T = toeplitz( returns
the symmetric Toeplitz matrix where:r)
If
ris a real vector, thenrdefines the first row of the matrix.If
ris a complex vector with a real first element, thenrdefines the first row andr'defines the first column.If the first element of
ris complex, the Toeplitz matrix is Hermitian off the main diagonal, which means for . The elements of the main diagonal are set tor(1).
Examples
Create a nonsymmetric Toeplitz matrix with a specified column and row vector. Because the first elements of the column and row vectors do not match, toeplitz issues a warning and uses the column for the diagonal element.
c = [1 2 3 4]; r = [4 5 6]; toeplitz(c,r)
Warning: First element of input column does not match first element of input row.
Column wins diagonal conflict.
ans = 4×3
1 5 6
2 1 5
3 2 1
4 3 2
Create a Toeplitz matrix with complex row and column vectors.
c = [1+3i 2-5i -1+3i]; r = [1+3i 3-1i -1-2i]; T = toeplitz(c,r)
T = 3×3 complex
1.0000 + 3.0000i 3.0000 - 1.0000i -1.0000 - 2.0000i
2.0000 - 5.0000i 1.0000 + 3.0000i 3.0000 - 1.0000i
-1.0000 + 3.0000i 2.0000 - 5.0000i 1.0000 + 3.0000i
You can create circulant matrices using toeplitz. Circulant matrices are used in applications such as circular convolution.
Create a circulant matrix from vector v using toeplitz.
v = [9 1 3 2]; toeplitz([v(1) fliplr(v(2:end))], v)
ans = 4×4
9 1 3 2
2 9 1 3
3 2 9 1
1 3 2 9
Perform discrete-time circular convolution by using toeplitz to form the circulant matrix for convolution.
Define the periodic input x and the system response h.
x = [1 8 3 2 5]; h = [3 5 2 4 1];
Form the column vector c to create a circulant matrix where length(c) = length(h).
c = [x(1) fliplr(x(end-length(h)+2:end))]
c = 1×5
1 5 2 3 8
Form the row vector r from x.
r = x;
Form the convolution matrix xConv using toeplitz. Find the convolution using h*xConv.
xConv = toeplitz(c,r)
xConv = 5×5
1 8 3 2 5
5 1 8 3 2
2 5 1 8 3
3 2 5 1 8
8 3 2 5 1
h*xConv
ans = 1×5
52 50 73 46 64
If you have the Signal Processing Toolbox™, you can use the cconv (Signal Processing Toolbox) function to find the circular convolution.
Perform discrete-time convolution by using toeplitz to form the arrays for convolution.
Define the input x and system response h.
x = [1 8 3 2 5]; h = [3 5 2];
Form r by padding x with zeros. The length of r is the convolution length x + h - 1.
r = [x zeros(1,length(h)-1)]
r = 1×7
1 8 3 2 5 0 0
Form the column vector c. Set the first element to x(1) because the column determines the diagonal. Pad c because length(c) must equal length(h) for convolution.
c = [x(1) zeros(1,length(h)-1)]
c = 1×3
1 0 0
Form the convolution matrix xConv using toeplitz. Then, find the convolution using h*xConv.
xConv = toeplitz(c,r)
xConv = 3×7
1 8 3 2 5 0 0
0 1 8 3 2 5 0
0 0 1 8 3 2 5
h*xConv
ans = 1×7
3 29 51 37 31 29 10
Check that the result is correct using conv.
conv(x,h)
ans = 1×7
3 29 51 37 31 29 10
Input Arguments
Column of Toeplitz matrix, specified as a scalar or vector.
If the first elements of c and r differ, toeplitz uses
the column element for the diagonal.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Complex Number Support: Yes
Row of Toeplitz matrix, specified as a scalar or vector. If
the first elements of c and r differ,
then toeplitz uses the column element for the
diagonal.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Complex Number Support: Yes
More About
A Toeplitz matrix is a diagonal-constant matrix, which means all elements along a diagonal have the same value. For a Toeplitz matrix A, we have Ai,j = ai–j which results in the form
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
The toeplitz function fully supports
thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
The toeplitz function
fully supports GPU arrays. To run the function on a GPU, specify the input data as a gpuArray (Parallel Computing Toolbox). For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
The toeplitz function fully supports
distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)