BAND_PASS

src/filter.ts

Constant for bandpass OregonDSP filter creation.

BAND_PASS

Type: string

Constant for lowpass OregonDSP filter creation.

LOW_PASS

Type: string

HIGH_PASS

src/filter.ts

Constant for highpass OregonDSP filter creation.

HIGH_PASS

Type: string

amplitude

src/filter.ts
amplitude(real: number, imag: number): number
Parameters
real (number)
imag (number)
Returns
number

Remove the mean from a seismogram. Subtract the mean from each data point.

rMean(seis: Seismogram): Seismogram
Parameters
seis (Seismogram) input seismogram
Returns
Seismogram: seismogram with mean of zero

LineFitType

src/filter.ts
LineFitType

Type: {slope: number, intercept: number, reference_time: DateTime, sigma: number, sigma_a: number, sigma_b: number, correlation: number}

Properties
slope (number)
intercept (number)
reference_time (DateTime)
sigma (number)
sigma_a (number)
sigma_b (number)
correlation (number)

Calculate best fit line to seismogram. Limited to contiguous data currently. Code derived from scm/lifite.c in SAC. Original version from Steve Taylor.

lineFit(seis: Seismogram, referenceTime: DateTime?): LineFitType
Parameters
seis (Seismogram) [description]
referenceTime (DateTime?) [description]
Returns
LineFitType: best fit line

removeTrend

src/filter.ts

Returns a new Seismogram with the trend removed by subtracting the trend line from each data point.

removeTrend(seis: Seismogram, fitLine: LineFitType?): Seismogram
Parameters
seis (Seismogram) input seismogram
fitLine (LineFitType?) optional fit type
Returns
Seismogram: seismogram with mean of zero and best fit line horizontal

gainCorrect

src/filter.ts

Apply the frequency independent overall gain to a seismogram. This does not do a full transfer using poles and zero, this only applies the scalar conversion factor to convert counts back to original real world units and update the units.

gainCorrect(seis: Seismogram, instrumentSensitivity: InstrumentSensitivity): Seismogram
Parameters
seis (Seismogram) the seismogram to correct
instrumentSensitivity (InstrumentSensitivity) overall gain object, usually pulled from stationxml
Returns
Seismogram: new seismogram with original units, like m/s and gain applied.
mul(seis: Seismogram, factor: number): Seismogram
Parameters
seis (Seismogram)
factor (number)
Returns
Seismogram
add(seis: Seismogram, factor: number): Seismogram
Parameters
seis (Seismogram)
factor (number)
Returns
Seismogram

getPassband

src/filter.ts
getPassband(type: string): (any | any | any)
Parameters
type (string)
Returns
(any | any | any)

createButterworth

src/filter.ts

Creates a Butterworth IIR filter using the OregonDSP library.

createButterworth(numPoles: number, passband: string, lowFreqCorner: number, highFreqCorner: number, delta: number): InstanceType<any>
Parameters
numPoles (number) number of poles
passband (string) type, use constants of BAND_PASS, LOW_PASS, HIGH_PASS
lowFreqCorner (number) low corner frequency
highFreqCorner (number) high corner frequency
delta (number) delta, period, of timeseries
Returns
InstanceType<any>: Butterworth IIR filter

createChebyshevI

src/filter.ts

Creates a Chebyshev I IIR filter using the OregonDSP library.

createChebyshevI(numPoles: number, epsilon: number, passband: string, lowFreqCorner: number, highFreqCorner: number, delta: number): InstanceType<any>
Parameters
numPoles (number) number of poles
epsilon (number) Chebyshev epsilon value
passband (string) type, use constants of BAND_PASS, LOW_PASS, HIGH_PASS
lowFreqCorner (number) low corner frequency
highFreqCorner (number) high corner frequency
delta (number) delta, period, of timeseries
Returns
InstanceType<any>: Chebyshev I IIR filter

createChebyshevII

src/filter.ts

Creates a Chebyshev II IIR filter using the OregonDSP library.

createChebyshevII(numPoles: number, epsilon: number, passband: string, lowFreqCorner: number, highFreqCorner: number, delta: number): InstanceType<any>
Parameters
numPoles (number) number of poles
epsilon (number) Chebyshev epsilon value
passband (string) type, use constants of BAND_PASS, LOW_PASS, HIGH_PASS
lowFreqCorner (number) low corner frequency
highFreqCorner (number) high corner frequency
delta (number) delta, period, of timeseries
Returns
InstanceType<any>: Chebyshev II IIR filter

applyFilter

src/filter.ts

Applies the filter to the given seismogram.

applyFilter(iirFilter: InstanceType<any>, seis: Seismogram): Seismogram
Parameters
iirFilter (InstanceType<any>) filter to apply
seis (Seismogram) seismogram to apply filter to
Returns
Seismogram: filtered seismogram

Calculates the envelope, y_i = sqrt( y_i * y_i + h_i * h_i) where h is the hilber transform of y. The default configuration for the hilbet transform is n=100, lowEdge=.05 and highEdge = 0.95

envelope(seis: Seismogram): Seismogram
Parameters
seis (Seismogram) seismogram to apply envelope to
Returns
Seismogram: seismogram cloned but with data as the envelope

Calculates the hilbert transform using the OregonDSP library with default number of points, n=10 (to yield a 21 pt FIR transform) and default low and high edge of 0.05 and 0.95. Low and high edge are given normalized 0 to 1.

Note this uses Float32Array, other array types will be converted, possibly losing precision.

hilbert(seis: Seismogram, n: number?, lowEdge: number?, highEdge: number?): Seismogram
Parameters
seis (Seismogram) seismogram to calculate from
n (number?) optional number of points in transform, default is 10
lowEdge (number?) low edge of filter, normailized to 0-1, default is 0.05
highEdge (number?) high edge of filter, normailized to 0-1, default is 0.95
Returns
Seismogram: hilbert transformed data

differentiate

src/filter.ts

Differentiate a seismogram.

differentiate(seis: Seismogram): Seismogram
Parameters
seis (Seismogram) input seismogram
Returns
Seismogram: differentiated seismogram

integrate

src/filter.ts

Integrate a seismogram.

integrate(seis: Seismogram, integrationConst: any): Seismogram
Parameters
seis (Seismogram) input seismogram
integrationConst (any = 0) integration constant, optional, defaults to 0
Returns
Seismogram: integrated seismogram