Wavelet Analysis

Perform wavelet analysis (orthogonal,translation invariant, tensorial, 1-2-3d transforms, thresholding, block thresholding, linear,...) with applications to data compression or denoising/regression. The core of the code is a port of 'MATLAB' Wavelab toolbox written by D. Donoho, A. Maleki and M. Shahram (< https://statweb.stanford.edu/~wavelab/>).

Build Status

Wavelet Analysis

Download and Install

Install the devtools package if you haven't already.


To install the package, type the following at the R command line:


Getting started

Here is an example of denoising of an experimental nuclear magnetic resonance (NMR) spectrum. We start by loading the data:

Y <- RaphNMR
n <- length(Y)
t <- seq(0, 1, length = n)

Then we specify the coarse decomposition scale j0, the wavelets we want to use (here, Symmlet with 6 null moments) and we perform a fast wavelet transform to get the noisy wavelet coefficients (Ywd):

j0 <- 0
J <- log2(n)
qmf <- MakeONFilter('Symmlet',6)
Ywd <- FWT_PO(Y, j0, qmf)
Ywnoise <- Ywd

We estimate the standard deviation σ of the noise using the maximum absolute deviation (with only the finest scale coefficients). We apply a hard thresholding rule (with a universal threshold) to the coefficient estimators and obtain the estimator by applying an inverse transform:

hatsigma <- MAD(Ywd[(2^(J-1)+1):2^J])
lambda <- sqrt(2*log(n))*hatsigma
Ywd[(2^(j0)+1):n] <- HardThresh(Ywd[(2^(j0)+1):n], lambda)
fhat <- IWT_PO(Ywd, j0, qmf)

Finally, we plot the resulting estimator:

par(mfrow=c(2,2), mgp = c(1.2, 0.5, 0), tcl = -0.2,
    mar = .1 + c(2.5,2.5,1,1), oma = c(0,0,0,0))
plot(t,Y,xlab="", ylab="", main="Observations")
plot(t,Y,xlab="", ylab="", main="Observations and Estimator")
matlines(t, fhat, lwd=2, col="blue", lty=1)
plot(Ywnoise, ylim=c(-20, 20), xlab="", ylab="", main = "Noisy Coefficients")
matlines(rep(lambda, n), lwd=2,col="red",lty=1)
matlines(-rep(lambda, n), lwd=2,col="red",lty=1)
plot(Ywd, ylim=c(-20,20), xlab="", ylab="", main = "Estimated Coefficients")

See the package vignette for more details. You could also build and see the vignette associated with the package using the following lines of code

devtools::install_github("fabnavarro/rwavelet", build_vignettes = TRUE)

Then, to view the vignette


How to cite

#> To cite rwavelet in publications use:
#>   F. Navarro and C. Chesneau (2018). R package rwavelet: Wavelet
#>   analysis in R (Version 0.1.0). Available from
#>   http://github.com/fabnavarro/rwavelet
#> A BibTeX entry for LaTeX users is
#>   @Manual{,
#>     title = {R package {rwavelet}: Wavelet analysis in R},
#>     author = {F. Navarro and C. Chesneau},
#>     year = {2018},
#>     note = {(Version 0.1.0)},
#>     url = {http://github.com/fabnavarro/rwavelet},
#>   }


rwavelet News

rwavelet 0.2.0. release

  • Added 3-d Discrete Wavelet Transformation (FWT3_PO, IWT3_PO)

rwavelet 0.3.0. release

  • Added 2-d Tensor Discrete Wavelet Transformation (FTWT2_PO, ITWT2_PO)

rwavelet 0.4.0. release

  • Added 1-d Wavelet Block Thresholding (BlockThresh)
  • 2-Fold Cross-Validation for choising the truncation parameter (CVlinear)
  • Added 2-d Translation Invariant Forward/Inverse Wavelet Transform (FWT2_TI, IWT2_TI)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.4.1 by Navarro Fabien, a year ago


Report a bug at https://github.com/fabnavarro/rwavelet/issues

Browse source code at https://github.com/cran/rwavelet

Authors: F. Navarro and C. Chesneau

Documentation:   PDF Manual  

LGPL (>= 2) license

Imports signal

Suggests knitr, rmarkdown, misc3d, imager

See at CRAN