PIA-Group/BioSPPy

The function biosppy.signals.tools.signal_stats() is not reliable.

MarcoCode23 opened this issue · 1 comments

I noticed the function signal_stats() in biosppy.signals.tools computes wrong max values.
When I call stats = tools.signal_stats( data[ dataName ] ), stats["max"] is different from max(data[dataName]).
The array data[] contains doubles.
Just to let you know.

Hi @marcofilippi

The documentation in the signal_stats method is a bit misleading.
The max output is the maximum absolute signal amplitude in relation to the mean:

# maximum amplitude
maxAmp = np.abs(signal - mean).max()

I think it makes sense to also add the actual maximum and minimum to this method, and review the wording in the documentation. I'll get around to that soon.