JSci.maths.WaveletMath Maven / Gradle / Ivy
package JSci.maths;
/**
* The wavelet math library.
* This class cannot be subclassed or instantiated because all methods are static.
* @version 1.0
* @author Daniel Lemire
*/
public final class WaveletMath extends AbstractMath {
private WaveletMath() {}
/**
* Part of the Fast Wavelet Scheme.
* Downsampling of a set of data points in base 2
* with an arbitrary filter using zero-padding
* at the boundaries in 1D.
* @return an array half the length of the input data[]
* as long as data.length was even.
*/
public static Complex[] downsample(Complex filter[], Complex data[]) {
int loc=filter.length;
int demiloc=Math.round(loc/2f-0.5f);
int Nombre=data.length;
int DemiNombre=Math.round(Nombre/2f-0.5f);
Complex answer[]=new Complex[DemiNombre];
for(int i=0;i