# MATH_IFFT

## C Specification

      #include <nitro/math/fft.h>

      void MATH_IFFT( fx32* data, u32 nShift, const fx16* sinTable );

## Arguments

data | Pointer to the data to transform. Data after the transform is overwritten.
nShift | The value obtained by taking the base-2 logarithm of the number of the input complex numbers.
sinTable | Pointer to the table of sine values.

## Return Values

None.

## Description

Uses a fast Fourier transform algorithm to perform the inverse transform of a discrete Fourier transform. Takes a sequence of complex number as input, and outputs a sequence of complex numbers. This is the reverse operation of the MATH_FFT function.

In the explanation below, the value 2nShift (2 to the nShift power) is represented as N. data is a type fx32 array of length 2*N. N number of complex numbers is passed to data in a format that stores real numbers and imaginary numbers alternately. Thus, if i is the unit for imaginary numbers, then the input data is the complex number sequence of N length `{data[0]+i*data[1], data[2]+i*data[3], ..., data[N*2-2]+i*data[N*2-1]}`. sinTable is the pointer to the array of N*3/4 length that has fx16 type sine values assigned that satisfy `sinTable[k] = sin( (2π/N) * k ) (k = 0, 1,..., N*3/4-1)`. This can be created using the `MATH_MakeFFTSinTable` function. The result of the inverse transform of a discrete Fourier transform also becomes a sequence of complex numbers, and overwritten in data as the same format as the input and returned.

The calculations are performed using fixed-decimal numbers, so if a large value is given as the input, there is a risk of overflow. When the input value is viewed as type s32, the absolute value should not be greater than or equal to `0x80000000/N`. Also note that the maximum error when performing both the forward transform and inverse transform is around several times `FX32_ONE`.

## See Also

`MATH_MakeFFTSinTable, MATH_FFT, MATH_FFTReal, MATH_IFFTReal`

## Revision History

07/21/2005 Corrected the explanation for sinTable.
07/11/2005 Corrected the explanation.
05/13/2005 Initial version.

CONFIDENTIAL