Go Down

### Topic: [Published on GitHub] Gaussian Class and Moving Average (Read 2315 times)previous topic - next topic

#### ivanseidel

##### Jul 21, 2013, 03:06 amLast Edit: Jul 21, 2013, 02:11 pm by ivanseidel Reason: 1
Hi folks,

After a lot of work, I could manage to make a Gaussian "simple" enough to use and implement almos everything.

In this Library summing Gaussians is really easy, like this:

Code: [Select]
`Gaussian g1 = Gaussian(10, 30.4);Gaussian result = g1 + Gaussian(30, 40);`

There is also a Moving Average class, called "GaussianAverage". It works great with Gaussians and also simple values.

Code: [Select]
`GaussianAverage myAverage(10); // 10 samples to keep track ofmyAverage += Gaussian(32, 2.45);myAverage += 10; // Automaticaly adds a Gaussian with Maximum varianceGaussian average = myAverage.process();`

Fell free to commit new changes and use it.

Ivan
Arduino DueTimer | https://github.com/ivanseidel/DueTimer

#### robtillaart

#1
##### Jul 21, 2013, 02:04 pm
Quote

think the link is not right
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

#### ivanseidel

#2
##### Jul 21, 2013, 02:11 pm

Quote

think the link is not right

Now it's Okay =]
Arduino DueTimer | https://github.com/ivanseidel/DueTimer

#### ivanseidel

#3
##### Aug 22, 2013, 02:27 am
Two more methods implemented:

• double Gaussian::plot(double x) - Returns the probability of 'x'.

• double Gaussian::random() - Returns a normaly distributed value with the mean and variance of the Gaussian.

Useful for ploting and generating random Gaussian distributed values.
Arduino DueTimer | https://github.com/ivanseidel/DueTimer