LibCapy - fft

Class and structure implementing DFT and FFT.

Macros:

Enumerations:

None.

Typedefs:

None.

Struct CapyDFTCoeffs :

Struct CapyDFTCoeffs's properties:

Inherits CapyMathFun

Number of coefficients

Original input range of the transformed function (default: [0,1])

Values of the Fourier series coefficients, these are the amplitudes of the cosine (real part) and sine (imaginary part) for each "frequency bin". The k-th frequency bin corresponds to the sine and cosine of frequency k. The original function is then approximated by f(t)=a_0/2+sum_{k=0..(N-1)}(a_k*cos(2pi*kt)+b_k*sin(2pi*kt))

Struct CapyDFTCoeffs's methods:

Destructor

Get the vector of amplitude (magnitude of the complex number) per frequency bin (aka spectrum plot).

Output and side effect(s):

Return the amplitude per frequency bins as a vector. It is symetric relative to that->nb/2. One can get the single sided Fourier coeficients by taking only the first half values multiplied by two.

Struct CapyDFT :

Struct CapyDFT's properties:

None.

Struct CapyDFT's methods:

Destructor

Transform a 1D polynomial from coefficients representation to values representation. The polynomial must have a power-of-2 number of coefficients.

Input argument(s):

poly: the polynomial

Output and side effect(s):

Return the value representation of the polynomial as a CapyDFTCoeffs

Transform a 1D polynomial from values representation to coefficients representation. The number of values must be a power-of-2.

Input argument(s):

values: the values representation of the polynomial

Output and side effect(s):

Return the polynomial corresponding to the value representation

Calculate the Discrete Fourier Transform for an input range of a given function

Input argument(s):

fun: the function (must have one input and one output)

range: range of the input of the function for which the DFT is calculated

nbSample: the number of samples taken from the function, equally spaced in 'range' (bounds included)

Output and side effect(s):

Return the DFT coefficients as a CapyDFTCoeffs

Calculate the Discrete Fourier Transform for a given set of samples

Input argument(s):

samples: the samples value Output; Return the DFT coefficients as a CapyDFTCoeffs

Functions:

Create a CapyDFTCoeffs

Input argument(s):

nb: the number of coefficients

Output and side effect(s):

Return a CapyDFTCoeffs

Allocate memory for a new CapyDFTCoeffs and create it

Input argument(s):

nb: the number of coefficients

Output and side effect(s):

Return a CapyDFTCoeffs

Free the memory used by a CapyDFTCoeffs* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyDFTCoeffs to free

Create a CapyDFT

Output and side effect(s):

Return a CapyDFT

Allocate memory for a new CapyDFT and create it

Output and side effect(s):

Return a CapyDFT

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyDFT* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyDFT to free