Computational cost of inertial frontend

I just clocked the iner­tial fron­tend and it came in on around 1200 clock cycles for the sta­tis­tics cal­cu­la­tion, 200 clock cycles per IMU for the cal­i­bra­tion com­pen­sa­tion (sta­tic bias, mis­align­ment, scale error com­pen­sa­tion), and around 400 clock cycles for the (float­ing point) on-line bias esti­ma­tion. The bias esti­ma­tion is prob­a­bly dom­i­nated by the divi­sion oper­a­tion in the gain cal­cu­la­tion. Unfor­tu­nately, the micro­con­troller has no hard­ware float­ing point divi­sion operation.

The 1200 clock cycles for the sta­tis­tics cal­cu­la­tion can be com­pared with around 5500 float­ing point arith­metic oper­a­tion which would be required to cal­cu­late just the longer 256 sam­ple test sta­tis­tics in the naive way. And this com­pu­ta­tional cost would scale with the num­ber of sam­ples. I have not clocked the old func­tions but together with mem­ory accesses and other aux­il­iary oper­a­tions, I guess the old (naive) imple­men­ta­tion would take at least about 10 times the num­ber of clock cycles. I had pre­vi­ously done some back-of-an-envelope cal­cu­la­tions of the com­pu­ta­tional cost reduc­tion of the recur­sive inte­ger sta­tis­tics cal­cu­la­tions but this was the first time I have seen it for real.

Comments are closed.