This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS-DSP: Matrix Inverse problem

Hello,

While debugging a DSP algorithm, I realized the problem is duo to the CMSIS matrix inverse function: arm_mat_inverse_f32. It's really strange and is driving me crazy. arm_mat_inverse_f32 returns the right result for some Matrices but wrong result for some other! I assure you the matrices are not singular or anything like this, the algorithm works just fine with the same input data on MATLAB. I have no idea what the problem could be, any suggestions?

Regards

Parents
  • Ok, here is the part of my code that uses this function:

    arm_mat_init_f32(&m1, SIZE, SIZE, Matrix);
    arm_mat_init_f32(&m2, SIZE, SIZE, Matrix_Inverse);
    status=arm_mat_inverse_f32(&m1,&m2);

    I tested with the following 6 by 6 matrices and some other. The first one works just fine, the second one doesn't. I'm writing my own inverse function using Gauss_Jordan method, but I really would like to know whats going on here.

    float32_t Matrix[SIZE*SIZE]={ 7.6294, 1.1843, 1.0842, 1.7056, 1.3111, 0.8036, 1.1843, 7.0938, 1.4429, 1.9244, 0.9154, 1.0024, 1.0842, 1.4429, 7.6006, 0.7976, 1.1649, 1.1927, 1.7056, 1.9244, 0.7976, 6.0714, 1.2414, 0.9802, 1.3111, 0.9154, 1.1649, 1.2414, 7.3110, 0.2683, 0.8036, 1.0024, 1.1927, 0.9802, 0.2683, 7.6469};

    float32_t Matrix[SIZE*SIZE]={ 2.4086, -1.7141, 0.9385, 1.9594, -0.4342, 1.3369, 5.1228, 0.3019, -1.9435, 0.3259, 0.0788, 1.3030, -1.8536, -1.3981, 0.0812, -3.1542, 0.2977, 1.2532, -8.8154, 0.4773, -0.6195, 1.2333, -0.1475, 1.1768, 1.6616, 1.9255, 0.8342, -1.4220, -0.6654, 1.0847, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000};

Reply
  • Ok, here is the part of my code that uses this function:

    arm_mat_init_f32(&m1, SIZE, SIZE, Matrix);
    arm_mat_init_f32(&m2, SIZE, SIZE, Matrix_Inverse);
    status=arm_mat_inverse_f32(&m1,&m2);

    I tested with the following 6 by 6 matrices and some other. The first one works just fine, the second one doesn't. I'm writing my own inverse function using Gauss_Jordan method, but I really would like to know whats going on here.

    float32_t Matrix[SIZE*SIZE]={ 7.6294, 1.1843, 1.0842, 1.7056, 1.3111, 0.8036, 1.1843, 7.0938, 1.4429, 1.9244, 0.9154, 1.0024, 1.0842, 1.4429, 7.6006, 0.7976, 1.1649, 1.1927, 1.7056, 1.9244, 0.7976, 6.0714, 1.2414, 0.9802, 1.3111, 0.9154, 1.1649, 1.2414, 7.3110, 0.2683, 0.8036, 1.0024, 1.1927, 0.9802, 0.2683, 7.6469};

    float32_t Matrix[SIZE*SIZE]={ 2.4086, -1.7141, 0.9385, 1.9594, -0.4342, 1.3369, 5.1228, 0.3019, -1.9435, 0.3259, 0.0788, 1.3030, -1.8536, -1.3981, 0.0812, -3.1542, 0.2977, 1.2532, -8.8154, 0.4773, -0.6195, 1.2333, -0.1475, 1.1768, 1.6616, 1.9255, 0.8342, -1.4220, -0.6654, 1.0847, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000};

Children