Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Outlier removal using Hampel identifier

`y = hampel(x)`

`y = hampel(x,k)`

`y = hampel(x,k,nsigma)`

```
[y,j] =
hampel(___)
```

```
[y,j,xmedian,xsigma]
= hampel(___)
```

`hampel(___)`

applies
a Hampel filter to the input vector, `y`

= hampel(`x`

)`x`

, to detect
and remove outliers. For each sample of `x`

, the
function computes the median of a window composed of the sample and
its six surrounding samples, three per side. It also estimates the
standard deviation of each sample about its window median using the
median absolute deviation. If a sample differs from the median by
more than three standard deviations, it is replaced with the median.
If `x`

is a matrix, then `hampel`

treats
each column of `x`

as an independent channel.

`hampel(___)`

with no output
arguments plots the filtered signal and annotates the outliers that
were removed.

[1] Liu, Hancong, Sirish Shah, and Wei Jiang. “On-line
outlier detection and data cleaning.” *Computers
and Chemical Engineering*. Vol. 28, March 2004, pp. 1635–1647.

[2] Suomela, Jukka. “Median Filtering Is Equivalent to Sorting.” 2014.

`filloutliers`

| `filter`

| `isoutlier`

| `mad`

| `medfilt1`

| `median`

| `movmad`

| `movmedian`

| `sgolayfilt`