Learn R Programming

TDD (version 0.4)

PZ2Resp: Calculate Instrument Response from Poles/Zeros

Description

Returns complex instrument response for a vector of frequencies and set of analog poles and zeros. Optionally plots the magnitude of the instrument response.

Usage

PZ2Resp(PZ, f, PLOT = TRUE)

Arguments

PZ
Analog poles and zeros
f
Vector of frequencies for which response is calculated
PLOT
Logical: whether to plot magnitude of response

Value

frequencies in f.

Details

The response is calculated by the following equation: R(s) = PZ$Sense * PZ$Knorm * prod(s - PZ$zeros)/prod(s - PZ$poles)

where s = 2 * pi * 1i * f. PZ requires the following elements: poles: Vector of poles np: number of poles zeros: Vector of zeros nz: Number of zeros Knorm: Normalization constant Sense: Instrument sensitivity (V/(m/s))

Examples

Run this code
# Response of Guralp CMG-40T

PZ = GetPZ(12)[[1]]

f = (1:10000 - 1)/1000

PZ2Resp(PZ, f)

Run the code above in your browser using DataLab