smrfeld / Total-Variation-Regularization-Derivative-Python

Differentiate noisy signals with total variational regularization in Python and Mathematica

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Differentiate noisy signals with Total Variation Regularization (TVR) in Python and Mathematica

This repo gives an implementation with examples of how to differentiate noisy signals using Total Variation Regularization (TVR).

You can read more about this on Medium.

Here's a quick example of a signal:

drawing

it's noisy derivative:

drawing

and it's amazingly smooth derivative from TVR:

drawing

Code

  • mathematica contains an implementation in Mathematica. The example is worked out here in greater detail.
  • python contains an implementation in Python. This is a fairly basic implementation, so be careful applying it to large problems (1k+ data points).

Relevant literature

This code heavily uses the method described in Numerical Differentiation of Noisy, Nonsmooth Data. A good description of the lagged diffusivity algorithm can be found in one of the references: Chapter 8 - Total Variation Regularization.

Detailed example

You can read more about this on Medium.

drawing

About

Differentiate noisy signals with total variational regularization in Python and Mathematica


Languages

Language:Mathematica 99.3%Language:Python 0.7%