Learn R Programming

IRISMustangMetrics (version 2.4.7)

SNRMetric: Signal to Noise Ratio

Description

The SNRMetric() function calculates the Signal-to-Noise Ratio of a seismic trace by one of several named algorithms.

Usage

SNRMetric(st, algorithm, windowSecs)

Value

A list with a single SingleValueMetric object is returned.

Arguments

st

a Stream object containing a seismic signal

algorithm

a named algorithm to use for calculating SNR (default="splitWindow")

windowSecs

width (seconds) of the full window used in SNR calculations (default=60)

Author

Jonathan Callahan jonathan@mazamascience.com

Details

Seismic signals in the Stream must be without gaps, i.e. contained within a single Trace.

algorithm="splitWindow"

This algorithm uses the midpoint of the seismic signal as the border between noise to the left of the midpoint and signal to the right. The value for signal-to-noise is just the rmsVariance calculated for windowSecs/2 seconds of data to the right of the midpoint divided by the rmsVariance for windowSecs/2 seconds of data to the left of the midpoint.

No other algorithms have been vetted at this point.

Examples

Run this code
 if (FALSE) {
# Open a connection to EarthScope webservices
iris <- new("IrisClient")

# Get an hour long waveform centered on a big quake
starttime <- as.POSIXct("2010-02-27 06:16:15",tz="GMT")
endtime <- as.POSIXct("2010-02-27 07:16:15",tz="GMT")
st <- getDataselect(iris,"IU","ANMO","00","BHZ",starttime,endtime)
tr <- st@traces[[1]]

# Calculate the SNR metric and show the results
metricList <- SNRMetric(st)
dummy <- lapply(metricList, show)
  }

Run the code above in your browser using DataLab