Last updated

API / geotoolkit / seismic / analysis / transforms / AbstractFFTSpectra / AbstractFFTSpectra

Class: AbstractFFTSpectra

transforms.AbstractFFTSpectra.AbstractFFTSpectra

Defines a class with basic functions to analyze FFT spectra

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new AbstractFFTSpectra(real, imag, sampleRate, length)

new AbstractFFTSpectra(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

AbstractFFT.constructor

Methods

getClassName

getClassName(): string

Returns

string

Inherited from

AbstractFFT.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

AbstractFFT.getFDSampleRate


getFFTAmplitude

getFFTAmplitude(): Float32Array

Computes the Amplitude spectrum of the input signal.*

Returns

Float32Array

amplitudes - array containing the amplitude spectrum


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


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.


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


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


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


getFFTPower

getFFTPower(): Float32Array

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

Returns

Float32Array

powers - array containing the power spectrum


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


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


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.


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


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

AbstractFFT.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

AbstractFFT.getImaginaryComponents


getLength

getLength(): number

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

Returns

number

length The length of calculated FFT

Inherited from

AbstractFFT.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

AbstractFFT.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

AbstractFFT.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

AbstractFFT.getNyquist


getNyquistLength

getNyquistLength(): number

Returns the sample number of frequency that equals nyquist frequency.

Returns

number

frequency The Nyquist frequency

Inherited from

AbstractFFT.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

AbstractFFT.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

AbstractFFT.getSampleRate


inverseTransform

inverseTransform(): void

Performs the inverse transform

Returns

void

Inherited from

AbstractFFT.inverseTransform


setData

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

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

AbstractFFTSpectra

Inherited from

AbstractFFT.setData


setDataUnsafe

setDataUnsafe(real, imag): AbstractFFTSpectra

Sets the real and imaginary arrays directly

Parameters

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

Returns

AbstractFFTSpectra

Inherited from

AbstractFFT.setDataUnsafe


setSampleRate

setSampleRate(sampleRate): AbstractFFTSpectra

Sets the input sample rate of the signal in Milliseconds.

Parameters

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

Returns

AbstractFFTSpectra

this

Inherited from

AbstractFFT.setSampleRate


transform

transform(): void

Performs the transform

Returns

void

Inherited from

AbstractFFT.transform


getClassName

Static getClassName(): string

Returns

string

Inherited from

AbstractFFT.getClassName