Which base class you choose depends on whether your filter must copy media samples or can transform them in place. See Determine Which Base Classes to Use for more information. This routine is much useful for detecting spikes on a variable baseline but performs superiorly to the low-pass filtered derivative when spikes frequency content is close to that of the baseline. The principle of this algorithm is comparable to a running-average, except that instead of computing an average, we estimate the median. This approach is more computer-intensive but works quite well on real data.
Source code is available.
Inc. All rights reserved.