|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmath.Mat1
public abstract class Mat1
Mat1 is a class that uses 1-D arrays and contains static methods.
Constructor Summary | |
---|---|
Mat1()
|
Method Summary | |
---|---|
static double |
add(double[] a)
|
static void |
add(double[] a,
double[] b)
Add two vectors. |
static void |
add(double[] a,
double[] b,
double c)
Add a vector times a scalar to a vector. |
static double |
add(float[] a)
|
static void |
add(float[] a,
float[] b)
Add two vectors. |
static void |
add(float[] a,
float[] b,
float[] c)
|
static double |
add(short[] a)
|
static double |
add16(float[] a)
|
static float |
add4(float[] a)
|
static float |
add8(float[] a)
|
static void |
add8(float[] a,
float[] b,
float[] c)
|
static double |
add8Depend(float[] a)
|
static double |
add8NoDepend(float[] a)
|
static float |
addFloat(float[] a)
Sums up the numbers into a float. |
static double[] |
arrayCopy(double[] in)
|
static float[] |
arrayCopy(float[] in)
|
static double |
coefficientOfVariation(int[] a)
|
static short[][] |
copy(short[][] r)
|
static short[] |
copyArray(short[] a)
|
static double |
dot(double[] a)
Calculate the dot product of a vector with itself. |
static double |
dot(double[] a,
double[] b)
Calculate the dot product of two vectors. |
static double |
dot(double[] a,
double[] b,
int j)
Calculate the dot product of two vectors. |
static float |
getMax(float[] a)
|
static short |
getMax(short[] a)
|
static double |
getMaxValue(double[] in)
|
static double |
getMean(double[] values)
Computes the mean value for the argument array. |
static double[] |
getMean(double[] a,
double[] b,
double[] c)
|
static double |
getMean(double[] values,
int offset,
int number)
Computes the mean value for some elements of the argument array. |
static double |
getMean(float[] a)
Compute the average. |
static double |
getMean(int[] a)
|
static double |
getMean(short[] a)
Compute the average. |
static float |
getMin(float[] a)
|
static short |
getMin(short[] a)
|
static java.util.Vector |
getOverlappedWindows(double[] data)
return a vector of arrays, each array is only 256 elements long, each array overlaps by 50% with each other array. |
static double[] |
getRampData(int n)
Generate an array of doubles that is n elements
long and has numbers that range from 0 to n-1. |
static float[] |
getRampDataFloat(int n)
|
static double |
getStandardDeviation(double[] values)
Computes the standard deviation for the argument array of values. |
static double |
getStandardDeviation(double[] values,
double mean)
Computes the standard deviation for the argument array of values. |
static double |
getStandardDeviation(double[] values,
int offset,
int number)
Computes the standard deviation for some of the argument array's values. |
static double |
getStandardDeviation(double[] values,
int offset,
int number,
double mean)
Computes the standard deviation for some of the argument array's values. |
static double |
getVariance(double[] values)
Computes the variance for the argument array. |
static double |
getVariance(double[] values,
double mean)
Computes the variance for some of the argument array's values. |
static double |
getVariance(double[] values,
int offset,
int number)
Computes the variance for some of the argument array's values. |
static double |
getVariance(double[] values,
int offset,
int number,
double mean)
Computes the variance for some of the argument array's values. |
static double |
getVariance(int[] a)
|
static void |
intQuickSort(int[] a)
|
static void |
logArray(double[] a)
|
static double |
magnitude(double[] a)
Calculate the magnitude a vector. |
static void |
main(java.lang.String[] args)
|
static double[] |
makeBartlett(int n)
|
static void |
makeHanning()
|
static double[] |
makeHanning(int n)
|
static void |
makeLyon()
|
static double[] |
makeLyon(int n)
|
static double |
mean(int[] a)
|
static double |
mean(short[][] a)
|
static void |
normalize(double[] a)
Sum all the elements in an array, then divide by the total. |
static void |
normalize(float[] a)
|
static float[] |
normalize(short[] a)
|
static int |
numberOfNonZeros(short[][] k)
|
static boolean |
outlierHere(int[] a)
|
static double[] |
padOutWithZeros(double[] b,
int length)
This method will pad out a new array of length length
and return it. |
static void |
print(double[] a)
|
static void |
print(double[] v,
java.lang.String title)
|
static void |
print(float[] a)
|
static void |
print(int[] a)
|
static void |
print(java.lang.Object[] o)
|
static void |
printMedian(short[][] k,
java.lang.String name)
|
static void |
printStats(float[] a)
|
static void |
printStats(java.lang.String title,
float[] a)
|
static void |
quickSort(int[] a)
|
static void |
quickSort(int[] a,
int lo0,
int hi0)
|
static float[] |
ramp(float start,
float end,
int n)
|
static void |
removeTheDcComponent(float[] m)
|
static void |
scale(double[] a,
double k)
|
static void |
scale(float[] a,
double k)
|
static void |
scale(float[] a,
float k)
|
static float[] |
scale(short[] a,
float k)
|
static void |
scaleIntoRange(float[] im,
float min,
float max,
int maxValueOutput)
|
static float[] |
shortToFloat(short[] a)
|
static float |
sumV(float[] a)
|
static void |
swap(int[] x,
int a,
int b)
|
static void |
synthesizeRamp(float[] realPart,
float[] imaginaryPart)
Destroy the input data with a linear ramp. |
static void |
testAdd1()
|
static void |
testAdd1(float[] a)
Show how loop unwinding can improve speed for a vector sum, but only to a point. |
static void |
testAdd2()
|
static void |
testAddFloat()
|
static void |
testCoefficientOfVariation()
|
static void |
testCorrelate()
|
static void |
testGetOverlappedWindows()
|
static void |
testHanningOverlappedWindows()
|
static void |
testHanningOverlappedWindowsSpectrogram()
|
static void |
testOutlier()
|
static void |
testPadOutWithZeros()
|
static void |
testQuickSort()
|
static void |
testVariance()
|
static void |
threshold(short[] a)
|
static void |
threshold(short[] a,
short thresh)
For each element in a below the thresh ,
make the element 0, otherwise make the element 255. |
static double |
variance(int[] a)
|
static double |
variance(short[][] a)
|
static void |
window(double[] r,
double[] w)
|
static void |
windowArray(double[] window,
double[] r_d)
|
static void |
windowArrays(double[] window,
double[] r_d,
double[] i_d)
This will apply the windows to each of the arrays. |
static double |
y5(double y0,
double y1,
double u)
|
static double[] |
zeroPadCorrelate(double[] a,
double[] b)
Zero pads a non-cyclic cross correlation between the signal and the template. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Mat1()
Method Detail |
---|
public static void main(java.lang.String[] args)
public static void add(double[] a, double[] b, double c)
a
- the first vectorb
- the second vectorc
- the scalar multiplierpublic static void add(double[] a, double[] b)
a
- the first vector a = a + b;
b
- the second vectorpublic static void add(float[] a, float[] b)
a
- the first vector a = a + b;b
- the second vectorpublic static void testAddFloat()
public static void testAdd2()
public static double dot(double[] a, double[] b)
a
- the first vectorb
- the second vector
public static double dot(double[] a)
a
- the vector
public static double magnitude(double[] a)
a
- the vector
public static void print(int[] a)
public static void print(double[] a)
public static void printStats(java.lang.String title, float[] a)
public static void printStats(float[] a)
public static void print(float[] a)
public static float addFloat(float[] a)
a
-
public static double add(double[] a)
public static float[] ramp(float start, float end, int n)
public static void testAdd1()
public static void testAdd1(float[] a)
public static void add(float[] a, float[] b, float[] c)
public static void add8(float[] a, float[] b, float[] c)
public static float add4(float[] a)
public static float add8(float[] a)
public static double add8Depend(float[] a)
public static double add8NoDepend(float[] a)
public static double add16(float[] a)
public static double add(float[] a)
public static double add(short[] a)
public static float sumV(float[] a)
public static void normalize(double[] a)
a
- public static float[] normalize(short[] a)
public static void normalize(float[] a)
public static double getMean(float[] a)
a
- array of numbers to be averaged
public static double getMean(short[] a)
a
- array of shorts
public static void threshold(short[] a, short thresh)
thresh
,
make the element 0, otherwise make the element 255.
a
- an array whose values are altered.thresh
- a point that is used to floor or ceiling apublic static void threshold(short[] a)
public static float[] scale(short[] a, float k)
public static void scale(double[] a, double k)
public static void scale(float[] a, float k)
public static void scale(float[] a, double k)
public static float[] shortToFloat(short[] a)
public static short[] copyArray(short[] a)
public static double variance(int[] a)
public static double mean(int[] a)
public static double coefficientOfVariation(int[] a)
public static void testVariance()
public static void testCoefficientOfVariation()
public static boolean outlierHere(int[] a)
public static void testOutlier()
public static void quickSort(int[] a, int lo0, int hi0)
public static void swap(int[] x, int a, int b)
public static void quickSort(int[] a)
public static double mean(short[][] a)
public static double variance(short[][] a)
public static double[] getMean(double[] a, double[] b, double[] c)
public static short[][] copy(short[][] r)
public static float getMin(float[] a)
public static short getMin(short[] a)
public static short getMax(short[] a)
public static float getMax(float[] a)
public static void testQuickSort()
public static int numberOfNonZeros(short[][] k)
public static void printMedian(short[][] k, java.lang.String name)
public static float[] arrayCopy(float[] in)
public static double[] arrayCopy(double[] in)
public static double[] getRampData(int n)
n
elements
long and has numbers that range from 0 to n-1.
For example:
double x1[] = getRampData(N);>
n
- a positive integer
public static float[] getRampDataFloat(int n)
public static double getMaxValue(double[] in)
public static void print(double[] v, java.lang.String title)
public static void window(double[] r, double[] w)
public static void print(java.lang.Object[] o)
public static void synthesizeRamp(float[] realPart, float[] imaginaryPart)
realPart
- input datas real componentimaginaryPart
- input datas' imaginary component.public static double getMean(double[] values)
values
- double array on which the mean is to be determined
java.lang.IllegalArgumentException
- if the array has not affineTransform least one elementpublic static double getMean(double[] values, int offset, int number)
values
- array from which elements are readoffset
- index of the first element to be usednumber
- number of elements to be used
java.lang.IllegalArgumentException
- if the array has not affineTransform least one elementpublic static double getStandardDeviation(double[] values)
values
- array from which elements are read
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getStandardDeviation(double[] values, double mean)
values
- array from which elements are readmean
- the mean value for the array, possibly computed with a
call to getMean(double[])
.
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getStandardDeviation(double[] values, int offset, int number)
getMean(double[],int,int)
,
better call getStandardDeviation(double[],int,int,double)
.
Otherwise, this method has to compute mean again.
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting affineTransform values[offset]
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getStandardDeviation(double[] values, int offset, int number, double mean)
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting affineTransform values[offset]mean
- value of the elements
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getVariance(double[] values)
values
- array from which elements are read
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getVariance(double[] values, double mean)
values
- array from which elements are readmean
- the mean for the array elements
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getVariance(double[] values, int offset, int number)
getMean(double[],int,int)
,
better call getVariance(double[],int,int,double)
.
Otherwise, this method has to compute mean again.
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting affineTransform values[offset]
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static double getVariance(double[] values, int offset, int number, double mean)
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting affineTransform values[offset]mean
- the mean for the array elements
java.lang.IllegalArgumentException
- if the array has not affineTransform least two elementspublic static void removeTheDcComponent(float[] m)
public static void scaleIntoRange(float[] im, float min, float max, int maxValueOutput)
public static double getMean(int[] a)
public static double getVariance(int[] a)
public static void intQuickSort(int[] a)
public static void testCorrelate()
public static double[] zeroPadCorrelate(double[] a, double[] b)
a
- vector signal for the cross correlationb
- template vector for the cross correlation
public static void testPadOutWithZeros()
public static double[] padOutWithZeros(double[] b, int length)
length
and return it.
b
- prepended to the output arraylength
- of the new array
public static double dot(double[] a, double[] b, int j)
a
- the first vectorb
- the second vector
public static double[] makeHanning(int n)
public static double[] makeLyon(int n)
public static void logArray(double[] a)
public static void testHanningOverlappedWindowsSpectrogram()
public static void testHanningOverlappedWindows()
public static void testGetOverlappedWindows()
public static void makeHanning()
public static java.util.Vector getOverlappedWindows(double[] data)
data
-
public static void windowArray(double[] window, double[] r_d)
public static double y5(double y0, double y1, double u)
public static void windowArrays(double[] window, double[] r_d, double[] i_d)
window
- r_d
- i_d
- public static void makeLyon()
public static double[] makeBartlett(int n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |