waveletThresh: Apply thresholding regime to a set of wavelet coefficients

Description Usage Arguments Details Examples

View source: R/functions.R View source: R/RcppExports.R

Description

Applies a resolution level thresholding technique to a set of wavelet coefficients, embedded in a wavelet coefficient object.

Usage

1
waveletThresh(beta, thresh, shrinkType = "hard")

Arguments

beta

A waveletCoef object.

thresh

A numeric vector containing the thresholds to be applied to the coefficients at each resolution.

shrinkType

A character string that specifies which thresholding regime to use. Available choices are the 'hard', 'soft' or 'garrote'.

Details

Applies one of three specified wavelet thresholding regimes to a waveletCoef object (wavelet coefficient object created by multiCoef). If thresh is not specified, no thresholding is applied. The formulae applied for 'hard', 'soft' or 'garrote' are given by,

where 1 represents the indicator function and t > 0 represents the threshold.

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
25
26
27
28
29
library(mwaved)
# Simulate the multichannel doppler signal.
m <- 3
n <- 2^10
signal <- makeDoppler(n)
# Noise levels per channel
e <- rnorm(m * n)
# Create Gamma blur
shape <- seq(from = 0.5, to = 1, length = m)
scale <- rep(0.25, m)
G <- gammaBlur(n, shape = shape, scale = scale)
# Convolve the signal
X <- blurSignal(signal, G)
# Create error with custom signal to noise ratio
SNR <- c(10, 15, 20)
sigma <- sigmaSNR(X, SNR)
if (requireNamespace("fracdiff", quietly = TRUE)){
  alpha <- c(0.75, 0.8, 1)
} else {
  alpha <- rep(1, m)
}
E <- multiNoise(n, sigma, alpha)
# Create noisy & blurred multichannel signal
Y <- X + E
# Determine thresholds
thresh <- multiThresh(Y, G)
beta <- multiCoef(Y, G)
betaShrunk <- waveletThresh(beta, thresh)
plot(beta, betaShrunk)

jrwishart/mwaved documentation built on Oct. 31, 2021, 6:16 p.m.