# SVD of row matrix

I need to calculate orthogonal basis of a row vector. I plan to implement it on hardware using RT coding.

Whats best algorithm to calculate SVD for say $1*8$ vector?

I implemented:

1. QR decomposition block
2. SVD of square matrix

Can I use on or both of these resources to get $8*7$ size, orthonormal basis using SVD?

• The phrase "orthogonal basis of a row vector" is non-sense. It sounds like, given a vector $v_1$, you want to find an orthogonal basis $\{v_1,v_2,\dots,v_n\}$. Is that what you mean? – Omnomnomnom May 8 '17 at 18:27
• I mean orthonormal basis of row vector $1*8$. It shall be a matrix of 8*8. – Jay May 8 '17 at 18:35
• How can a vector have a basis? You don't seem to be using "basis" to mean what it usually means – Omnomnomnom May 8 '17 at 18:36
• may be i should say row matrix. I need to find $W_2$ as mentioned in page 3 first paragraph of this paper: users.cecs.anu.edu.au/~xyzhou/papers/journal/tvt10.pdf This should be ideally 7*8 matrix. I can get that from full SVD where first row is normalised vector. – Jay May 8 '17 at 18:41
• so yes, you did mean exactly what I said in that first comment. The only difference is that your $v$s are $w$s. – Omnomnomnom May 8 '17 at 19:11

Here's how you can construct a suitable orthonormal basis using a Householder transformation: let $w_1$ denote the vector (a column-vector) in question, which is supposed to be the first vector in our orthonormal basis. Suppose that $\|w_1\| = 1$. Let $$v = w_1 - e_1 = w_1 - (1,0,\dots,0)$$ Take your matrix to be $$W = I - 2\frac{vv^\dagger}{v^\dagger v}$$ $W$ will necessarily be a unitary matrix whose first column is $w_1$. That is, the columns of $W$ form an orthonormal basis.

• Thanks. This logic works very fine for a vector. Though deviation if I compare with matlab is 0.025 on average with larger error on 6th-8th columns and last row. Can this method be flexed to calculate $W$ foe 2*m matrix too? – Jay May 11 '17 at 7:11
• I'm not sure what exactly you're comparing in Matlab. I'm not quite sure how to make this work for a $2 \times m$ matrix. – Omnomnomnom May 11 '17 at 12:14
• I am comparing elements of orthogonal matrix from both methods. – Jay May 12 '17 at 4:49
• I was saying that I don't know what you're doing in Matlab for comparison – Omnomnomnom May 12 '17 at 12:03
• I am using SVD function of matlab. – Jay May 12 '17 at 15:10

A row vector (i.e. $1-$by-$N$ matrix) is already essentially in SVD form. To see this, think of the (reduced) SVD of $A$ as follows:

$$A = \sum_{j=1}^r\sigma_ju_jv_j^T$$ i.e. write $A$ as the sum of rank-one matrices. So if $A$ is a single row vector (i.e. a $1$-by-$N$ matrix), say $A = w^T$, then it can be written as

$$A = \|w\|_2v^T,\quad v = \frac{w}{\|w\|_2}$$ so the only nonzero singular value of $A$ is $\|w\|_2$, and the corresponding singular vector is just the normalized version of $w$. If you want a full SVD of $A$, you'll need to construct an orthonormal basis for $w^\perp$ using e.g. Householder.

• I actually need full SVD. I need to find $W_2$ as mentioned in page 3 first paragraph of this paper: users.cecs.anu.edu.au/~xyzhou/papers/journal/tvt10.pdf This should be ideally 7*8 matrix. I can get that from full SVD where first row is normalised vector. – Jay May 8 '17 at 18:36
• Does having block of QR decomposition helps for getting full SVD, as it does involve householder? – Jay May 9 '17 at 8:44
• @JayPrakash look at the other answer, it describes a simple method to get the full matrix. – icurays1 May 9 '17 at 18:35