Learn R Programming

SynchWave (version 1.1.2)

est_riskshrink_thresh: Estimate the RiskShrink Hard Thresholding Level

Description

This function estimates the RiskShrink hard thresholding level.

This code is translated from MATLAB Synchrosqueezing Toolbox, version 1.1 developed by Eugene Brevdo (http://www.math.princeton.edu/~ebrevdo/).

Usage

est_riskshrink_thresh(Wx, nv)

Arguments

Wx

wavelet transform of a signal, see cwt_fw

nv

number of voices

Value

the RiskShrink hard threshold estimate

Details

This function implements Defn. 1 of Sec. 2.4 in [1], using the suggested noise estimator from the discussion "Estimating the noise level" in that same section.

References

[1] Donoho, D. L. and Johnstone, I. M. (1994) Ideal spatial adaptation by wavelet shrinkage. Biometrika, 81, 425--455.

See Also

cwt_fw, cwt_iw.

Examples

Run this code
# NOT RUN {
tt <- seq(0, 10, , 1024)
nv <- 32
f0 <- (1+0.6*cos(2*tt))*cos(4*pi*tt+1.2*tt^2)
sigma <- 0.5
f <- f0 + sigma*rnorm(length(tt))

# Continuous wavelet transform
opt <- list(type = "bump")
cwtfit <- cwt_fw(f, opt$type, nv, tt[2]-tt[1], opt)

# Hard thresholing
thresh <- est_riskshrink_thresh(cwtfit$Wx, nv)
cwtfit$Wx[which(abs(cwtfit$Wx) < thresh)] <- 0.0
# }

Run the code above in your browser using DataLab