# SVD from LAPACK takes too long time

**URL:** <https://www.ruby-forum.com/t/svd-from-lapack-takes-too-long-time/234413>\
**Category:** GNU Radio\
**Created:** [March 3, 2015, 8:14am UTC](https://www.ruby-forum.com/t/svd-from-lapack-takes-too-long-time/234413 "2015-03-03T08:14:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 3, 2015, 8:14am UTC](https://www.ruby-forum.com/t/svd-from-lapack-takes-too-long-time/234413/1 "2015-03-03T08:14:51Z")

</div>

Dear all,

I got trouble with Singular Value Decomposition computation in GNU Radio  
using LAPACK. I use SVD to build a precoder for a secondary transmitter  
in  
a cognitive radio model. It takes too long times to handle a 128x144  
matrix  
with complex entries, and therefore, the data stream to be transmitted  
seem  
to be really slow in rate.

Is there any other way to compute SVD faster? FYI, I just need the V\*  
matrix within the result (U, S, V\*).

Thanks,  
Hoang

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [March 3, 2015, 10:20am UTC](https://www.ruby-forum.com/t/svd-from-lapack-takes-too-long-time/234413/2 "2015-03-03T10:20:23Z")

</div>

Hello Hoang,

exciting 🙂  
Actually, if you’re already using LAPACK, I doubt there’s much potential  
for further optimization on the same platform – if you, however, know  
your stuff is going to only be run on Intel Xeons or so, than maybe have  
a look at the Intel math kernel library lapack examples. Maybe you’d  
want to accelerate by using GPUs, then you’d have a look at OpenCl or  
CUDA implementation, or theano (however, I don’t know how readily  
available things like SVD are for theano).

One more thing: Since you’re doing SVD using LAPACK yourself, I trust  
you’ve already chosen the right routine (general, fully equipped  
complex-valued matrix). I’m not completely convinced, though:

Have you had a look at [1]? It seems SVD $A=V \Sigma U^H$ is a two step  
process: First, the input matrix is decomposed into left and right  
unitary matrixes $U\_1$ and $V\_1^H$ and an bidiagonal matrix $B$ using  
CGEBRD, and after that, $B$ is SVD’ed, yielding $B=U\_2 \Sigma V\_2^H$;  
the product $V\_1 V\_2$ then is $V$. Maybe for your application $V1$ is  
sufficient, because you can rearrange your problem mathematically?

Greetings,  
Marcus

[1] [Singular Value Decomposition](http://www.netlib.org/lapack/lug/node53.html)
