# What is a “Hampel Filter” and how does it work?

One of the new functions in the MATLAB Signal Processing toolbox for R2015b is the Hampel Filter. It appears to be used for outlier removal and from the examples, it looks like it might do a better job than a median filter.

Unfortunately, as of yet there appears to be no readily available digestible description of the filter (such as a Wikipedia page).

So, what is a Hampel Filter? How does it work? How computationally expensive is it? When does it work well? When does it not work so well?

The $3\sigma$ rule is enforced via the estimator $\sigma \approx 1.4826\ \operatorname{MAD}$.