Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DSPLIB - Transforms

All the transforms functions currently supported by the DSP library.

Complex Fast Fourier Transform

This function computes a complex FFT from an input signal. It uses the Radix-4 "Decimate In Time" algorithm and does not perform a calculation "in place" which means that the input buffer has to be different from the output buffer.
Here is the formula of the FFT:

transforms_fft_equation.gif

Relative functions:


Complex inverse Fast Fourier Transform

This function computes a complex inverse FFT from an input signal. It uses the Radix-4 "Decimate In Time" algorithm and does not perform a calculation "in place" which means that the input buffer has to be different from the output buffer.
Here is the formula of the iFFT:

transforms_ifft_equation.gif

Relative functions:


Real to complex Fast Fourier Transform

This function computes a complex FFT from a real input signal. It uses the Radix-4 "Decimate In Time" algorithm and does not perform a calculation "in place" which means that the input buffer has to be different from the output buffer.
Here is the formula of the FFT:

transforms_fft_equation.gif

Relative functions:


Functions

void dsp16_trans_complexfft (dsp16_complex_t *vect1, dsp16_complex_t *vect2, int nlog)
 16-bit fixed point version of the complex FFT algorithm. More...
 
void dsp16_trans_complexifft (dsp16_complex_t *vect1, dsp16_complex_t *vect2, int nlog)
 16-bit fixed point version of the complex iFFT algorithm. More...
 
void dsp16_trans_realcomplexfft (dsp16_complex_t *vect1, dsp16_t *vect2, int nlog)
 16-bit fixed point version of the real to complex FFT algorithm. More...
 
void dsp32_trans_realcomplexfft (dsp32_complex_t *vect1, dsp32_t *vect2, int nlog)
 32-bit fixed point version of the real to complex FFT algorithm. More...
 

void dsp16_trans_complexfft ( dsp16_complex_t vect1,
dsp16_complex_t vect2,
int  nlog 
)

16-bit fixed point version of the complex FFT algorithm.

Parameters
vect1A pointer on a 16-bit complex vector which is the output buffer of this function.
vect2A pointer on a 16-bit complex vector which is the input buffer of this function.
nlogIt is the base-2-logarithm of the size of the input/output vector.
Due to its implementation, this function computes only 4^n-point complex FFT. Therefore, the nlog argument has to be even.
Note
The following requirements have to be matched:
  • The size of the output buffer has to be the same as the size of the input buffer.
  • This function uses a static twiddle factors table which determines the maximal FFT size which can be performed. By default it is 1024. Please check the value of DSP16_N_TWIDDLE_FACTORS.
  • vect1 and vect2 MUST be 4-byte aligned. Please use A_ALIGNED to do so.
  • To avoid overflowing values, the resulting vector amplitude is scaled by 2^nlog.

16-bit fixed point version of the complex FFT algorithm.

References ASM_INSTRUCT_COMPACKED, ASTRINGZ, DSP16_N_TWIDDLE_FACTORS, dsp16_twiddle_factors, dsp16_twiddle_factors2, DSP_OPTI_ACCURACY, DSP_OPTI_SIZE, DSP_OPTIMIZATION, HI, LO, M_BITREV_BUTTERFLY4_ZERO_COMPUT, M_BUTTERFLY4_COMPUT, and M_BUTTERFLY4_ZERO_COMPUT.

void dsp16_trans_complexifft ( dsp16_complex_t vect1,
dsp16_complex_t vect2,
int  nlog 
)

16-bit fixed point version of the complex iFFT algorithm.

Parameters
vect1A pointer on a 16-bit complex vector which is the output buffer of this function.
vect2A pointer on a 16-bit complex vector which is the input buffer of this function.
nlogIt is the base-2-logarithm of the size of the input/output vector.
Due to its implementation, this function computes only 4^n-point complex iFFT. Therefore, the nlog argument has to be even.
Note
The following requirements have to be matched:
  • The size of the output buffer has to be the same as the size of the input buffer.
  • This function uses a static twiddle factors table which determines the maximal FFT size which can be performed. By default it is 1024. Please check the value of DSP16_N_TWIDDLE_FACTORS.
  • vect1 and vect2 MUST be 4-byte aligned. Please use A_ALIGNED to do so.
  • To avoid overflowing values, the resulting vector amplitude is scaled by 2^nlog.

References dsp16_trans_complexifft_ex(), and dsp16_vect_complex_conj().

void dsp16_trans_realcomplexfft ( dsp16_complex_t vect1,
dsp16_t vect2,
int  nlog 
)

16-bit fixed point version of the real to complex FFT algorithm.

Parameters
vect1A pointer on a 16-bit complex vector which is the output buffer of this function.
vect2A pointer on a 16-bit real vector which is the input buffer of this function.
nlogIt is the base-2-logarithm of the size of the input/output vector.
Due to its implementation, this function computes only 4^n-point complex FFT. Therefore, the nlog argument has to be even.
Note
The following requirements have to be matched:
  • The size of the output buffer has to be the same as the size of the input buffer.
  • This function uses a static twiddle factors table which determines the maximal FFT size which can be performed. By default it is 1024. Please check the value of DSP16_N_TWIDDLE_FACTORS.
  • vect1 and vect2 MUST be 4-byte aligned. Please use A_ALIGNED to do so.
  • To avoid overflowing values, the resulting vector amplitude is scaled by 2^nlog.

16-bit fixed point version of the real to complex FFT algorithm.

References ASM_INSTRUCT_COMPACKED, ASTRINGZ, DSP16_N_TWIDDLE_FACTORS, dsp16_twiddle_factors, dsp16_twiddle_factors2, DSP_OPTI_ACCURACY, DSP_OPTI_SIZE, DSP_OPTIMIZATION, HI, LO, M_BITREV_BUTTERFLY4_ZERO_COMPUT, M_BUTTERFLY4_COMPUT, and M_BUTTERFLY4_ZERO_COMPUT.

Referenced by main().

void dsp32_trans_realcomplexfft ( dsp32_complex_t vect1,
dsp32_t vect2,
int  nlog 
)

32-bit fixed point version of the real to complex FFT algorithm.

Parameters
vect1A pointer on a 32-bit complex vector which is the output buffer of this function.
vect2A pointer on a 32-bit real vector which is the input buffer of this function.
nlogIt is the base-2-logarithm of the size of the input/output vector.
Due to its implementation, this function computes only 4^n-point complex FFT. Therefore, the nlog argument has to be even.
Note
The following requirements have to be matched:
  • The size of the output buffer has to be the same as the size of the input buffer.
  • This function uses a static twiddle factors table which determines the maximal FFT size which can be performed. By default it is 1024. Please check the value of DSP32_N_TWIDDLE_FACTORS.
  • vect1 and vect2 MUST be 4-byte aligned. Please use A_ALIGNED to do so.
  • To avoid overflowing values, the resulting vector amplitude is scaled by 2^nlog.

References DSP32_N_TWIDDLE_FACTORS, DSP32_QB, dsp32_twiddle_factors, dsp32_twiddle_factors2, dsp32_complex_t::imag, and dsp32_complex_t::real.