SciPy

scipy.stats.signaltonoise

scipy.stats.signaltonoise(a, axis=0, ddof=0)[source]

The signal-to-noise ratio of the input data.

Returns the signal-to-noise ratio of a, here defined as the mean divided by the standard deviation.

Parameters:

a : array_like

An array_like object containing the sample data.

axis : int or None, optional

Axis along which to operate. Default is 0. If None, compute over the whole array a.

ddof : int, optional

Degrees of freedom correction for standard deviation. Default is 0.

Returns:

s2n : ndarray

The mean to standard deviation ratio(s) along axis, or 0 where the standard deviation is 0.