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:
it's noisy derivative:
and it's amazingly smooth derivative from TVR:
- 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).
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.