-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.h
80 lines (65 loc) · 1.47 KB
/
common.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef __Fourier_tool_
#define __Fourier_tool_
#include "Complex.h"
//#ifndef Endian
// bool fun(){
// union TT{
// int a;
// char b;
// }test;
// test.a = 0x1234;
// if(test.b == 0x12)
// return true;
// else
// return false;
// }
// bool flag = fun();
//
//#endif
typedef unsigned long u_long;
typedef unsigned int u_int;
typedef unsigned short u_short;
typedef unsigned char u_char;
//static u_int x = 0x0;
#ifdef __cplusplus
extern "C"{
#endif
/*
all below are must agree
input N must lower than length of 100M(2^22);
*/
void fft_base2(Complexf *cm,int N);
/*just return the floor num of log*/
u_int log2a(u_int n);
void ifft_base2(Complexf *cm,int N);
void bitReverse(Complexf *cm,u_int N);
u_int *getPrime(int N);
void fft_CN(Complexf *cm,int N);
void ifft_CN(Complexf *cm,int N);
void CN_reverse(Complexf *cm, u_int *pN, u_int N);
/*void bitVerbose(Complexf *cm,int N);*/
/*
type code here
*/
/*
fft 2d shift
*/
void fft_2d_shift(Complexf* cm,u_int n);
/**
fft 2d unshift
*/
void fft_2d_unshift(Complexf* cm, u_int n);
void fft_2d(Complexf *cm,u_int w,u_int h);
void ifft_2d(Complexf *cm,u_int w,u_int h);
/*
test
*/
void dft(Complexf *cm,Complexf* res,Complexf* wnk,u_int n,u_int *nk);
void test_dft(Complexf *cm,u_int N);
/***/
void fft_normal(Complexf *cm, int N);
void ifft_normal(Complexf *cm, int N);
#ifdef __cplusplus
}
#endif
#endif