Matrix operations with GSL libraries

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I want to implement a kalman filter on a project with a XMC4500. I just want to know if it's possible to use GSL (GNU Scientific Library) matrix functions or if I need to make all the matrix operations "by hand".

If it's possible, how can I install the libraries on the DAVE/XMC?

Thanks in advance
0 Likes
9 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Sorry, I am not very sure on this.
0 Likes
Not applicable
And does anyone ever tried to use some matrix library?
0 Likes
User7282
Level 4
Level 4
I made my own library, actually in order to implement a Kalman Filter.

May I ask you what is the purpose of the Kalman Filter?
0 Likes
Not applicable
It's to estimate the charge of a battery. I'm need to know if I'll need to make also my own library or if I can get something already done...
0 Likes
lock attach
Attachments are accessible only for community members.
User7282
Level 4
Level 4
Hi,

Here it is one library that I've made to use with a predictive algorithm to a buck converter: .

If you find any bug please post it here, if possible.
0 Likes
Not applicable
Thank you very much for sharing that!! I'll try to use it and see what I can get out of it 😄

Just one simple first question: the pointer *d for the matrix init data must be an array or is the value for each element of the matrix?
0 Likes
User7282
Level 4
Level 4
It is an array.

Note that it is not a multidimensional array, so if you want to init a matrix 3x3 matrix A you sould do it like this:
matrix A;
matrix_data *A_data[3*3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};

matrix_init(&A, (matrix_data *) &A_data, 3, 3);
0 Likes
Not applicable
Thanks very much once again. That's right what I needed. Let's see now if this works like a maltab script I have here.
0 Likes
User7282
Level 4
Level 4
It should work, I also prototyped the KF first in Matlab and then implemented it in the microcontroller.
0 Likes