Total Variation Denoising help

I am trying to work through the "Mathematical exposition for 1D digital signals" in the wikipedia entry for Total Variation Denoising (TVD). I am familiar with Lagrange multipliers. However, I cant understand how to differentiate $$V(y)$$ and $$E(x,y)$$ with respect to $$y_n$$. Could someone walk me through this? A perfect answer would provide math and code I can use to step through in a numerical example.

Thanks!

• Could you explain what you need? How to solve it?
– Royi
Aug 26, 2017 at 11:28

Total variation is not differentiable when $y_{n+1} - y_n = 0$, because of the $\ell_1$ norm.
• Yes, your function, $V(y)=\sum_n |y_{n+1}-y_n|$ is not differentiable, because the $\ell_1$ norm is not differentiable at zero. Its subdifferential at zero is $[-1,1]$, so you can minimise $E+\lambda V$ by a subgradient algorithm. They are generally very slow, thought, so I recommend you use the other approaches I mentioned. Don't assume a possible situation will never occur; you will be taunting Murphy ;-) Feb 19, 2015 at 10:12