Hi all, I am trying to do wavelets and I got an error message saying "The length of data is not a power of 2" Is there a way of handing that? or should the data length be exactly the power of 2? I am using R version 2.9.2 (2009-08-24) The is library(wavethresh). wds <- wd(ds$v,filter.number=1) Thanks
I believe that you can extend it to the power of 2 by padding it with zeros. I don't remember if it is at the begining or the end of the time series. hth stephen On Fri, Oct 23, 2009 at 7:56 AM, Ashta <sewashm at gmail.com> wrote:> Hi all, > > I am trying to do wavelets and I got ?an error message saying "The > length of data is not a power of 2" > Is there a way of handing ?that? or should the data length be ?exactly > the power of ?2? > I am using ? R version 2.9.2 (2009-08-24) > The is ?library(wavethresh). > > wds <- wd(ds$v,filter.number=1) > > Thanks > > ______________________________________________ > 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
hi all, I don't use the package "wavethresh", but I suppose that should be possible to fill of ZEROS (zero padding) the time series, such that its length has a 2^n elements. Another way is to cut (remove) some elements, so that, the new length has 2^n elements. You can get more info. @ A practical guide to Wavelet Analysis C. torrence and G. P.Compo Bulleting of the American Meteorology. Society. 1998 I hope this help you, -- Josue Polanco On Fri, Oct 23, 2009 at 2:56 PM, Ashta <sewashm at gmail.com> wrote:> Hi all, > > I am trying to do wavelets and I got ?an error message saying "The > length of data is not a power of 2" > Is there a way of handing ?that? or should the data length be ?exactly > the power of ?2? > I am using ? R version 2.9.2 (2009-08-24) > The is ?library(wavethresh). > > wds <- wd(ds$v,filter.number=1) > > Thanks > > ______________________________________________ > 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. >-- Josu? Mos?s Polanco Mart?nez Correo-e alternativo jomopo at linuxmail.org ---- It is a wasted day unless you have learned something new and made someone smile -Mark Weingartz.