11 typedef struct ALcomplex
{
16 /** Addition of two complex numbers. */
17 inline ALcomplex
complex_add(ALcomplex a
, ALcomplex b
)
21 result
.Real
= a
.Real
+ b
.Real
;
22 result
.Imag
= a
.Imag
+ b
.Imag
;
27 /** Subtraction of two complex numbers. */
28 inline ALcomplex
complex_sub(ALcomplex a
, ALcomplex b
)
32 result
.Real
= a
.Real
- b
.Real
;
33 result
.Imag
= a
.Imag
- b
.Imag
;
38 /** Multiplication of two complex numbers. */
39 inline ALcomplex
complex_mult(ALcomplex a
, ALcomplex b
)
43 result
.Real
= a
.Real
*b
.Real
- a
.Imag
*b
.Imag
;
44 result
.Imag
= a
.Imag
*b
.Real
+ a
.Real
*b
.Imag
;
50 * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
51 * FFT and 1 is iFFT (inverse). Fills FFTBuffer[0...FFTSize-1] with the
52 * Discrete Fourier Transform (DFT) of the time domain data stored in
53 * FFTBuffer[0...FFTSize-1]. FFTBuffer is an array of complex numbers, FFTSize
54 * MUST BE power of two.
56 void complex_fft(ALcomplex
*FFTBuffer
, ALsizei FFTSize
, ALdouble Sign
);
59 * Calculate the complex helical sequence (discrete-time analytical signal) of
60 * the given input using the discrete Hilbert transform (In-place algorithm).
61 * Fills Buffer[0...size-1] with the discrete-time analytical signal stored in
62 * Buffer[0...size-1]. Buffer is an array of complex numbers, size MUST BE
65 void complex_hilbert(ALcomplex
*Buffer
, ALsizei size
);
71 #endif /* ALCOMPLEX_H */