public class Wavelets extends Object
Modifier and Type | Field and Description |
---|---|
static double |
ACCURACY
Standard accuracy of computations of wavelet values.
|
static long |
accuracyBitMask
The bitmask which corresponds to the accuracy bits.
|
static int |
accuracyBits
Number of the stored highervalued (leftmost) bits of the mantissa of a double value.
|
static double[][] |
h
Daubechies filter coefficients Nhk = h[N-1][k]
for the D-2N wavelet, N = 1, 2, ..., 10, i.e., D2, D4, ..., D20.
|
static double[][] |
initialValues
Initial values phi(j) of the Daubechies scaling functions phi=phiN
for the D2 - D20 wavelets in dimension n=1.
|
Modifier and Type | Method and Description |
---|---|
static String |
checkH()
This routine checks the conditions the Daubechies coefficients have to satisfy.
|
static double[] |
inverseTransform(int N,
double[][] w)
Computes the inverse fast Daubechies wavelet transform of a two-dimensional array
w containing
a vector w[0] of the Daubechies D-N wavelet coefficients, and an array
w[1] containing the scaling function coefficient. |
static double |
phi(int N,
double x)
returns the value of the scaling function Nφ(x) of the
Daubechies wavelet DN, where N = 2, 4, ..., 20.
|
static double |
psi(int N,
double x)
returns the function value of the Daubechies wavelet Nψ(x)
of the Daubechies class DN, where N = 2, 4, ..., 20.
|
static String |
showDaubCoefficients(String format)
Returns a structured string representation of the normalized Daubechies
filter coefficients
h , in the specified format. |
static String |
showWaveletCoefficients(double[][] w)
Returns a structured string representation of the wavelet coefficients
given by the array w.
|
static double[][] |
transform(int N,
double[] a)
Computes the fast Daubechies wavelet transform of a data vector,
applying the Daubechies D-N wavelet; the returned two-dimensional array
contains the wavelet coefficients in its [0]-component, and the scaling function
coefficient in its [1]-component; N has to be an even number with
2 ≤ N ≤ 20.
|
public static final int accuracyBits
accuracyBitMask
,
Constant Field Valuespublic static final long accuracyBitMask
0xfffffffffffffL << (52 - accuracyBits)
,
since the mantissa of a double value consists of 52 bits.accuracyBits
,
Constant Field Valuespublic static final double ACCURACY
public static final double[][] h
public static final double[][] initialValues
public static double phi(int N, double x)
N
- the index of the Daubechies wavelet class D2 ... D20,x
- the value for which the scaling function value is computedaccuracyBits
,
accuracyBitMask
,
initialValues
,
psi(int,double)
public static double psi(int N, double x)
N
- the index of the Daubechies wavelet class D2 ... D20,x
- the value for which the wavelet value is computedphi(int,double)
public static double[][] transform(int N, double[] a)
The principle of the Daubechies wavelet transform is as follows. Initially, the data points a[0], ..., a[2n - 1] are identified as the coefficients of the Daubechies scaling function (or "father wavelet"). They determine recursively the wavelet coefficients c[k] according to the scheme
c0[k] = |
|
|||||||||||||||
a0[k] = |
|
|||||||||||||||
⇒ c1[k] = |
|
|||||||||||||||
a1[k] = |
|
|||||||||||||||
⇒ c2[k] = |
|
|||||||||||||||
a2[k] = |
|
|||||||||||||||
⇒ | . . . | |||||||||||||||
⇒ cn[k] = |
|
|||||||||||||||
an[k] = |
|
N
- the index of the applied Daubechie wavelet (N = 2, 4, ..., 20)a
- the data to be transformedinverseTransform(int,double[][])
public static double[] inverseTransform(int N, double[][] w)
w
containing
a vector w[0]
of the Daubechies D-N wavelet coefficients, and an array
w[1]
containing the scaling function coefficient.
There are the following three mandatory restrictions for the parameters,
due to the wavelet transform algorithm as performed by
transform
method:
w[0].length
of wavelet coefficients must satisfy
w[0].length
= 2n-1 for an integer n.
w[1].length
of scaling function coefficients must be 1.
N
- the index of the applied Daubechie wavelet (N = 2, 4, ..., 20)w
- the wavelet coefficients w[0]
and scaling function coefficients
w[1]
to be transformedtransform(int,double[])
public static String checkH()
- sumEven = sum_k^{N-1} h_{2k} = 1/sqrt(2); - sumOdd = sum_k^{N-1} h_{2k+1} = 1/sqrt(2); - For each integer m = 0, 1, ..., N-1: sum_{k=2m}^{2N-1+2m} h_{k} h_{k-2m} = 1 if m=0, = 0 otherwise.See http://math-it.org/Publikationen/Wavelets.pdf for details.
public static String showWaveletCoefficients(double[][] w)
w
- array of wavelet coefficientspublic static String showDaubCoefficients(String format)
h
, in the specified format.
The format can be one of the following string values:
"LaTeX"
for LaTeX format"Mathematica"
for Mathematica input format"Java (rescaled)"
for a Java formatted output of
the filter coefficients times √2
format
- format of the string to be returned. E.g., "LaTeX", "Mathematica", or "Java (rescaled)"