v2.0.0
Loading...
Searching...
No Matches
peak_finder.h File Reference

Local-maxima peak detection in 1-D signals with prominence filtering. More...

#include "dsp_global.h"
#include <Eigen/Core>
#include <QList>
#include <QPair>
Include dependency graph for peak_finder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UTILSLIB::PeakFinderParams

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Functions

DSPSHARED_EXPORT QList< QPair< int, double > > UTILSLIB::peakFinder (const Eigen::VectorXd &data, const PeakFinderParams &params=PeakFinderParams())
 Find peaks in a 1D signal.
DSPSHARED_EXPORT Eigen::VectorXd UTILSLIB::peakProminences (const Eigen::VectorXd &data, const QList< int > &peakIndices)
 Compute prominence of each peak.

Detailed Description

Local-maxima peak detection in 1-D signals with prominence filtering.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.1
Date
May 2026

A peak is defined as a sample that is strictly larger than its two direct neighbours. The basic detector locates every such sample in linear time; three classical post-filters then prune the candidate list:

  • a minimum height (absolute amplitude floor),
  • a minimum inter-peak distance in samples (suppressing close-by peaks by retaining only the tallest within the exclusion window), and
  • a minimum topographic prominence — the height by which a peak rises above the higher of the two adjacent valleys, computed in the same way as scipy.signal.peak_prominences.

The API mirrors scipy.signal.find_peaks closely so MEG/EEG analysis pipelines that already rely on SciPy semantics (cHPI peak picking, ECG R-wave detection, event onset extraction) port to mne-cpp without behavioural drift.

Definition in file peak_finder.h.