[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:
parent
bb6ebc7ee1
commit
dc281c6c0e
@ -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])))
|
||||
|
Loading…
Reference in New Issue
Block a user