MakeDPZ: Calculate Find Digital Match to Analog Poles/Zeros

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/MakeDPZ.R

Description

Calculates digital poles and zeros to match a continuous instrument response given in poles, zeros, and sensitivity. Discretization effects mean that the analog poles and zeros do not work for finite sample rates, with discrepancies increasing as the time interval increases.

This function uses two methods to match the responses. The first uses a finite difference approximation and Markov Chain Monte Carlo (MCMC) routine to optimize the response. The second uses the bilinear transform to approximate the analog response. Whichever of these responses best matches the analog response is used; usually, the first method provides a better fit.

Usage

1
MakeDPZ(PZ, dt, fmin = 1/360, niter = 50000, ...)

Arguments

PZ

List including poles and zeros of instrument response

dt

Sample interval (s)

fmin

Lowest frequency to match (Hz)

niter

Number of iterations in Markov Chain Monte Carlo

...

Additional arguments for MatchCoefDPZ

Details

Large N allow it to match very low frequencies, but take longer to calculate. Large niter means longer calculation time, but probably a closer match. The burn-in period should be set to zero unless you want the posterior distribution of the poles and zeros. Large sigfac means that the MCMC makes smaller jumps, meaning it explores the sample space more slowly, but is less likely to make large jumps away from the interesting region. Note that the standard deviations of proposal distributions of the model parameters are proportional to the magnitude of the "guess" model–meaning that model parameters identically equal to zero (such as zeros at the origin) are fixed.

Discretization effects often make it difficult to match higher frequencies. Close match of somewhat high frequencies is done at the expense of poor match of very high frequencies. If very high frequencies are not interesting, fh should be left at its default value. Otherwise, it should be set to the highest interesting frequency.

Value

List including the following elements:

poles

Vector of "analog poles" (rad/s)

zeros

Vector of "analog zeros" (rad/s)

np

Number of poles

nz

Number of zeros

Knorm

Normalization constant

Sense

Sensitivity (V * s/m)

dt

Sample interval (s)

fmax

Maximum frequency for which this digital response matches the true analog response of the sensor within 1%

Zpg

Zpg-class element (from package 'signal') giving the digital response of the filter in terms of its zeros and poles (in Z-transform space) and gain.

Note

This is a wrapper function for MatchCoefDPZ, and should be used for most applications.

Author(s)

Jake Anderson

See Also

MatchCoefDPZ

Examples

1
2
3
4
5
# Response of Guralp CMG-40T

PZ = list(poles = c(-0.149 + 0.149i, -0.149 - 0.149i, -503, -1010,
-1130), zeros = c(0, 0), Knorm = 574095649, Sense = 800)
# MakeDPZ(PZ, dt = 0.01, fmin = 1/60) # takes minutes to run

TDD documentation built on May 2, 2019, 4:51 a.m.

Related to MakeDPZ in TDD...