Wavelet Analysis¶
Woxi implements the Wolfram Language wavelet analysis functions: wavelet families, filter coefficients, discrete and continuous wavelet transforms, coefficient manipulation, and wavelet visualization.
Wavelet Families¶
Wavelet families are symbolic constructor objects:
Filter Coefficients¶
WaveletFilterCoefficients gives the filter as {index, coefficient}
pairs. Lowpass coefficients sum to 1:
Exact coefficients with WorkingPrecision -> Infinity:
$ wo 'WaveletFilterCoefficients[DaubechiesWavelet[2], "PrimalLowpass", WorkingPrecision -> Infinity]'
{{0, (1 + Sqrt[3])/8}, {1, (3 + Sqrt[3])/8}, {2, (3 - Sqrt[3])/8}, {3, (1 - Sqrt[3])/8}}
Biorthogonal families have separate primal and dual filters:
$ wo 'WaveletFilterCoefficients[BiorthogonalSplineWavelet[2, 2], "DualLowpass"]'
{{-2, -1/8}, {-1, 1/4}, {0, 3/4}, {1, 1/4}, {2, -1/8}}
Discrete Wavelet Transform¶
DiscreteWaveletTransform gives a DiscreteWaveletData object; the
coefficients are accessed with wavelet indices:
$ wo 'dwd = DiscreteWaveletTransform[{1, 2, 3, 4}, HaarWavelet[], 1]; dwd[All]'
{{0} -> {2.121320343559643, 4.949747468305833}, {1} -> {-0.7071067811865476, -0.7071067811865476}}
InverseWaveletTransform reconstructs the data:
Symbolic data transforms exactly:
$ wo 'Simplify[InverseWaveletTransform[DiscreteWaveletTransform[{a, b, c, d}, HaarWavelet[]]]]'
{a, b, c, d}
Lifting Wavelet Transform¶
The lifting transform computes exact results for exact input:
$ wo 'Normal[LiftingWaveletTransform[{1, 1, 3, 1}, HaarWavelet[], 1, WorkingPrecision -> Infinity]]'
{{0} -> {Sqrt[2], 2*Sqrt[2]}, {1} -> {0, Sqrt[2]}}
Wavelet and Scaling Functions¶
Thresholding¶
WaveletThreshold shrinks detail coefficients (here soft thresholding
with an explicit threshold value):
$ wo 'WaveletThreshold[DiscreteWaveletTransform[{1., 5., 2., 8.}], {"Soft", 1.}][{1}, "Values"]'
{-1.8284271247461903, -3.2426406871192857}