# nlt: Denoise a signal using a nondecimated lifting transform In nlt: A Nondecimated Lifting Transform for Signal Denoising

## Description

Starting with a noise-contaminated signal, we decompose it using a 'nondecimated' lifting algorithm (i.e. by applying the modified lifting transform following several random paths), shrink all the obtained detail coefficients and invert each transform to give an estimated signal. The average of all these estimates is the final proposal for estimating the true (unknown) signal.

## Usage

 ```1 2``` ```nlt(x, f, J, Pred = AdaptPred, neighbours = 1, closest = FALSE, intercept = TRUE, nkeep = 2, trule = "median",verbose = TRUE,do.orig = FALSE, returnall = FALSE) ```

## Arguments

 `x` Vector of any length (possibly irregularly spaced) that gives the grid locations where the signal is observed. `f` Vector of the same length as `x` that gives the signal values corresponding to the `x`-locations. `J` Number of trajectories to be used by the nondecimated lifting algorithm. `Pred` The type of regression to be used in the prediction step of the modified lifting algorithm. Choices are linear, quadratic or cubic (respectively, `LinearPred`, `QuadPred` or `CubicPred`), or two adaptive procedures which automatically choose the degree used in regression, (`AdaptPred` or `AdaptNeigh`). `neighbours` Number of neighbours to be used for defining the neighbourhood of each point that has to be removed. If (`closest`=FALSE), then this gives the number of neighbours to be used on each side of the removed point. `closest` If (`closest`=TRUE) or (`closest`=FALSE), then at each step the neighbours are in closest, respectively symmetrical configuration. `intercept` Specifies whether (`intercept`=TRUE) or not (`intercept`=FALSE) an intercept is to be used in the regression curve. For `Pred`=`AdaptPred` or `AdaptNeigh`, the algorithm automatically makes this choice. `nkeep` Number of scaling points we want at the end of the application of the transform. The usual choice is `nkeep`=2. `trule` The type of Bayesian shrinkage technique, with possible choices posterior median (`"median"`) or posterior mean (`"mean"`). `verbose` A boolean indicating whether extra information should be printed. `do.orig` A boolean indicating whether the original `adlift` algorithm should also be computed. `returnall` A boolean indicating whether the function returns useful variables or just the denoised datapoints.

## Details

Essentially, this function applies `J` times the modified lifting algorithm (that can be found in `fwtnpperm`), and removes the noise from all sets of detail coefficients by using empirical Bayes shrinkage (of package 'EbayesThresh'). Inverting (by means of the function `invtnp` of the package 'adlift') each transform consequently results in `J` estimates of the (unknown) true signal. The average of these estimators is our proposed estimator. The functions that appear as choices for `Pred` can be found in the package 'adlift'.

## Value

 `vec` Matrix whose rows give the trajectories to be used by the nondecimated lifting algorithm. `ghatnat` Vector that gives the estimated true signal given by denoising using the lifting scheme that establishes its own order for removing the points (but with the same specification for prediction stage and neighbourhood as the modified algorithm), rather than a randomly generated order. `aveghat` Estimated signal, obtained as the average of the individual estimates from the random trajectory runs.

## Note

Use this function together with the "adlift" and "EbayesThresh" packages available from CRAN.

## Author(s)

Marina Knight (marina.knight@bristol.ac.uk)

## References

See the paper 'A "nondecimated" lifting transform.' by Knight, M.I. and Nason, G.P. (2009) for further details.

`denoiseperm`, `fwtnpperm`, `fwtnpperm`, and also `invtnp` of package 'adlift'

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20``` ```# construct the grid x<-runif(256) # construct the true, normally unknown, signal g<-make.signal2("blocks",x=x) # generate noise with mean 0 and signal-to-noise ratio 5 noise<-rnorm(256,mean=0,sd=sqrt(var(g))/5) # generate a noisy version of g f<-g+noise # decide on a number of random trajectories to be used (below J=100, in paper J=20,30), and apply # the nondecimated lifting transform to the noisy signal (x,f) # # below we apply the modified lifting transform J times, each time following a different path, # and using adaptive prediction with neighbourhoods of size 2 in closest configuration; # all details are then thresholded using posterior medians and the algorithms inverted # the aggregate estimator of g proposed by our method is found in out\$aveghat out<-nlt(x,f,J=10,Pred=AdaptPred,neighbours=2,closest=TRUE,intercept=TRUE,nkeep=2,trule="median") ```

### Example output

```Loading required package: EbayesThresh

**********************************************
adlift: a package to perform wavelet lifting schemes

--- Written by Matt Nunes and Marina Knight ---
Current package version:  1.3-3  ( 2017-09-13 )

-+ packaged by MAN +-
**********************************************

The following object is masked from 'package:EbayesThresh':

postmean.cauchy

**********************************************
nlt: a package to perform nondecimated wavelet lifting

--- Written by Marina Knight and Matt Nunes ---
Current package version:  2.1-3  ( 11/11/2012 )

-+ packaged by MAN +-
**********************************************

1 ...
2 ...
3 ...
4 ...
5 ...
6 ...
7 ...
8 ...
9 ...
10 ...
```

nlt documentation built on May 2, 2019, 6:11 a.m.