As of Version 8, the functionality of the Wavelet Explorer add-on has been integrated into the Wolfram System.
Wavelet Filters
The following is a list of filters available in Wavelet Explorer, along with the equivalent form in Version 8.
| HaarFilter[] | WaveletFilterCoefficients[HaarWavelet[]] |
| DaubechiesFilter[n] | WaveletFilterCoefficients[DaubechiesWavelet[n]] |
| LeastAsymmetricFilter[n] | WaveletFilterCoefficients[SymletWavelet[n]] |
| CoifletFilter[n] | WaveletFilterCoefficients[CoifletWavelet[n]] |
| ShannonFilter[lim] | WaveletFilterCoefficients[ShannonWavelet[lim]] |
| MeyerFilter[n,lim] | WaveletFilterCoefficients[MeyerWavelet[n,lim]] |
| SplineFilter[n,lim] | WaveletFilterCoefficients[BattleLemarieWavelet[n,lim]] |
| BiorthogonalSplineFilter[n,m] | WaveletFilterCoefficients[BiorthogonalSplineWavelet[n,m]] |
| HighpassFilter[h] | WaveletFilterCoefficients[wave,"PrimalHighpass"] |
To compute wavelet coefficients, use the built-in function WaveletFilterCoefficients.
WaveletFilterCoefficients[DaubechiesWavelet[2]]Note that all wavelet coefficients are scaled by
relative to the results from Wavelet Explorer, so to get the equivalent values, you must multiply the result by
.
{#[[1]], Sqrt[2]#[[2]]}& /@ WaveletFilterCoefficients[DaubechiesWavelet[2]]To compute high-pass filter coefficients, use the "PrimalHighpass" argument to WaveletFilterCoefficients.
WaveletFilterCoefficients[DaubechiesWavelet[2], "PrimalHighpass"]Scaling and Wavelet Functions
The following is a list of functions available in Wavelet Explorer, along with the equivalent form in Version 8.
| ScalingFunction[filt,j] | WaveletPhi[wave] |
| Wavelet[wave,j] | WaveletPsi[wave] |
| ShannonPhi[t] | WaveletPhi[ShannonWavelet[lim],t] |
| ShannonPsi[t] | WaveletPsi[ShannonWavelet[lim],t] |
| MeyerPhi[n,t,lim] | WaveletPhi[MeyerWavelet[n,lim],t] |
| MeyerPsi[n,t,lim] | WaveletPsi[MeyerWavelet[n,lim],t] |
| SplinePhi[n,t,lim] | WaveletPhi[BattleLemarieWavelet[n,lim],t] |
| SplinePsi[n,t,lim] | WaveletPsi[BattleLemarieWavelet[n,lim],t] |
| BSpline[n,t] | BSplineBasis[{n,{u1,u2,…}},0,t] |
| DScalingFunction[filt,jmax,m] | Dt[WaveletPhi[wave,t],{t,m}] |
| DWavelet[filt,jmax,m] | Dt[WaveletPsi[wave,t],{t,m}] |
The functionality of ScalingFunction is now available by using WaveletPhi.
Plot[WaveletPhi[DaubechiesWavelet[2], x], {x, 0, 3}]To find the derivative of the scaling function, use Dt and WaveletPhi.
Plot[Evaluate[Dt[WaveletPhi[DaubechiesWavelet[6], x], {x, 1}]], {x, 0, 11}, PlotRange -> All]The functionality of DWavelet is now available by using Dt and WaveletPsi.
Plot[Evaluate[Dt[WaveletPsi[SymletWavelet[10], x], {x, 1}]], {x, -9, 10}, PlotRange -> {{-5, 5}, All}]Compute higher-order derivatives of the scaling and wavelet function.
wave = SymletWavelet[10];The InterpolatingFunction outputted from WaveletPhi and WaveletPsi has InterpolationOrder set to 1. Hence the second derivative comes out to be 0.
func = WaveletPsi[wave, x]Plot[Evaluate[Dt[func, {x, 2}]], {x, -9, 10}, PlotRange -> {{-5, 5}, All}]Resampling and interpolating with a higher InterpolationOrder resolves the issue.
ifunc = ListInterpolation[Table[WaveletPsi[wave, x], {x, -9, 10, 0.01}], {-9, 10}]Plot[Evaluate[Dt[ifunc[x], {x, 2}]], {x, -9, 10}, PlotRange -> {{-5, 5}, All}]The functionality of BSpline is now available by using the built-in function BSplineBasis.
bspline[n_, t_] := BSplineBasis[{n, Range[-Floor[(n + 1/2)], Ceiling[(n + 1/2)]]}, 0, t]Plot[bspline[6, t], {t, -3, 4},
PlotRange -> All]Wavelet Transforms
The following is a list of wavelet transforms available in Wavelet Explorer, along with the equivalent form in Version 8.
| WaveletTransform[data,filt,j] | DiscreteWaveletTransform[data,wave,j] |
| InverseWaveletTransform[wd,filt] | InverseWaveletTransform[dwd] |
| WaveletPacketCoefficients[data,filt,j] | DiscreteWaveletPacketTransform[data,filt,j] |
| WaveletPacketTransform[data,filt,l] | WaveletBestBasis[DiscreteWaveletPacketTransform[…]] |
| InverseWaveletPacketTransform[wpdata,filt] | InverseWaveletTransform[dwd] |
The functionality of WaveletTransform is now available by using DiscreteWaveletTransform.
Simplify@DiscreteWaveletTransform[Range[4], WorkingPrecision -> ∞][Automatic]To compute a packet transform, use DiscreteWaveletPacketTransform.
dwpt = DiscreteWaveletPacketTransform[Range[8], DaubechiesWavelet[2], 2]Use InverseWaveletTransform to compute the inverse:
InverseWaveletTransform[dwpt]The functionality of MRDecomposition can be replicated as follows.
dwd = DiscreteWaveletTransform[Range[8]];InverseWaveletTransform[wd, Automatic, #]& /@ wd["BasisIndex"]Total[%]Sine & Cosine Transforms
The following is a list of functions available in Wavelet Explorer, along with the equivalent form in Version 8.
| CosTransform[data,n, BasisType->m] | FourierDCT[data,m] |
| SinTransform[data,n,BasisType->m] | FourierDST[data,m] |
| InverseCosTransform[cdata] | FourierDCT[cdata,m] |
| InverseSinTransform[sdata] | FourierDST[sdata,m] |
To compute SinTransform, use the built-in function FourierDST.
FourierDST[{Range[8]}, 4]SinTransform with a specified second argument.
Map[FourierDST[#, 4]&, Partition[Range[8], 2]]In one dimension, the functionality of SinPacketCoefficients can be replicated as follows.
sinPacketCoefficients[data_ ? VectorQ, j_Integer, ftype_Integer ? (1 ≤ # ≤ 4&)] :=
Module[{sdata, l},
(* Split data into octave lengths *)
l = 2^Range[j, 0, -1];
sdata = Rest@FoldList[{id, oct} Flatten[Map[Partition[#, oct]&, id], 1], {data}, l];
(* Map FourierDST over the data *)
Map[FourierDST[#, ftype]&, sdata, {2}]
]sinPacketCoefficients[Range[8], 3, 4]Similarly, we can write CosPacketCoefficients using FourierDCT.
cosPacketCoefficients[data_ ? VectorQ, j_Integer, ftype_Integer ? (1 ≤ # ≤ 4&)] := Module[{sdata, l},
(* Split data into octave lengths *)
l = 2^Range[j, 0, -1];sdata = Rest[FoldList[Function[{id, oct}, Flatten[(Partition[#1, oct]&) /@ id, 1]], {data}, l]];
(* Split data into octave lengths *)
Map[FourierDCT[#1, ftype]&, sdata, {2}]]cosPacketCoefficients[Range[8], 3, 4]Other Utilities
The following is a list of functions available in Wavelet Explorer, along with the equivalent form in Version 8.
| PlotCoefficients[wd] | WaveletListPlot[dwd] |
| PhaseSpacePlot[wd] | WaveletScalogram[dwd] |
| ShowBasisPosition[wd] | DiscreteWaveletData[…]["BestBasisBlockView"] |
| PlotCoefficients2D[wd] | WaveletMatrixPlot[dwd] |
| ShowBasisPosition2D[wd] | DiscreteWaveletData[…]["BestBasisBlockView"] |
| WaveletCompress[wd,…] | WaveletThreshold[dwd,tspec] |
To plot wavelet coefficients, use WaveletScalogram.
dwd = DiscreteWaveletPacketTransform[Table[Sin[x^3], {x, -6, 6, 12 / 1023}], HaarWavelet[], 2]WaveletScalogram[dwd, Frame -> True, FrameTicks -> None, AspectRatio -> 1 / 2]Use WaveletThreshold for data compression.
SeedRandom[11];
data = RandomReal[1, {16}];dwd = DiscreteWaveletTransform[Range[8], HaarWavelet[], 3]WaveletThreshold[dwd, {"LargestCoefficients", 4}, Automatic][Automatic, "Values"]The function CumulativeEnergy can be written as follows.
dwd = DiscreteWaveletTransform[Range[8], HaarWavelet[]];cumulativeEnergy[data_] := Accumulate[Reverse[Sort[Abs[Flatten[data]]]]^2]
cumulativeEnergy[data_, n_Integer] := Accumulate[Reverse[Take[Sort[Abs[Flatten[data]]], -n]]^2]cumulativeEnergy[dwd[Automatic, "Values"]]cumulativeEnergy[dwd[Automatic, "Values"], 4]