Description Usage Arguments Value Algorithms for TV-L2 problem References Examples

Given a 1-dimensional signal `f`

, it solves an optimization of the form,

*u^* = argmin_u E(u,f)+λ V(u)*

where *E(u,f)* is fidelity term and *V(u)* is total variation regularization term.
The naming convention of a parameter `method`

is `<problem type>`

+ `<name of algorithm>`

.
For more details, see the section below.

1 |

`signal` |
vector of noisy signal. |

`lambda` |
regularization parameter (positive real number). |

`niter` |
total number of iterations. |

`method` |
indicating problem and algorithm combination. |

a vector of same length as input `signal.`

The cost function for TV-L2 problem is

*min_u \frac{1}{2} |u-f|_2^2 + λ |\nabla u|*

where for a given 1-dimensional vector, *|\nabla u| = ∑ |u_{i+1}-u_{i}|*.
Algorithms (in conjunction with model type) for this problems are

`"TVL2.IC"`

Iterative Clipping algorithm.

`"TVL2.MM"`

Majorization-Minorization algorithm.

The codes are translated from MATLAB scripts by Ivan Selesnick.

rudin_nonlinear_1992tvR

\insertRefselesnick_convex_2015tvR

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
## generate a stepped signal
x = rep(sample(1:5,10,replace=TRUE), each=50)
## add some additive white noise
xnoised = x + rnorm(length(x), sd=0.25)
## apply denoising process
xproc1 = denoise1(xnoised, method = "TVL2.IC")
xproc2 = denoise1(xnoised, method = "TVL2.MM")
## plot noisy and denoised signals
plot(xnoised, pch=19, cex=0.1, main="Noisy signal")
lines(xproc1, col="blue", lwd=2)
lines(xproc2, col="red", lwd=2)
legend("bottomleft",legend=c("Noisy","TVL2.IC","TVL2.MM"),
col=c("black","blue","red"),#' lty = c("solid", "solid", "solid"),
lwd = c(0, 2, 2), pch = c(19, NA, NA),
pt.cex = c(1, NA, NA), inset = 0.05)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.