fftForward

src/fft.js

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

fftForward(seis: Seismogram): any
Parameters
seis (Seismogram) seismogram to transform
Returns
any: fft of seismogram

calcDFT

src/fft.js

Calculates the discrete fourier transform using the OregonDSP library.

calcDFT(timeseries: (Int32Array | Float32Array | Float64Array)): Float32Array
Parameters
timeseries ((Int32Array | Float32Array | Float64Array)) timeseries array
Returns
Float32Array: DFT as packed array Float32Array

inverseDFT

src/fft.js

Calculates the inverse discrete fourier transform using the OregonDSP library.

inverseDFT(packedFreq: Float32Array, numPoints: number): Float32Array
Parameters
packedFreq (Float32Array) DFT as packed array Float32Array
numPoints (number) number of points in original timeseries array.
Returns
Float32Array: inverse of DFT as a timeseries array

FFTResult

src/fft.js

Results of FFT calculateion. Allows convertion of the packed real/imag array output from calcDFT into amplitude and phase.

new FFTResult(origLength: number, sampleRate: number)
Parameters
origLength (number)
sampleRate (number)
Static Members
createFromPackedFreq(packedFreq, origLength, sampleRate)
createFromComplex(complexArray, origLength, sampleRate)
createFromAmpPhase(amp, phase, origLength, sampleRate)
Instance Members
origLength
packedFreq
complex
phase
numPoints
sampleRate
fundamentalFrequency
recalcFromPackedFreq()
recalcFromComplex()
recalcFromAmpPhase()
fftInverse()
clone()