Description Usage Arguments Details Value Note Author(s) References See Also Examples
Denoises an input signal contaminated by noise. First the signal is decomposed using the modified lifting scheme (coded in fwtnpperm
) using a prespecified order, known as path or trajectory, of point removal. Once the signal is decomposed into wavelet coefficients (or details), these are subjected to an empirical Bayes shrinkage procedure in order to remove the noise, the transform is inverted and an estimate of the noisy signal is obtained.
1 2 |
x |
Vector of any length (not necessarily equally spaced) that gives the grid on which the signal is observed. |
f |
Vector of the same length as |
pred |
The type of regression to be used in the prediction step of the modified lifting algorithm. Choices are linear, quadratic or cubic (respectively, |
neigh |
Number of neighbours to be used in order to construct the neighbourhood of each point that has to be removed. If ' |
int |
Specifies whether ( |
clo |
If ( |
keep |
Number of scaling points we want at the end of the transform. The usual choice is |
rule |
The type of Bayesian shrinkage technique, with possible choices posterior median ( |
per |
Vector of length (length( |
returnall |
Indicates whether the function returns useful variables or just the denoised datapoints. |
Once the modified lifting transform is applied, the wavelet coeficients are divided into artificial levels. The details obtained by means of a lifting scheme have different variances, and will therefore be normalized to have the same variance as the noise. Those normalized details falling into the finest artificial level will be used for estimating the standard deviation of the noise that contaminated the signal. Using this estimate, the normalized details can then be shrunk and un-normalized (using package 'EbayesThresh'), and the transform inverted (using the function invtnp
of package 'adlift') to give an estimate of the signal. The choices for pred
can be found in the package 'adlift'.
If returnall=FALSE, the estimate of the function after denoising. If returnall=TRUE, a list with components:
fhat |
Estimated signal after removing the noise. |
w |
This is the matrix associated to the modified lifting transform. |
indsd |
Vector giving the standard deviations of the detail and scaling coefficients. |
al |
List giving the split of points between the artificial levels. |
sd |
Estimated standard deviation of the noise. |
Use this function together with the "adlift" and "EbayesThresh" packages available from CRAN.
Marina Knight (marina.knight@bristol.ac.uk)
See the paper 'A "nondecimated" lifting transform' by Knight, M.I. and Nason, G.P. (2008) for further details.
fwtnpperm
, fwtnpperm
, and also invtnp
of package 'adlift'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # construct a grid
x<-runif(256)
# construct a true, normally unknown, signal
g<-make.signal2("bumps",x=x)
# now generate noise (here with mean 0 and signal-to-noise ratio 3)
noise<-rnorm(256,mean=0,sd=sqrt(var(g))/3)
# obtain a noisy version of the true signal g
f<-g+noise
# construct the trajectory which will indicate the order of point removal that will be followed by
# the modified lifting algorithm
# vec below gives the first (length(x)-keep) entries of a random permutation of (1:length(x))
vec<-sample(1:256,254,FALSE)
# denoise the signal (x,f) by applying the modified lifting transform following the removal order
# in vec and using adaptive prediction
# and neighbourhoods of size 2 in symmetrical configuration
# the details are then thresholded using posterior medians and the algorithm inverted
# the proposed estimate of g is given by out$fhat$coeff
out<-denoiseperm(x,f,pred=AdaptPred,neigh=1,int=TRUE,clo=FALSE,keep=2,rule="median",per=vec)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.