This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Fast Implementation of Regression Analysis on TI Microcontroller (TMS320F280040)

Dear people of the TI E2E community,

everyone can do regression analysis on excel,
and a few can implement such a working algorithm on a microcontroller.

However doing it the normal way is very bulky and slow once you have lots of data.

I am not well informed on the state of the art fast regression analysis algorithms,
are you?

To be more specific:

There is two ways regression analysis can be too slow:

  1. Lots of Lots of Lots of Data, and you don't want to spend days just calculating

  2. You are doing regression analysis on a live/ real time signal where time is critical and your sensor has a high sample rate (you can't afford to lose to much time due to bulky algorithms)

I am confronted by problem 2 however believe that solutions to problem 1 can already be helpful for solving problem 2.

My question:
There should be a way to do a fast version of regression analysis that is commonly used. (similar to fourier transform and fast fourier transform)

Would you be so kind as to point me into the right direction?
(Approved References or if you coincidentally know of any literature, that would be great as well)

I tried to ask this question in the microcontroller forum, 
however I was told to ask in a more general forum. 
I hope I am right this time?

I am looking forward to your answers!
Also please let me know if this is the wrong place for such a question.

Best regards
Merlin

  • Merlin,

    To my knowledge, our C2000 Software libraries don't contain reference examples for fast regression analysis (linear or non-linear). I do think they can be implemented on the MCUs, except I believe we don't see a lot of customer requests for real-time regression analysis. I would be interested in knowing what your end application is.

    Thanks,

    Sira

  • Hello Sira,

    Clarification:

    We need to do regression analysis on a real time signal that has a very high measurement frequency (100000 per second). Regression analysis will be done on measurements over the time span of 10 milliseconds, however the analysis result output sould be done every millisecond. (So every millisecond the last ten milliseconds should be analysed) 

    The result should be available in under a millisecond.

    Currently we do not have a certain method in mind, that's why I am asking.
    We are looking for which possibility to use. We would like to find the fastest standard possible.

    In summary:
    we need to calculate within under a millisecond regression analysis of 1 000 samples (across a timespan of 10 ms)

    Thanks for trying to help
    Best regards

  • Techniques aside, the rate you are describing should be manageable in a C2000 MCU to implement filtering. For example, consider a F28004x running at 100MHz. in other words, 0.01us per cycle, or 100 cycles in 1us, or 100000 cycles in 1ms. So you have these many cycles to filter 1000 samples.

    Assume you have a 28-tap FIR filter. Our benchmarks indicate that it takes 103 cycles to generate one output out of this FIR filter. So to process 1000 samples will require 103000 cycles, which is slightly more than the budget of 100000 cycles. So a slightly lower order FIR filter will have to be used.

    But I believe regression analysis, say using Least Mean Squares regression, will have a different computational complexity than simple filtering, because the algorithm is different - it will involve matrix multiplication, inversion etc. So you will need to consider what approach you want to take, and within that approach, balance the specific choices of parameters against the available cycles.

    Thanks,

    Sira