Files
cKit/Context/c_FFT.h
T
2026-09-07 19:33:37 +08:00

49 lines
1.4 KiB
C

#ifndef INCLUDED_C_FFT_H
#define INCLUDED_C_FFT_H
#ifndef INCLUDED_C_TYPES_H
#include <c_Types.h>
#endif /*INCLUDED_C_TYPES_H*/
#ifndef INCLUDED_C_ALLOCATOR_H
#include <c_Allocator.h>
#endif /*INCLUDED_C_ALLOCATOR_H*/
#ifndef INCLUDED_C_COMPLEX_H
#include <c_Complex.h>
#endif /*INCLUDED_C_COMPLEX_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
typedef struct {
c_size_t N; /* Length of the signal buffer (Must be a power of 2) */
c_Allocator_t allocator; /* Deep copy of the user-provided allocator */
} c_FFT_t;
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
/**
* @brief Initializes the FFT calculation engine context.
* @param N Total number of signal sample points (Must be a strict power of 2)
*/
c_err_t c_FFT_Init(c_FFT_t* self, c_size_t N, c_Allocator_t* allocator);
/**
* @brief Releases internal tracking engine allocations.
*/
void c_FFT_Destroy(c_FFT_t* self);
/**
* @brief Non-recursively executes the forward or inverse FFT in-place.
* @param signal Array of complex samples of size self->N (Modified in-place)
* @param inverse Set to C_TRUE for Inverse FFT (IFFT), C_FALSE for Forward FFT
*/
c_err_t c_FFT_Execute(const c_FFT_t* self, c_Complex_t* signal, c_bool_t inverse);
#endif /*INCLUDED_C_FFT_H*/