Learn R Programming

eseis (version 0.6.0)

signal_hvratio: Calculate h-v-ratio of seismic components

Description

This function uses three components of a seismic signal, evaluates their spectra and builds the ratio of horizontal to vertical power. For details see http://www.geopsy.org/documentation/geopsy/hv.html.

Usage

signal_hvratio(
  data,
  dt,
  log = FALSE,
  method = "periodogram",
  kernel,
  order = "xyz"
)

Value

A data frame with the h-v-frequency ratio.

Arguments

data

List, data frame or matrix, seismic componenents to be processed. If data is a matrix, the components must be organised as columns. Also, data can be a list of eseis objects.

dt

Numeric value, sampling period.

log

Logical value, unit of spectral power. If set to TRUE power will be used in dB, if set to FALSE, power is used in amplitude squared. Default is FALSE.

method

Character value, method for calculating the spectra. One out of "periodogram" , "autoregressive" and "multitaper", default is "periodogram".

kernel

Numeric value, window size (number of samples) of the moving window used for smoothing the spectra. By default no smoothing is performed.

order

Character value, order of the seismic components. Describtion must contain the letters "x","y" and "z" in the order according to the input data set. Default is "xyz" (EW-SN-vertical).

Author

Michael Dietze

Details

The spectra should be smoothed. This can either be done directly during their calculation or before the calculation of the ratio. For the former case set method = "autoregressive". For the latter case provide a value for "kernel", which is the smoothing window size. Smoothing is performed with the logarithms of the spectral power data, using caTools::runmean() with the endrule = "NA". After smoothing the data is re-linearised.

Examples

Run this code
## load example data set
data(earthquake)

## ATTENTION, THIS EXAMPLE DATA SET IS FAR FROM IDEAL FOR THIS PURPOSE

## detrend data
s <- signal_detrend(data = s)

## calculate h-v-ratio, will be very rugged
hv <- signal_hvratio(data = s, 
                     dt = 1 / 200)
plot(hv$ratio, 
     type = "l")

## calculate h-v-ratio using the autogressive spectrum method
hv <- signal_hvratio(data = s, 
                     dt = 1 / 200, 
                     method = "autoregressive")
plot(hv, type = "l")

## calculate h-v-ratio with a smoothing window equivalent to dt
hv <- signal_hvratio(data = s, 
                     dt = 1 / 200,
                     kernel = 200)
plot(hv, type = "l")

Run the code above in your browser using DataLab