Mathematical Operations on a voltage signal

Hi all members,

I have a voltage signal(low frequency) in 0-5 v range.I want to do some mathematical operations like derivation,integration,interpolation,inverting etc with the signal.I am using arduino UNO for this.Can u suggest how can I start my work and any links of tutorials?

Thanks & Regards,
BISNI

please note:In the last post I meant derivative not derivation

Well, just use the definition of those functions and do it ?

Off the top of my head:

derivatives:

currentSample = getCurrentSample();
rateOfChange = (currentSample - previousSample) / samplePeriod;
previousSample = currentSample;

integrals:

currentSample = getCurrentSample();
integrationSoFar = integrationSoFar + (previousSample*samplePeriod + ((currentSample - previousSample)*samplePeriod/2);
previousSample = currentSample;
//this can be greatly simplified, but I leave it as is and 'blunt' for clarity...

interpolation - what sort ?

inverting ?

Linear interpolation is a bit more typing, so googling 'C linear interpolation example' I found a few that look legit ...

The integration can simplified thusly:

const double integralMultiplier = samplePeriod/2;

then:

currentSample = getCurrentSample();
integrationSoFar = integrationSoFar + (currentSample - previousSample)*integralMultiplier;
previousSample = currentSample;

I would say that at this point, it is best if bisni concentrates on learning about datatypes, variables, variable scope, operators (arithmetic as well as logical), program flow, etc. That's the hard part.

"Derivative", "integration", "interpolation", etc., are just hard words for simple concepts. The main thing for bisni to learn is C++ and Arduino. Once he (or she) knows that, then he (or she) will find the rest to be simple.

For bisni:

Here are some tutorials:

First of all thanks for the reply.In matlab I used Pchip interpolation.I am trying to do the same method in arduino also.

As always with this stuff, the hard part is figuring out how to do it on paper. Figure out the algorithms, the coding's easy after that.

Have you go the algorithms figured out or is that what you want the help with?

I did the coding for this in mat lab.Now I want to implement this using arduino.

Did you use matlabs own functions or your own?

Also what level are you at? Both in programming and math.

Did my examples make any sense?

Upon googling pchip to see what it was, google auto filled suggestions such as:

'pchip interpolation python example'
'pchip interpolation C# example'

and so on ...

As Jimbo suggests, it's the algorithm that can be the hard part - those examples should give you the framework, just translate it into C. It'll be barely an algorithm anyway, I don't foresee any critical conditional branching, recursion or anything...

Odometer, it's true I assumed the OP knew these things, and why wouldn't I? They didn't specifically ask for help with that...

Thinking about it conversely I'm led to ask: shouldn't recommending that an OP concentrate on datatypes, variables, variable scope, operators etc. be suggested for all posts?