[R] what's the R code for wavelet decomposition (Haar transformation)?

Albyn Jones jones at reed.edu
Mon Oct 19 23:58:33 CEST 2009


There is a dwt() in package:waveslim, reading the help file:

 dwt(x, wf="la8", n.levels=4, boundary="periodic")

wf: Name of the wavelet filter to use in the decomposition.  By
          default this is set to '"la8"', the Daubechies orthonormal
          compactly supported wavelet of length L=8 (Daubechies, 1992),
          least asymmetric family. 

I don't see a list of wavelet filter names in the documentation, but
as I recall, there is one in one of the functions: wave.filter().
Look at the code for wave.filer, it includes the following code:

switch(name, haar = select.haar(), d4 = select.d4(), mb4 = select.mb4(), 
        w4 = select.w4(), bs3.1 = select.bs3.1(), fk4 = select.fk4(), 
        d6 = select.d6(), fk6 = select.fk6(), d8 = select.d8(), 
        fk8 = select.fk8(), la8 = select.la8(), mb8 = select.mb8(), 
        bl14 = select.bl14(), fk14 = select.fk14(), d16 = select.d16(), 
        la16 = select.la16(), mb16 = select.mb16(), la20 = select.la20(), 
        bl20 = select.bl20(), fk22 = select.fk22(), mb24 = select.mb24(), 
        stop("Invalid selection for wave.filter"))

try

            dwt(x, wf="haar")

albyn

On Mon, Oct 19, 2009 at 02:41:56PM -0500, stephen sefick wrote:
> What package are you using?  There are quite a few functions that do
> wavelet decomposition.  Have you tried an R site search?
> 
> Stephen
> 
> On Fri, Oct 16, 2009 at 3:43 PM, Zhen Li <zli at bios.unc.edu> wrote:
> > Dear all,
> >
> > Using R function "dwt", it seems that I cannot specify the wavelet
> > transformation like Haar. What's the R code for wavelet decomposition which
> > allows me to specify Haar wavelet transformation? Of course, if it can
> > include "db2", that is even better. In general, I want an R function like
> > matlab code "dwt". Thanks in advance!
> >
> > Zhen Li
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> 
> 
> 
> -- 
> Stephen Sefick
> 
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods.  We are mammals, and have not exhausted the
> annoying little problems of being mammals.
> 
> 								-K. Mullis
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list