dwt(x, wavelet="s8", n.levels=6, boundary=NULL, precondition=F, pdeg=0, pfrac=0, dual=F, analysis.filter=NULL, synthesis.filter=NULL, filter.reverse=F) as.dwt(x) idwt(x)
as.dwt
,
x
is an object of class
"ptable"
.
For
idwt
,
x
is an object of class
"dwt"
.
"d4", "s8"
.
See
wavelet
for a list of all available wavelet names.
For user-provided filter, input the values in
analysis.filter
and
synthesis.filter
below.
n.levels
is bigger than
ml
, where
ml
is the maximum possible level,
then
n.levels
is set to
ml
and a warning message is given.
The
max.level
function is used to compute
ml
.
"periodic"
,
"infinite"
,
"zero"
. See details below for a list of available
boundary rules.
boundary="interval"
only.
If
TRUE
, then a preconditioning transform will be applied
to the the data.
The preconditioning transformation preserves the vanishing
moments property when the DWT is applied to polynomial signals.
See Cohen, Daubechies, and Vial (1993) for details.
"infinite"
only:
degree of polynomial used for boundary extension.
boundary="infinite"
only:
fraction of data used to fit a polynomial of degree
pdeg
.
wavelet
for details.
filter
argument in
wave.filter
for
details.
filter
argument in
wave.filter
for
details. When
analysis.filter
is provided, then the default
synthesis.filter
is also
analysis.filter
.
dwt
, inheriting from the class
"wpt"
,
"wp"
, and
"crystal.vector"
or
"crystal.list"
.
When
boundary="infinite"
, the DWT is a list inheriting
from class
crystal.list
;
for other
boundary
rules, the DWT is a vector inheriting from class
crystal.vector
.
See
crystal.list.object
and
crystal.vector.object
for details.
as.dwt
coerces a
ptable
object to a
dwt
object.
idwt
applies the inverse DWT to the transform
coefficients to reconstruct the original signal.
Available boundary rules:
the original series is assumed to be periodic. Sample size must be divisible
by
2^(n.levels)
.
2^(n.levels)
. For
wavelet="s4", "s6", "s8", "s10", "s12", "s14", "s16"
only. pdeg
) extension;
a fraction (specified by
pfrac
) of data are used to fit two polynomial regression
models, one for each end.
For each crystal, extra coefficients (of maginitude
O(length(filter))
)
are stored as
left.pad
and
right.pad
in order to recover all the
coefficients (infinite number of them!).
boundary
rule is set based on sample size,
filter length in the following way:
if
n.levels
can be achieved by
"periodic"
boundary rule (i.e.
sample size is divisible by
2^n.levels
), then the
boundary
is set to be
"periodic"
; otherwise, the
boundary
is set to be either
"reflection"
(for biorthogonal symmetric/anti-symmetric wavelets), or
"zero"
.
Reversed wavelet filter is also a wavelet filter. The corresponding wavelet
function will be flipped around the middle of its support. All the properties
of the original wavelet are preserved.
All the default optional arguments can be reset using function
wavelet.options
. See
wavelet.options
for details.
Daubechies, I. (1992).
Ten Lectures on Wavelets.
SIAM, Philadelphia.
Cohen, A., Daubechies, I. and Vial, P. (1993). Wavelets on the Interval and Fast
Wavelet Transforms,
Applied and Computational Harmonic Analysis,
Vol 1, 54-81.
xx <- make.signal("doppler", 512, snr=5) # a noisy doppler siganl par(mfrow=c(2,2)) plot(xx, type="l", xlab="") yy <- dwt(xx, wavelet="s8", boundary="periodic", n.levels=4) plot(yy) yy[c("d1","d2","d3")] <- 0 # set finer level coefficients 0 x2 <- reconstruct(yy) # reconstructed doppler plot(x2, type="l", xlab="") yy[["d4"]][-(6:9)] <- 0 # assign 0's to all but the 6-9th coefficients x3 <- reconstruct(yy) # reconstructed doppler plot(x3, type="l", xlab="", ylab="")