Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,105 @@

/* eslint-disable max-lines */

import cffti = require( '@stdlib/fft/base/fftpack/float64/cffti' );
import decompose = require( '@stdlib/fft/base/fftpack/float64/decompose' );
import rffti = require( '@stdlib/fft/base/fftpack/float64/rffti' );

/**
* Interface describing the `float64` namespace.
*/
interface Namespace {
/**
* TODO.
* Initializes a double-precision floating-point workspace array for performing a complex-valued Fourier transform.
*
* ## Notes
*
* - The workspace array should have a length of at least `( 4*N ) + 34` elements.
* - For single-point sequences (N=1), the function returns immediately as the FFT is the identity operation.
*
* @param N - length of the sequence
* @param workspace - workspace array
* @param strideW - stride length for `workspace`
* @param offsetW - starting index for `workspace`
* @returns workspace array
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var N = 8;
* var workspace = new Float64Array( ( 4*N ) + 34 );
*
* var out = ns.cffti( N, workspace, 1, 0 );
* // returns <Float64Array>
*
* var bool = ( out === workspace );
* // returns true
*
* var twiddleFactors = workspace.slice( 2*N, 4*N );
* // returns <Float64Array>[ 1, 0, ~0.707, ~0.707, ~0, 1, ~-0.707, ~0.707, 1, 0, 1, 0, 1, 0, ~0, -1 ]
*
* var factors = workspace.slice( 4*N, ( 4*N ) + 4 );
* // returns <Float64Array>[ 8, 2, 2, 4 ]
*/
cffti: typeof cffti;

/**
* Factorizes a sequence length into a product of integers and stores the results in a double-precision floating-point array.
*
* @param N - length of the sequence
* @param M - number of trial divisors
* @param initial - array of initial trial divisors
* @param si - stride length for `initial`
* @param oi - starting index for `initial`
* @param out - output array for storing factorization results
* @param so - stride length for `out`
* @param oo - starting index for `out`
* @returns number of factors into which `N` was decomposed
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var initial = new Float64Array( [ 3.0, 4.0, 2.0, 5.0 ] );
* var factors = new Float64Array( 4 );
*
* var numFactors = ns.decompose( 12, 4, initial, 1, 0, factors, 1, 0 );
* // returns 2
*/
decompose: typeof decompose;

/**
* Initializes a double-precision floating-point workspace array for performing a real-valued Fourier transform.
*
* ## Notes
*
* - The workspace array should have a length of at least `( 2*N ) + 34` elements.
* - For single-point sequences (N=1), the function returns immediately as the FFT is the identity operation.
*
* @param N - length of the sequence
* @param workspace - workspace array
* @param strideW - stride length for `workspace`
* @param offsetW - starting index for `workspace`
* @returns workspace array
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
*
* var N = 8;
* var workspace = new Float64Array( ( 2*N ) + 34 );
*
* var out = ns.rffti( N, workspace, 1, 0 );
* // returns <Float64Array>
*
* var bool = ( out === workspace );
* // returns true
*
* var twiddleFactors = workspace.slice( N, 2*N );
* // returns <Float64Array>[ ~0.707, ~0.707, 0, 0, 0, 0, 0, 0 ]
*
* var factors = workspace.slice( 2*N, ( 2*N ) + 4 );
* // returns <Float64Array>[ 8, 2, 2, 4 ]
*/
rffti: typeof rffti;
}

/**
Expand Down