Last updated

API / geotoolkit / seismic / analysis / transforms / SimpleFFT / SimpleFFT

Class: SimpleFFT

transforms.SimpleFFT.SimpleFFT

Defines a class capable of computing the forward and backward Discrete Fourier Transform Ported from the Saddleback Geosolution's Java implementation of the DFT This implementation uses only radix-2 butterflies.

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new SimpleFFT(real, imag, sampleRate, length)

new SimpleFFT(real?, imag?, sampleRate?, length?)

Parameters

Name Type Description
Optional realFloat32ArrayThe real component of the signal
Optional imagFloat32ArrayThe imaginary component of th signal
Optional sampleRatenumberThe data sampling rate in milliseconds
Optional lengthnumberThe desired length of the transform, must be a power of 2

Inherited from

AbstractFFTSpectra.constructor

Methods

getClassName

getClassName(): string

Returns

string

Inherited from

AbstractFFTSpectra.getClassName


getFDSampleRate

getFDSampleRate(): number

Returns the Frequency Domain sample rate. This is the frequency domain sample spacing.

Returns

number

FrequencySampleRate Frequency Domain sampling rate in milliseconds (ms)

Inherited from

AbstractFFTSpectra.getFDSampleRate


getFFTAmplitude

getFFTAmplitude(): Float32Array

Computes the Amplitude spectrum of the input signal.*

Returns

Float32Array

amplitudes - array containing the amplitude spectrum

Inherited from

AbstractFFTSpectra.getFFTAmplitude


getFFTAmplitudeSmooth

getFFTAmplitudeSmooth(hzLength): Float32Array

Computes the Amplitude spectrum of the input signal and smoothes the output to hzLength (in frequency).

Parameters

Name Type Description
hzLengthnumberint operator length in hz/samples

Returns

Float32Array

amplitudes - array containing the amplitude spectrum

Inherited from

AbstractFFTSpectra.getFFTAmplitudeSmooth


getFFTPhaseDegrees

getFFTPhaseDegrees(): Float32Array

Computes the phase spectrum of the input signal in degrees.

Returns

Float32Array

phases - array containing the phase spectrum of the input signal in degrees.

Inherited from

AbstractFFTSpectra.getFFTPhaseDegrees


getFFTPhaseInDegreesUnWrapped

getFFTPhaseInDegreesUnWrapped(): Float32Array

Computes the phase spectrum in unwrapped degrees in the range(0->360).

Returns

Float32Array

phases - array containing the unwrapped phase spectrum in degrees

Inherited from

AbstractFFTSpectra.getFFTPhaseInDegreesUnWrapped


getFFTPhaseInRadiansUnWrapped

getFFTPhaseInRadiansUnWrapped(): Float32Array

Computes the phase spectrum in unwrapped radians in the range(-pi to +pi).

Returns

Float32Array

phases - array containing the unwrapped phase spectrum in radians

Inherited from

AbstractFFTSpectra.getFFTPhaseInRadiansUnWrapped


getFFTPhaseRadians

getFFTPhaseRadians(): Float32Array

Computes the phase spectrum in radians of the input signal.

This is the phase spectrum of the input signal in range of 0 to 2*pi.

Returns

Float32Array

phases - array containing the phase spectrum in radians

Inherited from

AbstractFFTSpectra.getFFTPhaseRadians


getFFTPower

getFFTPower(): Float32Array

Computes the power spectrum (amplitude squared) of the FFT.

Returns

Float32Array

powers - array containing the power spectrum

Inherited from

AbstractFFTSpectra.getFFTPower


getFFTPowerInDb

getFFTPowerInDb(): Float32Array

Computes the power spectrum (amplitude squared) of the FFT. This is the the power spectrum in dB-down, based on the maximum power value associated with (0(Zero) db down).

Returns

Float32Array

powersDb - array container the power spectrum in dB

Inherited from

AbstractFFTSpectra.getFFTPowerInDb


getFFTPowerInDbNormalized

getFFTPowerInDbNormalized(pReference): Float32Array

Computes the normalized power spectrum (amplitude squared) of the FFT.

This is the the power spectrum in dB-down, based on the reference power value supplied in the parameter nFactor.

Parameters

Name Type Description
pReferencenumberfloat reference value

Returns

Float32Array

powersDbNorm - array containing the power spectrum in dB

Inherited from

AbstractFFTSpectra.getFFTPowerInDbNormalized


getFFTPowerInDbSmoothed

getFFTPowerInDbSmoothed(hzLength): Float32Array

