In statistics and signal processing, step detection (also known as step smoothing, step filtering, shift detection, jump detection or edge detection) is the process of finding abrupt changes (steps, jumps, shifts) in the mean level of a time series or signal. It is usually considered as a special case of the statistical method known as change detection or change point detection. Often, the step is small and the time series is corrupted by some kind of noise, and this makes the problem challenging because the step may be hidden by the noise. Therefore, statistical and/or signal processing algorithms are often required.
The step detection problem occurs in multiple scientific and engineering contexts, for example in statistical process control[1] (the control chart being the most directly related method), in exploration geophysics (where the problem is to segment a well-log recording into stratigraphic zones), in genetics (the problem of separating microarray data into similar copy-number regimes[2]), and in biophysics (detecting state transitions in a molecular machine as recorded in time-position traces[3]). For 2D signals, the related problem of edge detection has been studied intensively for image processing.[4]
When the step detection must be performed as and when the data arrives, then online algorithms are usually used,[5] and it becomes a special case of sequential analysis.Such algorithms include the classical CUSUM method applied to changes in mean.[6]
By contrast, offline algorithms are applied to the data potentially long after it has been received. Most offline algorithms for step detection in digital data can be categorised as top-down, bottom-up, sliding window, or global methods.
These algorithms start with the assumption that there are no steps and introduce possible candidate steps one at a time, testing each candidate to find the one that minimizes some criteria (such as the least-squares fit of the estimated, underlying piecewise constant signal). An example is the stepwise jump placement algorithm, first studied in geophysical problems,[7] that has found recent uses in modern biophysics.[8]
Bottom-up algorithms take the "opposite" approach to top-down methods, first assuming that there is a step in between every sample in the digital signal, and then successively merging steps based on some criteria tested for every candidate merge.
By considering a small "window" of the signal, these algorithms look for evidence of a step occurring within the window. The window "slides" across the time series, one time step at a time. The evidence for a step is tested by statistical procedures, for example, by use of the two-sample Student's t-test. Alternatively, a nonlinear filter such as the median filter is applied to the signal. Filters such as these attempt to remove the noise whilst preserving the abrupt steps.
Global algorithms consider the entire signal in one go, and attempt to find the steps in the signal by some kind of optimization procedure. Algorithms include wavelet methods,[9] and total variation denoising which uses methods from convex optimization. Where the steps can be modelled as a Markov chain, then Hidden Markov Models are also often used (a popular approach in the biophysics community[10]). When there are only a few unique values of the mean, then k-means clustering can also be used.
Because steps and (independent) noise have theoretically infinite bandwidth and so overlap in the Fourier basis, signal processing approaches to step detection generally do not use classical smoothing techniques such as the low pass filter. Instead, most algorithms are explicitly nonlinear or time-varying.[11]
Because the aim of step detection is to find a series of instantaneous jumps in the mean of a signal, the wanted, underlying, mean signal is piecewise constant. For this reason, step detection can be profitably viewed as the problem of recovering a piecewise constant signal corrupted by noise. There are two complementary models for piecewise constant signals: as 0-degree splines with a few knots, or as level sets with a few unique levels. Many algorithms for step detection are therefore best understood as either 0-degree spline fitting, or level set recovery, methods.
When there are only a few unique values of the mean, clustering techniques such as k-means clustering or mean-shift are appropriate. These techniques are best understood as methods for finding a level set description of the underlying piecewise constant signal.
Many algorithms explicitly fit 0-degree splines to the noisy signal in order to detect steps (including stepwise jump placement methods[7] [8]), but there are other popular algorithms that can also be seen to be spline fitting methods after some transformation, for example total variation denoising.[12]
All the algorithms mentioned above have certain advantages and disadvantages in particular circumstances, yet, a surprisingly large number of these step detection algorithms are special cases of a more general algorithm.[11] This algorithm involves the minimization of a global functional:[13]
Here, xi for i = 1, ...., N is the discrete-time input signal of length N, and mi is the signal output from the algorithm. The goal is to minimize H[''m''] with respect to the output signal m. The form of the function
\scriptstyleΛ
Λ=
12 | |
\left|x |
i-m
2 | |
j\right| |
I(i-j=0)+\gamma\left|mi-mj\right|I(i-j=1)
where I(S) = 0 if the condition S is false, and one otherwise, obtains the total variation denoising algorithm with regularization parameter
\gamma
Λ=min\left\{
12 | |
\left|m |
i-m
2,W\right\} | |
j\right| |
leads to the mean shift algorithm, when using an adaptive step size Euler integrator initialized with the input signal x.[13] Here W > 0 is a parameter that determines the support of the mean shift kernel. Another example is:
Λ=
| |||||||||||||
\beta |
⋅ I(|i-j|\leW)
leading to the bilateral filter, where
\scriptstyle\beta>0
Λ=
12 | |
\left|x |
i-m
2 | |
j\right| |
I(i-j=0)+\gamma\left|mi-m
0 | |
j\right| |
I(i-j=1)
specifying a group of algorithms that attempt to greedily fit 0-degree splines to the signal.[7] [8] Here,
\scriptstyle\left|x\right|0
Many of the functionals in equation defined by the particular choice of
\scriptstyleΛ
A classical variational method for step detection is the Potts model. It is given by the non-convex optimization problem
u*=
\argmin | |
u\in\RN |
\gamma\|\nablau\|0+\|
p | |
u-x\| | |
p |
The term
\|\nablau\|0=\#\{i:ui ≠ ui+1\}
\|
p | |
u-x\| | |
p |
=
N | |
\sum | |
i=1 |
|ui-
p | |
x | |
i| |
u*
\nablau*
p=2
p=1
O(N2)
L1