jsci.maths
Class EngineerMath
- java.lang.Object
-
- jsci.maths.AbstractMath
-
- jsci.maths.EngineerMath
-
public final class EngineerMath extends AbstractMath
This class is dedicated to engineering methods applied to arrays including signal processing. All methods here are safe, that is, they create copies of arrays whenever necessary. This makes for slower methods, but the programmer can always define his own methods optimized for performance.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doubleentropy(double[] v)Compute the entropy of an array.static doubleentropy(int[] v)Compute the entropy of an array.static doubleicf(double[] v)Shannon entropy of an array.static double[]resample(double[] data, int newLength)Set an array to the specified length resampling using linear interpolation.static double[]runningAverage(double[] v, int width)Return a running average over the data.static double[]runningMedian(double[] v, int width)Return a running median over the data.
-
-
-
Method Detail
-
runningAverage
public static double[] runningAverage(double[] v, int width)Return a running average over the data. The returned array has the same size as the input array. It is often used in signal processing to estimate the baseline.- Parameters:
v- the data.width- width of the average.- Throws:
java.lang.IllegalArgumentException- if v.length < widthjava.lang.IllegalArgumentException- if width is evenjava.lang.IllegalArgumentException- if v.length = 0
-
runningMedian
public static double[] runningMedian(double[] v, int width)Return a running median over the data. The returned array has the same size as the input array. It is often used in signal processing to estimate the baseline. Safer than the running average, but somewhat more costly computationally.- Parameters:
v- the datawidth- width of the average- Throws:
java.lang.IllegalArgumentException- if v.length < widthjava.lang.IllegalArgumentException- if width is even
-
icf
public static double icf(double[] v)
Shannon entropy of an array. Please check that the mass of the array is 1 before using this method. Use the method "entropy" otherwise.
-
entropy
public static double entropy(double[] v)
Compute the entropy of an array. The entropy as defined using the absolute value.
-
entropy
public static double entropy(int[] v)
Compute the entropy of an array. The entropy as defined using the absolute value.
-
resample
public static double[] resample(double[] data, int newLength)Set an array to the specified length resampling using linear interpolation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG