Greetings. I am using a teensy 3.6 to collect data from a sensor. The resulting data then needs to be processed via a curve fitting routine (The overall trend of the data is an exponential curve). Although, I could export the data to my computer and then apply a curve fitting routine, it would be highly beneficial to do this on the teensy board itself. I am looking for an Arduino library that would be useful for this task. It does not seem like one exists and this is not surprising given the memory intensive nature of curve fitting algorithms. However, I am wondering if the larger amount of memory and processing power available on a teensy 3.6 may allow for a curve fitting routine to work. Libraries to do this type of curve fitting analysis do exist for C and C++ languages and I am wondering if there is a way to modify one of the libraries for use within the Arduino environment. Any and all other suggestions on how to solve this problem are most welcome. Thanks in advance for your help!
Thanks for the reply. I saw that one and had tried to use it with no luck. However, I think that may have had more to do with my ability to translate it into the Arduino language. Ill give it another crack. Thanks!
I found this library for C which seems to be what I am after. However, it seems rather complex and Im not sure how easily it can be converted for use in the arduino. In general, can libraries from C or C++ be utilized or is it a fairly complex task to convert?
Arduino is C++ so code compatibility should not be an issue. The issue is that microcontrollers tend to be memory constrained so RAM intensive algorithm implementations may not fit. Also floating point operations, transcendental functions, and such are relatively slow on 8 bit microcontrollers.* Either may or may not be an issue for your particular application.
edit: In review I overlooked that you are using a Teensy3.6 which does have hardware floating point and is a 32 bit microcontroller. It also has quite a bit of memory by microcontroller standards.