# Documentation

### This is machine translation

Translated by
Mouse over text to see original. Click the button below to return to the English verison of the page.

# toeplitz

Toeplitz matrix

## Syntax

• ``T = toeplitz(c,r)``
example
• ``T = toeplitz(r)``
example

## Description

example

````T = toeplitz(c,r)` returns a nonsymmetric Toeplitz matrix with `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.```

example

````T = toeplitz(r)` returns the symmetric Toeplitz matrix where:If `r` is a real vector, then `r` defines the first row of the matrix.If `r` is a complex vector with a real first element, then `r` defines the first row and `r'` defines the first column.If the first element of `r` is complex, the Toeplitz matrix is Hermitian off the main diagonal, which means ${\text{T}}_{i,j}=\mathrm{conj}{\text{(T}}_{j,i}\right)$ for $i\ne j$. The elements of the main diagonal are set to `r(1)`.```

## Examples

collapse all

### Create Symmetric Toeplitz Matrix

```r = [1 2 3]; toeplitz(r) ```
```ans = 1 2 3 2 1 2 3 2 1 ```

### Create Nonsymmetric Toeplitz Matrix

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 = 1 5 6 2 1 5 3 2 1 4 3 2 ```

Create a Toeplitz matrix with complex row and column vectors. The Toeplitz matrix is Hermitian off the main diagonal such that for .

```c = [1+3i 2-5i -1+3i]; r = [1+3i 3-1i -1-2i]; T = toeplitz(c,r) ```
```T = 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 ```

### Create Circulant Matrices Using `toeplitz` Function

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 = 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 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) h*xConv ```
```xConv = 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 ans = 52 50 73 46 64 ```

If you have the Signal Processing Toolbox™, you can use the `cconv` function to find the circular convolution.

### Discrete-Time Convolution Using `Toeplitz`

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 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 0 0 ```

Form the convolution matrix `xConv` using `toeplitz`. Then, find the convolution using `h*xConv`.

```xConv = toeplitz(c,r) h*xConv ```
```xConv = 1 8 3 2 5 0 0 0 1 8 3 2 5 0 0 0 1 8 3 2 5 ans = 3 29 51 37 31 29 10 ```

Check that the result is correct using `conv`.

```conv(x,h) ```
```ans = 3 29 51 37 31 29 10 ```

## Input Arguments

collapse all

### `c` — Column of Toeplitz matrixscalar | vector

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

### `r` — Row of Toeplitz matrixscalar | vector

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

collapse all

### Toeplitz Matrix

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

`$A=\left[\begin{array}{cccccc}{a}_{0}& {a}_{-1}& {a}_{-2}& \cdots & \cdots & {a}_{1-n}\\ {a}_{1}& {a}_{0}& {a}_{-1}& \ddots & \ddots & ⋮\\ {a}_{2}& {a}_{1}& {a}_{0}& \ddots & \ddots & ⋮\\ ⋮& \ddots & \ddots & \ddots & \ddots & {a}_{-3}\\ ⋮& \ddots & \ddots & \ddots & {a}_{0}& {a}_{-1}\\ {a}_{n-1}& \cdots & \cdots & {a}_{2}& {a}_{1}& {a}_{0}\end{array}\right].$`
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 3, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7649884223937988, "perplexity": 3078.001833588297}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-30/segments/1469257825124.22/warc/CC-MAIN-20160723071025-00154-ip-10-185-27-174.ec2.internal.warc.gz"}