@@ -0,0 +1,1029 @@
+/*%0A * Moving Average filter%0A * %0A *   Uses the Weighted Moving Average Filter as a specific case%0A * where all weights are equal to 1.0%0A * %0A * 2017 - VVS%0A */%0A%0A/**%0A * MovingAverage%0A * %0A * A moving average filter%0A * %0A * @author Vitor Vaz da Silva%0A *%0A */%0Apublic class MovingAverage extends Filter%7B%0A%09WeightedMovingAverage mp;%0A%09%0A%09/**%0A%09 * MovingAverage%0A%09 * %0A%09 * %09Creates a Moving Average filter with @param num filtering points.%0A%09 *  The filter is set with @param init as initial value%0A%09 *  All input filter values less than @param min are replaced by @param min value%0A%09 * %0A%09 * @param num%0A%09 * @param init%0A%09 * @param min%0A%09 */%0A%09MovingAverage(int num, double init, double min)%7B%0A%09%09if(init%3Cmin) init=min;%0A%09%09double %5B%5D weight= new double%5Bnum%5D;%0A%09%09for(int i=0; i%3Cweight.length; i++) weight%5Bi%5D=1.0/num;%0A%09%09mp=new WeightedMovingAverage(weight,num/2,init,min);%0A%09%7D%0A%09%0A%09/**%0A%09 * output%0A%09 * %0A%09 * Returns the filtered input (double) @param d value%0A%09 * %0A%09 * @param d%0A%09 * @return%0A%09 */%0A%09@Override%0A%09public double output(double d) %7B%0A%09%09return mp.output(d);%0A%09%7D%0A%7D%0A

Create MovingAverage.java