Class Smoothing

java.lang.Object
org.scictrl.csshell.math.Smoothing

public final class Smoothing extends Object
Smoothing out measurement curve.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    avg(double[] data, int start, int count)
    Averages elements in sub-array for given data array
    static final double[][]
    collapseSame(double[] x, double[] y)
    Collapses measurement data points where for same x value there is several y values by calculating average and collapse measurement to a single x, y(avg) point.
    static final double[]
    smoothAvg(double[] data, int sample)
    Runs average over data, producing new average point for each sample count of data points.
    static double
    sum(double[] data, int start, int count)
    Sums elements sub-array for give data array

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • sum

      public static double sum(double[] data, int start, int count)
      Sums elements sub-array for give data array
      Parameters:
      data - the data array
      start - start index of sub-array
      count - the count of elements in sub-array
      Returns:
      sum of elements of sub-array
    • avg

      public static double avg(double[] data, int start, int count)
      Averages elements in sub-array for given data array
      Parameters:
      data - the data array
      start - start index of sub-array
      count - the count of elements in sub-array
      Returns:
      average of elements of sub-array
    • smoothAvg

      public static final double[] smoothAvg(double[] data, int sample)
      Runs average over data, producing new average point for each sample count of data points. Averaged data points is in the center of sub-array of Averages at start and end of data array are made with less samples due to sample region reaches over array dimension.
      Parameters:
      data - the data array
      sample - number of samples over which average is calculate for data points
      Returns:
      array with averaged points
    • collapseSame

      public static final double[][] collapseSame(double[] x, double[] y)
      Collapses measurement data points where for same x value there is several y values by calculating average and collapse measurement to a single x, y(avg) point.
      Parameters:
      x - measurement on x side
      y - corresponding measurement on y side
      Returns:
      combined two arrays [collapsed x array][averaged y array]