maad.features.surface_roughness

maad.features.surface_roughness(x, norm='global')[source]

Compute the surface roughness index of a signal (1D) or a spectrogram (2D).

Surface roughness is quantified by the deviations in the direction of the normal vector of a real surface from its ideal form. If these deviations are large, the surface is rough; if they are small, the surface is smooth [1].

Parameters:
xndarray of floats

vector (1d) or matrix (2d)

normstring, optional, default is ‘global’

Determine if the ROUGHNESS is normalized by the sum of the whole data (‘global’ mode) or by the sum of horizontal line for each line (‘per_bin’)

Returns:
Rascalar or 1d ndarray of scalars

if x is a vector => Arithmetical mean deviation of x. if x is a matrix => Arithmetical mean deviation of each line of x.

Rqscalar or 1d ndarray of scalars

if x is a vector => Root mean squared of deviationn of x. if x is a matrix => Root mean squared of deviation of each line of x.

References