From eba49782932d767075d464f69b85addb313c7930 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Tue, 8 Oct 2024 11:22:18 +0200 Subject: [PATCH] Add new metric --- physioqc/metrics/multimodal.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/physioqc/metrics/multimodal.py b/physioqc/metrics/multimodal.py index 31a456f..0070c7e 100644 --- a/physioqc/metrics/multimodal.py +++ b/physioqc/metrics/multimodal.py @@ -142,7 +142,26 @@ def max(signal: np.array): @physio_or_numpy -def iqr(signal: np.array, q_high: float = 75, q_low: float = 25): +def max_amplitude(signal: np.array): + """ + Calculate max across input channels of signal. + + Parameters + ---------- + signal : np.array or peakdet Physio object + Physiological data + + Returns + ------- + N-sized array :obj:`numpy.ndarray` + max of signal. + """ + max_amp = np.max(signal, axis=0) - np.min(signal, axis=0) + return max_amp + + +@physio_or_numpy +def IQR(signal: np.array, q_high: float = 75, q_low: float = 25): """Calculate the Inter Quantile Range (IQR) over the input signal. Parameters