Skip to content

Add annotations to your signals

Full example code: examples/signal/signals_annotation.py

We can also annotate specific points in our signal. For a list of available annotations

# Show available filters
print(Signals.__annotation_keys__)
[
    'peak',
    'threshold',
    'ecg'
]

To annotate a signal, simply set the needed parameters and call the annotate method. Note that this method returns a list of indices of the detected points, rather than a Signals object.

properties = {
    "averaging_window_length": 20,
    "threshold": 0.11,
    "min_peak_distance": 100
}
filters = ['normalization', 'moving_average']

ecg_signals = Signals(ecg_array)
ecg_signals.set_properties(properties)
ecg_signals.apply_filters(filters)

# Annotations
idx_threshold = ecg_signals.annotate('threshold')
idx_peak = ecg_signals.annotate('peak')

Annotated signal


← Previous: Filter your signals