Skip to content

← signal_processing package

PeakFindingContour

Find all peaks in the given data along a given axis.

This method uses a contour-based approach that allows for multiple criteria to be used to constrain what is considered a peak. By default, all criteria are inactive, except for the basic requirement that a peak sample must be higher than its two neighbors. By default, the offset is returned as the index of the element, counting from zero for the first element. However, in the special case that the node is applied over the time axis, it is possible to measure the offset instead in seconds, and one may also look up the position in seconds from the time axis (e.g., relative to whatever is 0 in the time axis). One can also optionally account for the delay of previous filter nodes, to the extent that the data is annotated with it. Version 0.3.0

Ports/Properties

indata

Input data.

  • verbose name: Indata
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: IN

latencies

Output peak latencies.

  • verbose name: Latencies
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

amplitudes

Output peak amplitudes.

  • verbose name: Amplitudes
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

axis

Axis along which to find the peak. This axis will drop out of the data and be replaced by a one-element feature axis.

  • verbose name: Find Peak Along Axis
  • default value: time
  • port type: ComboPort
  • value type: str (can be None)

negative

Apply to negative peaks. If checked, the smallest element will be searched, instead of the largest.

  • verbose name: Find Negative Peaks
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

unit

Unit of measurement to use, depending on axis that the peak is searched along. Using seconds here works only if the operation is performed along the time axis, and if the axis has a sampling rate set.

  • verbose name: Unit Of Measurement
  • default value: samples
  • port type: EnumPort
  • value type: str (can be None)

min_distance

Minimum horizontal distance between any two peaks. If there are two peaks within this distance from each other, the smaller one will be ignored. Given in the selected unit.

  • verbose name: Min Distance Between Peaks
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

max_count

Maximum number of peaks to find. If more peaks are found, the ones with the highest amplitude will be kept.

  • verbose name: Max Count
  • default value: None
  • port type: IntPort
  • value type: int (can be None)

min_threshold

Minimum vertical distance between a peak and its neighboring samples. In signal units.

  • verbose name: Min Threshold
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

min_prominence

Minimum prominence of a peak. The prominence is the vertical distance between the peak and the higher one of its left or right baseline. The baseline is the lowest point between the peak and the adjacent higher peak or edge of the signal. In signal units.

  • verbose name: Min Prominence
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

min_width

Minimum width of a peak. The width is measured at a specific fraction (e.g., 0.5) of the peak's prominence subtracted from its peak height. Given in the selected unit.

  • verbose name: Min Width
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

min_height

Minimum absolute height of peak. This is measured from 0. In signal units.

  • verbose name: Min Height
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

min_plateau

Minimum size of the flat top of the peak. Given in the selected unit.

  • verbose name: Min Plateau Size
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

max_threshold

Maximum vertical distance between a peak and its neighboring samples.

  • verbose name: Max Threshold
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

max_height

Maximum absolute height of peak. This is measured from 0.

  • verbose name: Max Height
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

max_prominence

Maximum prominence of a peak. See min_prominence for the definition.

  • verbose name: Max Prominence
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

max_width

Maximum width of a peak. See min_width for the definition.

  • verbose name: Max Width
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

max_plateau

Maximum size of the flat top of the peak.

  • verbose name: Max Plateau Size
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

search_width

Width of the search window. When computing the prominence of a peak or its width, the method will stop at this width. This is mostly helpful for improving the compute time when processing large data.

  • verbose name: Search Width
  • default value: None
  • port type: FloatPort
  • value type: float (can be None)

relative_height

Relative height of the peak. This is the fraction of the prominence that is subtracted from the peak height when measuring the width. Only used if min/max width is given.

  • verbose name: Relative Height
  • default value: 0.5
  • port type: FloatPort
  • value type: float (can be None)

subtract_filter_delay

Subtract filter delay (time axis only). Note that this is most reliable when used with only linear-phase filters (e.g., FIR filter without minimum phase option), since otherwise the delay will depend on the frequency content of the signal.

  • verbose name: Subtract Filter Delay
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

account_for_time_axis

Look up latency from the time axis. If unchecked, the lantency will be computed relative to the beginning of the data segment, but if checked, it will be relative to whatever is 0.0 in the time axis (and would even work with irregularly sampled data).

  • verbose name: Respect Time Axis
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

update_on_streaming

Update on streaming data. If enabled (default), then this node will update its output measure on every chunk, whether it is marked as streaming or not. If False, then it will only update on non-streaming, chunks, such as calibration data.

  • verbose name: Update On Streaming Data
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)