Use Julia for Linear Algebra
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Discrete Convolution Using Circulant Matrix
$y[t] = h[t] * x[t]$ where $x[t] = [1, 2, 3, 0, -3, -1, 1, -2]$, $h[t] = [1, 3, 1]$
Use Julia LinearAlgebra for matrix/vector operation.
Use two space for new line.
Use DSP.conv to perform discrete convolution.
x: length=8; h: length=3; y: length=8+3-1=10 (padding two 0’s at x)
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Circulant Matrix Multiplication Approximates Dicrete Convolution
First extend $h[t]$ by padding seven 0’s (10-3=7).
Use SpecialMatrices.Cirlulant to cyclic shift $h[t]$ and form a 10x10 Circulant matrix $\Phi$.
Use SpecialMatrices.Matrix to convert special matrix type to normal Array
$y = \Phi x$
1 |
|
1 |
|
1 |
|
1 |
|
Find eigenvalues and eigenvectors of $\Phi$
$\Phi$ is a Circulant matrix, its eigenvalue array s[n] is “equivalent” to DFT($h[t]$), sort of,
up to frequency sequence difference.
For example, DFT frequency sequence is always defined counter clockwise on the unit circle (0,1,2,..,9) for n=10.
The eigenvalue/eigenvector decomposition: $\Phi = U P U^{*}$
In this eigvals implementation frequency is defined as conjugate first on the unit circle (0,1,9,2,8…,5)
The first eigenvalue of $\Phi$ corresponds to Nyquist frequency = 0 (DC: 1+1+3=5)
The last eigenvalue of $\Phi$ corresponds to Nyquist frequency = $\pi$ (highest AC: 1+1-3=-1)
Its eigenvector array P cosists of eigenvectors in column sequences.
The first column corresponds to DC eigenvector: [1, 1, …, 1]’.
The last column corresponds to DC eigenvector: [1, -1, …, -1]’.
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Commutative Group - Translation Equivariant
- Discrete convolution is equivalent to Circulant matrix multiplication.
- Circulant matrix is itself commutative/Abelian group.
- All Cirulant matrix multiplication can be decomposed into translation matrix multiplication’s superposition.
- Discrete convolution is therefore translation multiplication commutable => translation equivariant
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|