-
-
Notifications
You must be signed in to change notification settings - Fork 43
Utilities
Sambit Paul edited this page Jun 16, 2020
·
21 revisions
int start = 2;
int stop = 3;
int samples = 5;
boolean includeEnd = true;
double[] out1 = UtilMethods.linspace(start, stop, samples, includeEnd);
int start = 2;
int stop = 3;
int samples = 5;
int repeats = 2;
double[] out = UtilMethods.linspace(start, stop, samples, repeats);
double start = 3.0; //Can be int
double stop = 9.0; //Can be int
double step = 0.5; //Can be int
double[] out = UtilMethods.arange(start, stop, step);
double[] arr = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; //Can be int[]
double[] out = UtilMethods.reverse(arr);
double[] arr1 = {1.0, 2.0}; //Can be int[]
double[] arr2 = {3.0, 4.0, 5.0, 6.0}; //Can be int[]
double[] out = UtilMethods.concatenateArray(arr1, arr2);
double[] signal = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0}; //Can be int[]
int start = 2;
int stop = 4;
double[] out = UtilMethods.splitByIndex(signal, start, stop);
double[][] matrix = {{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}, {7.0, 8.0, 9.0}};
double[][] out = UtilMethods.pseudoInverse(matrix);
Works in 5 modes:
- Reflect
- Constant
- Nearest
- Mirror
- Wrap
double[] signal = {2, 8, 0, 4, 1, 9, 9, 0};
double[] reflect = UtilMethods.padSignal(signal, "reflect");
double[] constant = UtilMethods.padSignal(signal, "constant");
double[] nearest = UtilMethods.padSignal(signal, "nearest");
double[] mirror = UtilMethods.padSignal(signal, "mirror");
double[] wrap = UtilMethods.padSignal(signal, "wrap");
Calculates the deltas between elements in an array.
double[] seq = {1, 2, 3, 4, 6, -4};
double[] out = UtilMethods.diff(seq);
(by changing deltas between values to 2*pi complement)
double[] seq = {0.0 , 0.78539816, 1.57079633, 5.49778714, 6.28318531};
double[] out = UtilMethods.unwrap(seq);
Helps in rounding a number to nth decimal place.
double val = 123.45667;
double out = UtilMethods.round(val, 1);
double divisor = -2;
double dividend = 4;
double out = UtilMethods.modulo(divisor, dividend);
Wiki
-
Filters
- IIR Filters
- FIR Filters
- Kernel-Based Filter
- Adaptive Filters
-
Signals
-
Peak Detection
-
Transformations
-
Speech
-
Windowing