import { DateTime } from "luxon"; import { Seismogram } from "./seismogram.mjs"; import { InstrumentSensitivity } from "./stationxml.mjs"; import { Butterworth, ChebyshevI, ChebyshevII, IIRFilter, LOWPASS, BANDPASS, HIGHPASS } from "./oregondsputil.mjs"; /** * Constant for bandpass OregonDSP filter creation. */ export declare const BAND_PASS = "BANDPASS"; /** * Constant for lowpass OregonDSP filter creation. */ export declare const LOW_PASS = "LOWPASS"; /** * Constant for highpass OregonDSP filter creation. */ export declare const HIGH_PASS = "HIGHPASS"; export declare function amplitude(real: number, imag: number): number; /** * Remove the mean from a seismogram. Subtract the mean from each data point. * * @param seis input seismogram * @returns seismogram with mean of zero */ export declare function rMean(seis: Seismogram): Seismogram; export type LineFitType = { 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. * * @param seis [description] * @param referenceTime [description] * @returns best fit line */ export declare function lineFit(seis: Seismogram, referenceTime?: DateTime): LineFitType; /** * Returns a new Seismogram with the trend removed by * subtracting the trend line from each data point. * * @param seis input seismogram * @param fitLine optional fit type * @returns seismogram with mean of zero and best fit line horizontal */ export declare function removeTrend(seis: Seismogram, fitLine?: LineFitType): Seismogram; /** * 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. * * @param seis the seismogram to correct * @param instrumentSensitivity overall gain object, usually pulled from stationxml * @returns new seismogram with original units, like m/s and gain applied. */ export declare function gainCorrect(seis: Seismogram, instrumentSensitivity: InstrumentSensitivity): Seismogram; export declare function mul(seis: Seismogram, factor: number): Seismogram; export declare function add(seis: Seismogram, factor: number): Seismogram; export declare function getPassband(type: string): typeof LOWPASS | typeof BANDPASS | typeof HIGHPASS; /** * Creates a Butterworth IIR filter using the OregonDSP library. * * @param numPoles number of poles * @param passband type, use constants of BAND_PASS, LOW_PASS, HIGH_PASS * @param lowFreqCorner low corner frequency * @param highFreqCorner high corner frequency * @param delta delta, period, of timeseries * @returns Butterworth IIR filter */ export declare function createButterworth(numPoles: number, passband: string, lowFreqCorner: number, highFreqCorner: number, delta: number): InstanceType; /** * Creates a Chebyshev I IIR filter using the OregonDSP library. * * @param numPoles number of poles * @param epsilon Chebyshev epsilon value * @param passband type, use constants of BAND_PASS, LOW_PASS, HIGH_PASS * @param lowFreqCorner low corner frequency * @param highFreqCorner high corner frequency * @param delta delta, period, of timeseries * @returns Chebyshev I IIR filter */ export declare function createChebyshevI(numPoles: number, epsilon: number, passband: string, lowFreqCorner: number, highFreqCorner: number, delta: number): InstanceType; /** * Creates a Chebyshev II IIR filter using the OregonDSP library. * * @param numPoles number of poles * @param epsilon Chebyshev epsilon value * @param passband type, use constants of BAND_PASS, LOW_PASS, HIGH_PASS * @param lowFreqCorner low corner frequency * @param highFreqCorner high corner frequency * @param delta delta, period, of timeseries * @returns Chebyshev II IIR filter */ export declare function createChebyshevII(numPoles: number, epsilon: number, passband: string, lowFreqCorner: number, highFreqCorner: number, delta: number): InstanceType; /** * Applies the filter to the given seismogram. * * @param iirFilter filter to apply * @param seis seismogram to apply filter to * @returns filtered seismogram */ export declare function applyFilter(iirFilter: InstanceType, seis: Seismogram): 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 * * @param seis seismogram to apply envelope to * @returns seismogram cloned but with data as the envelope */ export declare function envelope(seis: Seismogram): Seismogram; /** * 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. * * @param seis seismogram to calculate from * @param n optional number of points in transform, default is 10 * @param lowEdge low edge of filter, normailized to 0-1, default is 0.05 * @param highEdge high edge of filter, normailized to 0-1, default is 0.95 * @returns hilbert transformed data */ export declare function hilbert(seis: Seismogram, n?: number, lowEdge?: number, highEdge?: number): Seismogram; /** * Differentiate a seismogram. * * @param seis input seismogram * @returns differentiated seismogram */ export declare function differentiate(seis: Seismogram): Seismogram; /** * Integrate a seismogram. * * @param seis input seismogram * @param integrationConst integration constant, optional, defaults to 0 * @returns integrated seismogram */ export declare function integrate(seis: Seismogram, integrationConst?: number): Seismogram; //# sourceMappingURL=filter.d.mts.map