import { Seismogram, SeismogramDisplayData } from "./seismogram.mjs"; import { Complex } from "./oregondsputil.mjs"; /** * A higher level function to calculate DFT. Returns a * FFTResult for easier access to the result as * complex, amp, phase arrays. Calls calcDFT internally. * Inverse FFT is available as FFTResult.fftInverse(). * * @param seis seismogram or SeismogramDisplayData to transform * @returns fft of seismogram */ export declare function fftForward(seis: Seismogram | SeismogramDisplayData): FFTResult; /** * Calculates the discrete fourier transform using the OregonDSP library. * * This is a lower level function, fftForward is better for most uses. * * @param timeseries timeseries array * @returns DFT as packed array Float32Array */ export declare function calcDFT(timeseries: Int32Array | Float32Array | Float64Array): Float32Array; /** * Calculates the inverse discrete fourier transform using the oregondsp library. * * @param packedFreq DFT as packed array Float32Array * @param numPoints number of points in original timeseries array. * @returns inverse of DFT as a timeseries array */ export declare function inverseDFT(packedFreq: Float32Array, numPoints: number): Float32Array; /** * Finds smallest power of two >= input number. * * @param fftlength input number * @returns tuple of N and log2N, like [16,4] */ export declare function findPowerTwo(fftlength: number): [number, number]; /** * Results of FFT calculation. Allows convertion of the packed real/imag array output from calcDFT into * amplitude and phase. */ export declare class FFTResult { /** number of points in the original timeseries, may be less than fft size. */ origLength: number; packedFreq: Float32Array; /** number of points in the fft, usually power of 2 larger than origLength. */ numPoints: number; /** sample rate of the original time series, maybe be null. */ sampleRate: number; /** optional units of the original data for display purposes. */ inputUnits: string | undefined; /** * optional reference to SeismogramDisplayData when calculated from a seismogram. * Useful for creating title, etc. */ seismogramDisplayData: SeismogramDisplayData | undefined; constructor(origLength: number, sampleRate: number); /** * Factory method to create FFTResult from packed array. * * @param packedFreq real and imag values in packed format * @param origLength length of the original timeseries before padding. * @param sampleRate sample rate of original data * @returns FFTResult */ static createFromPackedFreq(packedFreq: Float32Array, origLength: number, sampleRate: number): FFTResult; /** * Factory method to create from array of complex numbers. * * @param complexArray real and imag values as array of Complex objects. * @param origLength length of the original timeseries before padding. * @param sampleRate sample rate of original data * @returns FFTResult */ static createFromComplex(complexArray: Array>, origLength: number, sampleRate: number): FFTResult; /** * Factory method to create from amp and phase arrays * * @param amp amplitude values * @param phase phase values * @param origLength length of the original timeseries before padding. * @param sampleRate sample rate of original data * @returns FFTResult */ static createFromAmpPhase(amp: Float32Array, phase: Float32Array, origLength: number, sampleRate: number): FFTResult; /** * The minimum non-zero frequency in the fft * * @returns fundamental frequency */ get fundamentalFrequency(): number; asComplex(): Array>; asAmpPhase(): [Float32Array, Float32Array]; /** * calculates the inverse fft of this.packedFreq * * @returns time domain representation */ fftInverse(): Float32Array; frequencies(): Float32Array; get numFrequencies(): number; get minFrequency(): number; get maxFrequency(): number; amplitudes(): Float32Array; phases(): Float32Array; clone(): FFTResult; } //# sourceMappingURL=fft.d.mts.map