|
21 | 21 | /* eslint-disable max-lines */ |
22 | 22 |
|
23 | 23 | import cffti = require( '@stdlib/fft/base/fftpack/cffti' ); |
| 24 | +import cosqi = require( '@stdlib/fft/base/fftpack/cosqi' ); |
24 | 25 | import decompose = require( '@stdlib/fft/base/fftpack/decompose' ); |
25 | 26 | import rffti = require( '@stdlib/fft/base/fftpack/rffti' ); |
26 | 27 |
|
@@ -62,6 +63,42 @@ interface Namespace { |
62 | 63 | */ |
63 | 64 | cffti: typeof cffti; |
64 | 65 |
|
| 66 | + /** |
| 67 | + * Initializes a workspace array for performing a quarter-wave cosine transform. |
| 68 | + * |
| 69 | + * ## Notes |
| 70 | + * |
| 71 | + * - The workspace array should have a length of at least `( 3*N ) + 34` elements. |
| 72 | + * |
| 73 | + * @param N - length of the sequence |
| 74 | + * @param workspace - workspace array |
| 75 | + * @param strideW - stride length for `workspace` |
| 76 | + * @param offsetW - starting index for `workspace` |
| 77 | + * @returns workspace array |
| 78 | + * |
| 79 | + * @example |
| 80 | + * var Float64Array = require( '@stdlib/array/float64' ); |
| 81 | + * |
| 82 | + * var N = 8; |
| 83 | + * var workspace = new Float64Array( ( 3*N ) + 34 ); |
| 84 | + * |
| 85 | + * var out = ns.cosqi( N, workspace, 1, 0 ); |
| 86 | + * // returns <Float64Array> |
| 87 | + * |
| 88 | + * var bool = ( out === workspace ); |
| 89 | + * // returns true |
| 90 | + * |
| 91 | + * var cosineTable = workspace.slice( 0, N ); |
| 92 | + * // returns <Float64Array>[ ~0.98, ~0.92, ~0.83, ~0.7, ~0.56, ~0.38, ~0.2, ~0.0 ] |
| 93 | + * |
| 94 | + * var twiddleFactors = workspace.slice( 2*N, 3*N ); |
| 95 | + * // returns <Float64Array>[ 0, ~0.707, ~0.707, 0, 0, 0, 0, 0 ] |
| 96 | + * |
| 97 | + * var factors = workspace.slice( 3*N, ( 3*N ) + 4 ); |
| 98 | + * // returns <Float64Array>[ 8, 2, 2, 4 ] |
| 99 | + */ |
| 100 | + cosqi: typeof cosqi; |
| 101 | + |
65 | 102 | /** |
66 | 103 | * Factorizes a sequence length into a product of integers. |
67 | 104 | * |
|
0 commit comments