PIA-Group / BioSPPy

Biosignal Processing in Python
Other
569 stars 273 forks source link

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

Closed MarcoCode23 closed 5 years ago

MarcoCode23 commented 5 years ago

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.

capcarr commented 5 years ago

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.