emddenoise: Denoising by EMD and Thresholding

Description Usage Arguments Details Value References See Also Examples

View source: R/EMD1d.R

Description

This function performs denoising by empirical mode decomposition and thresholding.

Usage

1
2
3
4
emddenoise(xt, tt = NULL, cv.index, cv.level, cv.tol = 0.1^3, 
    cv.maxiter = 20, by.imf = FALSE, emd.tol = sd(xt) * 0.1^2, 
    max.sift = 20, stoprule = "type1", boundary = "periodic", 
    max.imf = 10)

Arguments

xt

observation or signal observed at time tt

tt

observation index or time index

cv.index

test dataset index according to cross-validation scheme

cv.level

levels to be thresholded

cv.tol

tolerance for the optimization step of cross-validation

cv.maxiter

maximum iteration for the optimization step of cross-validation

by.imf

specifies whether shrinkage is performed by each IMS or not.

emd.tol

tolerance for stopping rule of sifting. If stoprule=type5, the number of iteration for S stoppage criterion.

max.sift

the maximum number of sifting

stoprule

stopping rule of sifting. The type1 stopping rule indicates that absolute values of envelope mean must be less than the user-specified tolerance level in the sense that the local average of upper and lower envelope is zero. The stopping rules type2, type3, type4 and type5 are the stopping rules given by equation (5.5) of Huang et al. (1998), equation (11a), equation (11b) and S stoppage of Huang and Wu (2008), respectively.

boundary

specifies boundary condition from “none", “wave", “symmetric", “periodic" or “evenodd". See Zeng and He (2004) for evenodd boundary condition.

max.imf

the maximum number of IMF's

Details

This function performs denoising by empirical mode decomposition and cross-validation. See Kim and Oh (2006) for details.

Value

dxt

denoised signal

optlambda

threshold values by cross-validation

lambdaconv

sequence of lambda's by cross-validation

perr

sequence of prediction error by cross-validation

demd

denoised IMF's and residue

niter

the number of iteration for optimal threshold value

References

Huang, N. E., Shen, Z., Long, S. R., Wu, M. L. Shih, H. H., Zheng, Q., Yen, N. C., Tung, C. C. and Liu, H. H. (1998) The empirical mode decomposition and Hilbert spectrum for nonlinear and nonstationary time series analysis. Proceedings of the Royal Society London A, 454, 903–995.

Huang, N. E. and Wu, Z. (2008) A review on Hilbert-Huang Transform: Method and its applications to geophysical studies. Reviews of Geophysics, 46, RG2006.

Kim, D. and Oh, H.-S. (2006) Hierarchical Smoothing Technique by Empirical Mode Decomposition (Korean). The Korean Journal of Applied Statistics, 19, 319–330.

Zeng, K and He, M.-X. (2004) A simple boundary process technique for empirical mode decomposition. Proceedings of 2004 IEEE International Geoscience and Remote Sensing Symposium, 6, 4258–4261.

See Also

cvtype, emd.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ndata <- 1024
tt <- seq(0, 9, length=ndata)
meanf <- (sin(pi*tt) + sin(2*pi*tt) + sin(6*pi*tt)) * (0.0<tt & tt<=3.0) + 
 (sin(pi*tt) + sin(6*pi*tt)) * (3.0<tt & tt<=6.0) +
 (sin(pi*tt) + sin(6*pi*tt) + sin(12*pi*tt)) * (6.0<tt & tt<=9.0)
snr <- 3.0
sigma <- c(sd(meanf[tt<=3]) / snr, sd(meanf[tt<=6 & tt>3]) / snr, 
sd(meanf[tt>6]) / snr)
set.seed(1)
error <- c(rnorm(sum(tt<=3), 0, sigma[1]), 
rnorm(sum(tt<=6 & tt>3), 0, sigma[2]), rnorm(sum(tt>6), 0, sigma[3]))
xt <- meanf + error 

cv.index <- cvtype(n=ndata, cv.kfold=2, cv.random=FALSE)$cv.index 

## Not run: 
try10 <- emddenoise(xt, cv.index=cv.index, cv.level=2, by.imf=TRUE)

par(mfrow=c(2, 1), mar=c(2, 1, 2, 1))
plot(xt, type="l", main="noisy signal")
lines(meanf, lty=2)
plot(try10$dxt, type="l", main="denoised signal")
lines(meanf, lty=2)
## End(Not run)

EMD documentation built on Jan. 4, 2022, 1:08 a.m.

Related to emddenoise in EMD...