numbers.dsp

numbers.dsp.fft(x)

Calculates the Discrete Fourier Transform (DFT) of an array, x of real numbers, using a Fast Fourier Transform (FFT) algorithm.

Parameters

x : Array

An array of real numbers.

Returns

arr : Array

An array of complex numbers, the DFT of the elements of x.

Errors

An error is thrown if:

  • the number of elements in x is not a power of 2.

numbers.dsp.segment(arr, start, step)

Creates an array composed of elements from arr, starting at the start-th element of arr, and incrementing by step.

Parameters

arr : Array

An array.

start : Int

The initial index.

step : Int

The increment size.

Returns

segArr : Array

A new array consisting of elements from arr.

Errors

This function does not raise any errors.