first.last(LengthH, DataLength, bc = c("periodic","symmetric"))
"periodic"
(default) or
"symmetric"
. If bc="periodic"
then
the pyramid is a true power of 2 pyramid, that is it starts with a
power of 2, and the next level is half of the previous.
If bc="symmetric"
then the pyramid is nearly exactly a power of 2, but
not quite, see the Details section for why this is so.
bc="periodic"
this is indeed what happens.
However, if bc="symmetric"
you actually need more than 1024 (as
the wavelets extend over the edges). The first/last database keeps track
of where all these "extras" appear and also where they are located in
the packed vectors C and D of pyramidal coefficients within wavelet
structures. For example, given a first.last.c row of
-2 3 20
The actual coefficients would be
$c_{-2}, c_{-1}, c_{0}, c_{1}, c_{2}, c_{3}$.
In other words, there are 6 coefficients, starting at -2 and ending at 3,
and the first of these ($c_{-2}$) appears at an offset of
20 from the beginning of the * $ C
component vector of the
wavelet structure.
You can ``do'' first.last in your head for periodic boundary handling,
but for more general boundary treatments (e.g. symmetric) first.last
is indispensable.
Daubechies, I. (1988). Orthonormal bases of compactly supported wavelets; Communications on Pure and Applied Mathematics, 41, 909-996.
wr
, accessC
, accessD
,
filter.select
, threshold
, wd
,
imwd
, imwr
.## If you're twisted then you may just want to look at one of these.
first.last(length(filter.select(2)), 64)
Run the code above in your browser using DataLab