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"]'
{{-1, 0.25}, {0, 0.5}, {1, 0.25}}
Discrete Wavelet Transform¶
DiscreteWaveletTransform gives a DiscreteWaveletData object; the
coefficients are accessed with wavelet indices:
$ wo 'dwd = DiscreteWaveletTransform[{1, 2, 3, 4}, HaarWavelet[], 1]; {Round[dwd[{0}, "Values"], 0.001], Round[dwd[{1}, "Values"], 0.001]}'
{{{2.121, 4.95}}, {{-0.707, -0.707}}}
InverseWaveletTransform reconstructs the data:
Symbolic data transforms exactly:
$ wo 'Rationalize[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¶
The continuous Mexican-hat wavelet evaluates numerically at a point:
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}}