Learn R Programming

TDD (version 0.4)

PZ2Coef: Calculate Recursive Filter Coefficients

Description

Returns coefficients of recursive filter approximating instrument response, given poles/zeros and sample interval.

Usage

PZ2Coef(PZ, dt)

Arguments

PZ
Poles/zeros list
dt
Sample interval

Value

b
Coefficients of filter input terms
a
Coefficients of filter output terms

Details

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))

Output recursive filter is of the form a[1] * y_i + a[2] * y_(i-1) + a[3] * y_(i-2) + ... = b[1] * x_i + b[2] * x_(i-1) + b[3] * x_(i-2) + ..., where x is ground motion velocity and y is the recorded voltage.

Examples

Run this code
PZ_40T = list(poles = c(-0.149 + 0.149i, -0.149 - 0.149i, -503, -1010,
-1130), zeros = c(0, 0), Knorm = 574095649, Sense = 800)

dt = 0.01
PZ2Coef(PZ_40T, dt)

Run the code above in your browser using DataLab