Mercurial > hg > segmenter-vamp-plugin
comparison armadillo-3.900.4/include/armadillo_bits/fn_fft.hpp @ 49:1ec0e2823891
Switch to using subrepo copies of qm-dsp, nnls-chroma, vamp-plugin-sdk; update Armadillo version; assume build without external BLAS/LAPACK
author | Chris Cannam |
---|---|
date | Thu, 13 Jun 2013 10:25:24 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
48:69251e11a913 | 49:1ec0e2823891 |
---|---|
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 // TODO: fft(real) -> complex [to be tested thoroughly] | |
15 // TODO: fft(complex) -> complex [to be tested thoroughly] | |
16 // TODO: ifft(complex) -> complex [to be tested thoroughly] | |
17 | |
18 | |
19 template<typename T1> | |
20 inline | |
21 typename | |
22 enable_if2 | |
23 < | |
24 (is_arma_type<T1>::value && is_real<typename T1::elem_type>::value), | |
25 const mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real> | |
26 >::result | |
27 fft(const T1& A) | |
28 { | |
29 arma_extra_debug_sigprint(); | |
30 | |
31 return mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real>(A, uword(0), uword(1)); | |
32 } | |
33 | |
34 | |
35 | |
36 template<typename T1> | |
37 inline | |
38 typename | |
39 enable_if2 | |
40 < | |
41 (is_arma_type<T1>::value && is_real<typename T1::elem_type>::value), | |
42 const mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real> | |
43 >::result | |
44 fft(const T1& A, const uword N) | |
45 { | |
46 arma_extra_debug_sigprint(); | |
47 | |
48 return mtOp<std::complex<typename T1::pod_type>, T1, op_fft_real>(A, N, uword(0)); | |
49 } | |
50 | |
51 | |
52 | |
53 template<typename T1> | |
54 inline | |
55 typename | |
56 enable_if2 | |
57 < | |
58 (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), | |
59 const Op<T1, op_fft_cx> | |
60 >::result | |
61 fft(const T1& A) | |
62 { | |
63 arma_extra_debug_sigprint(); | |
64 | |
65 return Op<T1, op_fft_cx>(A, uword(0), uword(1)); | |
66 } | |
67 | |
68 | |
69 | |
70 template<typename T1> | |
71 inline | |
72 typename | |
73 enable_if2 | |
74 < | |
75 (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), | |
76 const Op<T1, op_fft_cx> | |
77 >::result | |
78 fft(const T1& A, const uword N) | |
79 { | |
80 arma_extra_debug_sigprint(); | |
81 | |
82 return Op<T1, op_fft_cx>(A, N, uword(0)); | |
83 } | |
84 | |
85 | |
86 | |
87 template<typename T1> | |
88 inline | |
89 typename | |
90 enable_if2 | |
91 < | |
92 (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), | |
93 const Op<T1, op_ifft_cx> | |
94 >::result | |
95 ifft(const T1& A) | |
96 { | |
97 arma_extra_debug_sigprint(); | |
98 | |
99 return Op<T1, op_ifft_cx>(A, uword(0), uword(1)); | |
100 } | |
101 | |
102 | |
103 | |
104 template<typename T1> | |
105 inline | |
106 typename | |
107 enable_if2 | |
108 < | |
109 (is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value), | |
110 const Op<T1, op_ifft_cx> | |
111 >::result | |
112 ifft(const T1& A, const uword N) | |
113 { | |
114 arma_extra_debug_sigprint(); | |
115 | |
116 return Op<T1, op_ifft_cx>(A, N, uword(0)); | |
117 } | |
118 | |
119 | |
120 | |
121 //! @} |