Skip to content

hermite_spline_normalization

HermiteSplineNormalization

Bases: SignalFilter

fs = signals.fs instance-attribute

peaks_distance_scale = signals.peaks_distance_scale instance-attribute

__init__(signals)

filter()

Normalizes signal using Cubic Hermite Splines fitted to the amplitude bounds (maxima and minima) of the signal.

Distance between min and max peaks determined as fraction of the median frequency.

Returns:

Type Description
ndarray

np.ndarray: Normalized EGMs.

find_extended_peaks(signal, distance) staticmethod

Find peaks and add 0 and len(signal) - 1 as peaks without duplication

Parameters:

Name Type Description Default
signal ndarray[N]

Input signal.

required
distance float

Minimal distance between peaks.

required

Returns:

Name Type Description
tuple tuple[ndarray, ndarray]

Extended peaks and signal values at the peaks.

hermite_spline_bound(signal, distance) staticmethod

Find peaks and interpolate with CubicHermiteSpline

Parameters:

Name Type Description Default
signal ndarray[N]

Input signal.

required
distance float

Minimal distance between peaks.

required

Returns:

Type Description
ndarray

np.ndarray[N,]: Interpolated amplitudes.

lower_upper_bounds(distances)

Interpolates lower and upper bounds of the signal(s) using Cubic Hermit Spline.

Parameters:

Name Type Description Default
distances (ndarray[N], float)

Minimum distance between peaks.

required

Returns:

Type Description
tuple[ndarray, ndarray]

lower_bounds, upper_bounds (tuple): Lower and upper bounds of the signals.