[R] denoising univariate data with wavelets

Roger Peng rpeng at stat.ucla.edu
Mon Oct 28 08:05:18 CET 2002


I'm not a wavelet expert, but a simple way (using the `wavethresh'
package) is:

x <- sort(runif(2^10))
y <- sin(2*pi*x) + .4 * rnorm(2^10)
plot(x, y)

wy <- wd(y)
thresh <- threshold(wy, type="soft")
yr <- wr(thresh)

lines(x, yr)

Hope this helps,

-roger
_______________________________
UCLA Department of Statistics
rpeng at stat.ucla.edu
http://www.stat.ucla.edu/~rpeng

On Sat, 26 Oct 2002, Jane Fridlyand wrote:

> 
> SORRY for the duplicate: sent to the wrong address the first time!!!
> _______________
> 
> Hi,
> 
> I am interested in a applying wavelets as a smoothing tool for my
> (1-dimensional) data. I looked into wavetresh and waveslim packages but
> could not quite figure out an obvious way to do this after running dwt or
> wt functions. Would someone be able to point me in the right direction on
> how to denoise univariate data using one of wavelet packages available in
> R?
> 
> Thank you very much
> 
> Jane
> 
> ps kalman filter does a good job on my data but tends to dampen spikes too
> much so i was looking to compare its performance with wavelets denoising.
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list