Computes the smoothed & normalized dB power spectrum (amplitude squared) of the FFT. This is the the power spectrum in dB-down, based on the maximum power value associated with (0(Zero) db down).

Parameters

Name Type Description
hzLengthnumberint operator length in hz/samples

Returns

Float32Array

powersDbSmoothed - array containing the power specturm in db and smoothed.

Inherited from

AbstractFFTSpectra.getFFTPowerInDbSmoothed


getFFTPowerSmoothed

getFFTPowerSmoothed(hzLength): Float32Array

Computes the smoothed power spectrum (amplitude squared) of the FFT.

Parameters

Name Type Description
hzLengthnumberint operator length in hz/samples

Returns

Float32Array

powerSmoothed - array containing the smoothed power spectrum

Inherited from

AbstractFFTSpectra.getFFTPowerSmoothed


getHalfLength

getHalfLength(): number

Returns half of the length of the calculated FFT (power-of-2)

Returns

number

halfLength The half-length of the FFT

Inherited from

AbstractFFTSpectra.getHalfLength


getImaginaryComponents

getImaginaryComponents(getReference): Float32Array

Gets the imaginary signal component

Parameters

Name Type Description
getReferencebooleanIf true then the reference to signal will be returned.

Returns

Float32Array

realComponent The real signal component

Inherited from

AbstractFFTSpectra.getImaginaryComponents


getLength

getLength(): number

Returns the length of the calculated FFT (power-of-2).

Returns

number

length The length of calculated FFT

Inherited from

AbstractFFTSpectra.getLength


getLog2Length

getLog2Length(): number

Returns the base 2 logarithm of the transform length

Returns

number

logLength Log base 2 of the transform length

Inherited from

AbstractFFTSpectra.getLog2Length


getNumberNonZeroSamples

getNumberNonZeroSamples(): number

Returns the number of non zero samples that were input inot the last FFT. This is the number of live samples (less than or equal to a power-of-2);

Returns

number

nonZero The Number of non-zero samples for input signal

Inherited from

AbstractFFTSpectra.getNumberNonZeroSamples


getNyquist

getNyquist(): number

Returns the nyquist frequency for the input signal. This is the calculated nyquist frequency based on the supplied sample rate. This is also known as the folding frequency

Returns

number

nyquist The nyquist frequency

Inherited from

AbstractFFTSpectra.getNyquist


getNyquistLength

getNyquistLength(): number

Returns the sample number of frequency that equals nyquist frequency.

Returns

number

frequency The Nyquist frequency

Inherited from

AbstractFFTSpectra.getNyquistLength


getRealComponents

getRealComponents(getReference): Float32Array

Gets the real signal component

Parameters

Name Type Description
getReferencebooleanIf true then the reference to signal will be returned.

Returns

Float32Array

realComponent The real signal component

Inherited from

AbstractFFTSpectra.getRealComponents


getSampleRate

getSampleRate(): number

Returns the input sample rate of the signal in Milliseconds. This is the sample rate set before calculation.

Returns

number

sampleRate Sample rate of input signal in milliseconds (ms)

Inherited from

AbstractFFTSpectra.getSampleRate


inverseTransform

inverseTransform(): void

Performs the inverse transform

Returns

void

Inherited from

AbstractFFTSpectra.inverseTransform


setData

setData(real?, imag?, sampleRate?, length?): SimpleFFT

Sets the real and imaginary result array

Parameters

Name Type Description
Optional realnumber[] | Float32ArrayThe real component of the signal
Optional imagnumber[] | Float32ArrayThe imaginary component of the signal
Optional sampleRatestring | numberThe data sampling rate in milliseconds
Optional lengthstring | numberThe desired length of the transform, must be a power of 2

Returns

SimpleFFT

Inherited from

AbstractFFTSpectra.setData


setDataUnsafe

setDataUnsafe(real, imag): SimpleFFT

Sets the real and imaginary arrays directly

Parameters

Name Type Description
realFloat32ArrayThe imaginary component of the signal
imagFloat32ArrayThe real component of the signal

Returns

SimpleFFT

Inherited from

AbstractFFTSpectra.setDataUnsafe


setSampleRate

setSampleRate(sampleRate): SimpleFFT

Sets the input sample rate of the signal in Milliseconds.

Parameters

Name Type Description
sampleRatenumberSample rate of input signal in milliseconds (ms)

Returns

SimpleFFT

this

Inherited from

AbstractFFTSpectra.setSampleRate


transform

transform(): void

Performs the transform

Returns

void

Inherited from

AbstractFFTSpectra.transform


getClassName

Static getClassName(): string

Returns

string

Inherited from

AbstractFFTSpectra.getClassName