fftForward

dist/fft.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().

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

Calculates the discrete fourier transform using the OregonDSP library.

This is a lower level function, fftForward is better for most uses.

calcDFT(timeseries: any): any
Parameters
timeseries (any) timeseries array
Returns
any: DFT as packed array Float32Array

inverseDFT

dist/fft.mjs

Calculates the inverse discrete fourier transform using the oregondsp library.

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

findPowerTwo

dist/fft.mjs

Finds smallest power of two >= input number.

findPowerTwo(fftlength: any): any
Parameters
fftlength (any) input number
Returns
any: tuple of N and log2N, like [16,4]

FFTResult

dist/fft.mjs

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

new FFTResult(origLength: any, sampleRate: any)
Parameters
origLength (any)
sampleRate (any)
Static Members
createFromPackedFreq(packedFreq, origLength, sampleRate)
createFromComplex(complexArray, origLength, sampleRate)
createFromAmpPhase(amp, phase, origLength, sampleRate)
Instance Members
fundamentalFrequency
asComplex()
asAmpPhase()
fftInverse()
frequencies()
numFrequencies
minFrequency
maxFrequency
amplitudes()
phases()
clone()