[bugfix] determine the SNR according to the demeaned waveform between the beginning of the noise window and the end of the signal window

This commit is contained in:
Sebastian Wehling-Benatelli 2015-06-23 08:24:21 +02:00
parent bb6ebc7ee1
commit dc281c6c0e

View File

@ -322,6 +322,9 @@ def getSNR(X, TSNR, t1):
print 'getSNR: Empty array isignal, check signal window!'
return
# demean over entire snr window
x -= x[inoise[0][0]:isignal[0][-1]].mean()
# calculate ratios
noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
signallevel = np.sqrt(np.mean(np.square(x[isignal])))