Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve metrics/signaltonoise function? #30

Open
gthompson opened this issue Nov 9, 2021 · 0 comments
Open

improve metrics/signaltonoise function? #30

gthompson opened this issue Nov 9, 2021 · 0 comments

Comments

@gthompson
Copy link
Owner

Why not instead just take the ratio of the amplitudes of the "loudest" second and the "quietest" second?
def signaltonoise(tr):

function snr, highval, lowval = signaltonoise(tr)

# Here we just make an estimate of the signal-to-noise ratio
#
# Normally the trace should be pre-processed before passing to this routine, e.g.
# * remove ridiculously large values
# * remove any sequences of 0 from start or end
# * detrend
# * bandpass filter
#
# Processing:
#    1. ensure we have at least 1 seconds
#    2. take absolute values
#    3. compute the maximum of each 1-s of data, call this time series M
#    4. compute 95th and 5th percentile of M, call these M95 and M5
#    5. estimate signal-to-noise ratio as M95/M5
#
# Correction. The above seems like a poor algorithm. Why not instead just take the ratio of the amplitudes of 
# the "loudest" second and the "quietest" second.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant