1 | // Copyright (C) 2013 Conrad Sanderson |
---|
2 | // Copyright (C) 2013 NICTA (www.nicta.com.au) |
---|
3 | // |
---|
4 | // This Source Code Form is subject to the terms of the Mozilla Public |
---|
5 | // License, v. 2.0. If a copy of the MPL was not distributed with this |
---|
6 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. |
---|
7 | |
---|
8 | |
---|
9 | //! \addtogroup fn_fft |
---|
10 | //! @{ |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | // 1D FFT & 1D IFFT |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | template<typename T1> |
---|
19 | inline |
---|
20 | typename |
---|
21 | enable_if2 |
---|
22 | < |
---|
23 | (is_arma_type<T1>::value && is_real<typename T1::elem_type>::value), |
---|
24 | const mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real> |
---|
25 | >::result |
---|
26 | fft(const T1& A) |
---|
27 | { |
---|
28 | arma_extra_debug_sigprint(); |
---|
29 | |
---|
30 | return mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real>(A, uword(0), uword(1)); |
---|
31 | } |
---|
32 | |
---|
33 | |
---|
34 | |
---|
35 | template<typename T1> |
---|
36 | inline |
---|
37 | typename |
---|
38 | enable_if2 |
---|
39 | < |
---|
40 | (is_arma_type<T1>::value && is_real<typename T1::elem_type>::value), |
---|
41 | const mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real> |
---|
42 | >::result |
---|
43 | fft(const T1& A, const uword N) |
---|
44 | { |
---|
45 | arma_extra_debug_sigprint(); |
---|
46 | |
---|
47 | return mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real>(A, N, uword(0)); |
---|
48 | } |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | template<typename T1> |
---|
53 | inline |
---|
54 | typename |
---|
55 | enable_if2 |
---|
56 | < |
---|
57 | (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), |
---|
58 | const Op<T1, op_fft_cx> |
---|
59 | >::result |
---|
60 | fft(const T1& A) |
---|
61 | { |
---|
62 | arma_extra_debug_sigprint(); |
---|
63 | |
---|
64 | return Op<T1, op_fft_cx>(A, uword(0), uword(1)); |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | template<typename T1> |
---|
70 | inline |
---|
71 | typename |
---|
72 | enable_if2 |
---|
73 | < |
---|
74 | (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), |
---|
75 | const Op<T1, op_fft_cx> |
---|
76 | >::result |
---|
77 | fft(const T1& A, const uword N) |
---|
78 | { |
---|
79 | arma_extra_debug_sigprint(); |
---|
80 | |
---|
81 | return Op<T1, op_fft_cx>(A, N, uword(0)); |
---|
82 | } |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | template<typename T1> |
---|
87 | inline |
---|
88 | typename |
---|
89 | enable_if2 |
---|
90 | < |
---|
91 | (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), |
---|
92 | const Op<T1, op_ifft_cx> |
---|
93 | >::result |
---|
94 | ifft(const T1& A) |
---|
95 | { |
---|
96 | arma_extra_debug_sigprint(); |
---|
97 | |
---|
98 | return Op<T1, op_ifft_cx>(A, uword(0), uword(1)); |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | template<typename T1> |
---|
104 | inline |
---|
105 | typename |
---|
106 | enable_if2 |
---|
107 | < |
---|
108 | (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), |
---|
109 | const Op<T1, op_ifft_cx> |
---|
110 | >::result |
---|
111 | ifft(const T1& A, const uword N) |
---|
112 | { |
---|
113 | arma_extra_debug_sigprint(); |
---|
114 | |
---|
115 | return Op<T1, op_ifft_cx>(A, N, uword(0)); |
---|
116 | } |
---|
117 | |
---|
118 | |
---|
119 | |
---|
120 | //! @} |
---|