[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!'
|
print 'getSNR: Empty array isignal, check signal window!'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# demean over entire snr window
|
||||||
|
x -= x[inoise[0][0]:isignal[0][-1]].mean()
|
||||||
|
|
||||||
# calculate ratios
|
# calculate ratios
|
||||||
noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
|
noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
|
||||||
signallevel = np.sqrt(np.mean(np.square(x[isignal])))
|
signallevel = np.sqrt(np.mean(np.square(x[isignal])))
|
||||||
|
Loading…
Reference in New Issue
Block a user