public static float[] filter(float[] data, float alpha) {

        float[] rv = new float[data.length];
        rv[0] = data[0];
        for (int i = 1; i < data.length; i++) {
            rv[i] = rv[i-1] + alpha * (data[i] - rv[i-1]);
        }

        return rv;
    }
public static float [ ] filter ( float [ ] data , float alpha ) { float [ ] rv = new float [ data . length ] ; rv [ 0 ] = data [ 0 ] ; for ( int i = 1 ; i < data . length ; i ++ ) { rv [ i ] = rv [ i - 1 ] + alpha * ( data [ i ] - rv [ i - 1 ] ) ; } return rv ; }
Simple Low pass filter