What is a Hampel filter?
The Hampel filter is a member of the class of decsion filters that replaces the central value in the data window with the median if it lies far enough from the median to be deemed an outlier.
How do you use Hampel?
Use hampel to locate every sample that differs by more than three standard deviations from the local median. The measurement window is composed of the sample and its six surrounding samples, three per side. [y,i,xmedian,xsigma] = hampel(x); Plot the filtered signal and annotate the outliers.