ISACaller: implement real_addr pseudo-code helper
[openpower-isa.git] / media / fft / fft-real-pair.h
1 /*
2 Free FFT and convolution (C)
3
4 Copyright (c) 2020 Project Nayuki. (MIT License)
5 https://www.nayuki.io/page/free-small-fft-in-multiple-languages
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy of
8 this software and associated documentation files (the "Software"), to deal in
9 the Software without restriction, including without limitation the rights to
10 use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 - The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15 - The Software is provided "as is", without warranty of any kind, express or
16 implied, including but not limited to the warranties of merchantability,
17 fitness for a particular purpose and noninfringement. In no event shall
18 the authors or copyright holders be liable for any claim, damages or
19 other liability, whether in an action of contract, tort or otherwise,
20 arising from, out of or in connection with the Software or the use
21 or other dealings in the Software.
22 */
23
24 #include <stdbool.h>
25 #include <stddef.h>
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32
33 /*
34 Computes the discrete Fourier transform (DFT) of the given complex
35 vector, storing the result back into the vector. The vector can have
36 any length. This is a wrapper function. Returns true if successful,
37 false otherwise (out of memory).
38 */
39 bool Fft_transform(float real[], float imag[], size_t n);
40
41
42 /*
43 Computes the inverse discrete Fourier transform (IDFT) of the given
44 complex vector, storing the result back into the vector. The vector
45 can have any length. This is a wrapper function. This transform does
46 not perform scaling, so the inverse is not a true inverse. Returns true
47 if successful, false otherwise (out of memory).
48 */
49 bool Fft_inverseTransform(float real[], float imag[], size_t n);
50
51
52 /*
53 Computes the discrete Fourier transform (DFT) of the given complex
54 vector, storing the result back into the vector. The vector's length
55 must be a power of 2. Uses the Cooley-Tukey decimation-in-time radix-2
56 algorithm.
57 Returns true if successful, false otherwise (n is not a
58 power of 2, or out of memory).
59 */
60 bool Fft_transformRadix2(float real[], float imag[], size_t n);
61
62
63 #ifdef __cplusplus
64 }
65 #endif