Skip to content

Commit

Permalink
Add new metric
Browse files Browse the repository at this point in the history
  • Loading branch information
smoia committed Oct 8, 2024
1 parent 8822555 commit eba4978
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion physioqc/metrics/multimodal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eba4978

Please sign in to comment.