CMSIS-DSP icon indicating copy to clipboard operation
CMSIS-DSP copied to clipboard

[REQUEST] Add Singular Value Decomposition

Open dsm opened this issue 2 years ago • 5 comments

Hi, if it is possible, can someone add SVD transform .

dsm avatar Sep 02 '22 08:09 dsm

Hi @dsm ,

Thank for the request. It is definitely something I have on my to do list and that I'd like to add to the library.

But before I can start the work, I have concluded I need additional abstractions in CMSIS-DSP to make it easier to build complex kernels. Vectorization and manual unrolling are unfortunately generating codes which are not very readable and maintainable. So, I need something to help me writing a maintainable (and quick) SVD implementation.

Also, I have not yet decided on which implementation. Some are very fast for small matrices but very slow for bigger ones.

I was thinking perhaps about Jacobi SVD and only for square matrices.

Would you need rectangular matrices also ?

In summary, it is on my to do list but I can communicate any schedule and it is likely to take time before it is available in the library.

christophe0606 avatar Sep 02 '22 08:09 christophe0606

Yes great to hear that, I need non-square matrices for pseudoinverse using SVD, I have 100-200 sensor data for curve fitting as 5 or 6 degree polynomial

dsm avatar Sep 02 '22 08:09 dsm

if anything need, I can help

dsm avatar Sep 02 '22 14:09 dsm

I think maybe implement svd using method of Golub and Reinsch, that repo is implement in pure c

SVD_golub_reinsch

Can you review this, please?

dsm avatar Sep 13 '22 10:09 dsm

@dsm It is indeed the Golub method I had planned to implement at some point. Unfortunately, it won't be quick since I have lot of other things to do before.

But thanks for sharing this link. It looks interesting !

christophe0606 avatar Sep 13 '22 12:09 christophe0606

A new experimental C++ extension has been introduced that should make it much easier to write linear algebra algorithms and get correct performances. It currently does not yet support complex numbers but otherwise should be usable for algorithm like SVD.

We prefer to focus efforts on improving this C++ API and let the ecosystem write the linear algebra algorithms they need.

christophe0606 avatar Jul 08 '24 06:07 christophe0606