Example #1
0
 public ArrayKalmanFilter(int length)
 {
     filters = new KalmanFilter[length];
     for (int i = 0; i < length; i++)
     {
         filters[i] = new KalmanFilter();
     }
 }
Example #2
0
        public KalmanFilter Clone()
        {
            KalmanFilter filter = new KalmanFilter
            {
                x           = x,
                z           = z,
                P           = P,
                K           = K,
                initialized = initialized
            };

            return(filter);
        }
Example #3
0
        public double[] Calculate(double[] array)
        {
            if (filters == null)
            {
                filters = new KalmanFilter[array.Length];
                for (int i = 0; i < filters.Length; i++)
                {
                    filters[i] = new KalmanFilter();
                }
            }

            if (array.Length != filters.Length)
            {
                throw new ArgumentOutOfRangeException();
            }

            double[] ret = new double[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                ret[i] = filters[i].Calculate(array[i]);
            }
            return(ret);
        }