|
2 | 2 |
|
3 | 3 | public class Signal extends Array { |
4 | 4 |
|
5 | | - private native static long fft (long a); |
6 | | - private native static long fft2 (long a); |
7 | | - private native static long fft3 (long a); |
| 5 | + private native static long fft (long a, int dim0); |
| 6 | + private native static long fft2 (long a, int dim0, int dim1); |
| 7 | + private native static long fft3 (long a, int dim0, int dim1, int dim2); |
8 | 8 |
|
9 | | - private native static long ifft (long a); |
10 | | - private native static long ifft2(long a); |
11 | | - private native static long ifft3(long a); |
| 9 | + private native static long ifft (long a, int dim0); |
| 10 | + private native static long ifft2(long a, int dim0, int dim1); |
| 11 | + private native static long ifft3(long a, int dim0, int dim1, int dim2); |
12 | 12 |
|
13 | | - private native static long convolve (long a, long b); |
| 13 | + private native static long convolve1(long a, long b, int type); |
| 14 | + private native static long convolve2(long a, long b, int type); |
| 15 | + private native static long convolve3(long a, long b, int type); |
14 | 16 |
|
15 | 17 | public static void fft(Array res, Array a) throws Exception { |
16 | | - long ref = fft(a.ref); |
| 18 | + long ref = fft(a.ref, 0); |
| 19 | + res.set(ref); |
| 20 | + } |
| 21 | + |
| 22 | + public static void fft(Array res, Array a, int dim0) throws Exception { |
| 23 | + long ref = fft(a.ref, dim0); |
17 | 24 | res.set(ref); |
18 | 25 | } |
19 | 26 |
|
20 | 27 | public static void fft2(Array res, Array a) throws Exception { |
21 | | - long ref = fft2(a.ref); |
| 28 | + long ref = fft2(a.ref, 0, 0); |
| 29 | + res.set(ref); |
| 30 | + } |
| 31 | + |
| 32 | + public static void fft2(Array res, Array a, int dim0, int dim1) throws Exception { |
| 33 | + long ref = fft2(a.ref, dim0, dim1); |
22 | 34 | res.set(ref); |
23 | 35 | } |
24 | 36 |
|
25 | 37 | public static void fft3(Array res, Array a) throws Exception { |
26 | | - long ref = fft3(a.ref); |
| 38 | + long ref = fft3(a.ref, 0, 0, 0); |
| 39 | + res.set(ref); |
| 40 | + } |
| 41 | + |
| 42 | + public static void fft3(Array res, Array a, int dim0, int dim1, int dim2) throws Exception { |
| 43 | + long ref = fft3(a.ref, dim0, dim1, dim2); |
27 | 44 | res.set(ref); |
28 | 45 | } |
29 | 46 |
|
30 | 47 | public static void ifft(Array res, Array a) throws Exception { |
31 | | - long ref = ifft(a.ref); |
| 48 | + long ref = ifft(a.ref, 0); |
| 49 | + res.set(ref); |
| 50 | + } |
| 51 | + |
| 52 | + public static void ifft(Array res, Array a, int dim0) throws Exception { |
| 53 | + long ref = ifft(a.ref, dim0); |
32 | 54 | res.set(ref); |
33 | 55 | } |
34 | 56 |
|
35 | 57 | public static void ifft2(Array res, Array a) throws Exception { |
36 | | - long ref = ifft2(a.ref); |
| 58 | + long ref = ifft2(a.ref, 0, 0); |
| 59 | + res.set(ref); |
| 60 | + } |
| 61 | + |
| 62 | + public static void ifft2(Array res, Array a, int dim0, int dim1) throws Exception { |
| 63 | + long ref = ifft2(a.ref, dim0, dim1); |
37 | 64 | res.set(ref); |
38 | 65 | } |
39 | 66 |
|
40 | 67 | public static void ifft3(Array res, Array a) throws Exception { |
41 | | - long ref = ifft3(a.ref); |
| 68 | + long ref = ifft3(a.ref, 0, 0, 0); |
| 69 | + res.set(ref); |
| 70 | + } |
| 71 | + |
| 72 | + public static void ifft3(Array res, Array a, int dim0, int dim1, int dim2) throws Exception { |
| 73 | + long ref = ifft3(a.ref, dim0, dim1, dim2); |
| 74 | + res.set(ref); |
| 75 | + } |
| 76 | + |
| 77 | + public static void convolve1(Array res, Array a, Array b) throws Exception { |
| 78 | + long ref = convolve1(a.ref, b.ref, 0); |
| 79 | + res.set(ref); |
| 80 | + } |
| 81 | + |
| 82 | + public static void convolve2(Array res, Array a, Array b) throws Exception { |
| 83 | + long ref = convolve2(a.ref, b.ref, 0); |
42 | 84 | res.set(ref); |
43 | 85 | } |
44 | 86 |
|
45 | | - public static void convolve(Array res, Array a, Array b) throws Exception { |
46 | | - long ref = convolve(a.ref, b.ref); |
| 87 | + public static void convolve3(Array res, Array a, Array b) throws Exception { |
| 88 | + long ref = convolve3(a.ref, b.ref, 0); |
47 | 89 | res.set(ref); |
48 | 90 | } |
49 | 91 | } |
0 commit comments