# fixed.jacobiSVD

## Description

returns a vector containing the singular values of matrix
`S`

= fixed.jacobiSVD(`A`

)`A`

in descending order.

`[___] = fixed.jacobiSVD(___,`

performs `numberOfSweeps`

)`numberOfSweeps`

Jacobi iterations. If
`numberOfSweeps`

is not supplied, the default is 10.

## Examples

## Input Arguments

## Output Arguments

## Limitations

If the input matrix *A* is not full rank and has more rows than columns,
then the output *U* matrix is orthonormal up to the rank of
*A*. $$A=U*diag(s)*V\text{'}$$ is still valid and *V* is orthonormal.

For example, if $$A=\left[\begin{array}{ccc}1& 1& 1\\ 2& 2& 2\\ 3& 3& 3\\ 0.5& 2& 4\end{array}\right]$$, then *A* has rank 2 and $$U\text{'}\ast U=\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 0.8940\end{array}\right]$$.

If the input matrix *A* is not full rank and has more columns than rows,
then the output *V* matrix is orthonormal up to the rank of
*A*. $$A=U*diag(s)*V\text{'}$$ is still valid and *U* is orthonormal.

For example, if $$A\text{=}\left[\text{}\begin{array}{cccc}1& 1& 1& 1\\ 2& 2& 2& 2\\ 1& 2& 3& 4\end{array}\right]$$, then *A* has rank 2 and $$V\text{'}\ast V=\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 0.9653\end{array}\right]$$.

If the input matrix is full rank, then $$U\text{'}*U=I$$, where *I* = eye(*n*).

## Tips

The

`fixed.jacobiSVD`

function generates an economy sized vector output of the singular value decomposition.`[U,s,V] = fixed.jacobiSVD(A)`

produces a vector`s`

and unitary matrices`U`

and`V`

such that the dimensions of`U`

,`s`

and`V`

are the same as the dimensions of`svd`

with the`"econ"`

and`"vector"`

flags:`[U,s,V] = svd(A,"econ","vector")`

.The behaviors of the Square Jacobi SVD HDL Optimized and Non-Square Jacobi SVD HDL Optimized blocks are equivalent to

`[U,s,V] = fixed.jacobiSVD(A)`

when the input matrix`A`

is square or non-square, respectively. If the input data type is fixed point with binary-point scaling, the function and the block provide bit-exact results. However, if the input data type is floating point, small numerical differences may exist between the function and the block.The

`numberOfSweeps`

input argument for the`fixed.jacobiSVD`

function is equivalent to the**Number of Jacobi iterations**block parameter for both blocks.

## Algorithms

The `fixed.jacobiSVD`

function uses the two-sided Jacobi algorithm for
singular value decomposition (SVD) [1][2][3]. Compared to the
sequential Golub-Kahan-Reinsch algorithm for SVD [4], the Jacobi algorithm
has inherent parallelism and performs better for FPGA and ASIC applications [5]. The Jacobi method is
an iterative algorithm. The **numberOfSweeps** parameter determines the number of iterations performed. Most
sources indicate that 10 iterations is sufficient for the Jacobi algorithm to converge.

## References

[1] Jacobi, Carl G. J. “Über ein
leichtes Verfahren die in der Theorie der Säcularstörungen vorkommenden Gleichungen numerisch
aufzulösen*.” Journal fur die reine und angewandte Mathematik
*30 (1846): 51–94.

[2] Forsythe, George E., and Peter
Henrici. “The Cyclic Jacobi Method for Computing the Principal Values of a Complex Matrix.”
*Transactions of the American Mathematical Society *94, no.
1 (January 1960): 1–23. https://doi.org/10.1090/S0002-9947-1960-0109825-2.

[3] Shiri, Aidin and Ghader
Khosroshahi. 2019. “An FPGA Implementation of Singular Value Decomposition.” *ICEE 2019:**27th Iranian Conference on
Electrical Engineering*,* Yazd, Iran, April 30–May 2,
2019*, 416–22. IEEE. https://doi.org/10.1109/IranianCEE.2019.8786719.

[4] Golub, Gene H., and Charles F. Van
Loan. *Matrix Computations*, 4th ed. Baltimore, MD: Johns
Hopkins University Press, 2013.

[5] Athi, Mrudula V., Seyed R.
Zekavat, and Allan A. Struthers. “Real-Time Signal Processing of Massive Sensor Arrays via a
Parallel Fast Converging SVD Algorithm: Latency, Throughput, and Resource Analysis.” *IEEE Sensors Journal* 16, no. 8 (January 2016): 2519–26.https://doi.org/10.1109/JSEN.2016.2517040.

## Extended Capabilities

## Version History

**Introduced in R2023a**