Skip to content

improve metrics/signaltonoise function? #30

@gthompson

Description

@gthompson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions