-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathXFFT.h
54 lines (46 loc) · 1.45 KB
/
XFFT.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <array>
#include <cmath>
namespace xmath
{
namespace fft
{
enum class WindowType
{
Triangular,
Bartlett,
Parzen,
GeneralCosine,
GeneralHamming,
GeneralGaussian,
Hann,
Hamming,
Blackman,
Nuttall,
BlackmanHarris,
Flattop,
Gaussian,
WindowTypeNum
};
void getTriangularWindow(size_t N, float* window);
void getBartlettWindow(size_t N, float* window);
void getParzenWindow(size_t N, float* window);
void getGeneralCosineWindow(size_t N, float* window, size_t Nparam, float* param);
void getGeneralHammingWindow(size_t N, float* window, float alpha);
void getGeneralGaussianWindow(size_t N, float* window, float p, float sigma);
void getHannWindow(size_t N, float* window);
void getHammingWindow(size_t N, float* window);
void getBlackmanWindow(size_t N, float* window);
void getNuttallWindow(size_t N, float* window);
void getBlackmanHarrisWindow(size_t N, float* window);
void getFlattopWindow(size_t N, float* window);
void getGaussianWindow(size_t N, float* window, float sigma);
void getWindow(size_t N, float* window, WindowType type = WindowType::Hann,
size_t Nparam = 0, float* param = nullptr);
size_t getNeededWorksetSize(size_t N);
/** in[N], outComplex[N*2] */
void fft(size_t N, void* workset, float* in, float* outComplex);
/** in[N], outComplex[N*2], outNorm[N/2] */
void fft(size_t N, void* workset, float* in, float* outComplex, float* outNorm);
}
}