1
// Copyright (C) 2013 Conrad Sanderson
2
// Copyright (C) 2013 NICTA (www.nicta.com.au)
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/.
9
//! \addtogroup fn_fft2
23
is_arma_type<T1>::value,
24
Mat< std::complex<typename T1::pod_type> >
28
arma_extra_debug_sigprint();
30
// not exactly efficient, but "better-than-nothing" implementation
32
typedef typename T1::pod_type T;
34
Mat< std::complex<T> > B = fft(A);
36
// for square matrices, strans() will work out that an inplace transpose can be done,
37
// hence we can potentially avoid creating a temporary matrix
41
return strans( fft(B) );
51
is_arma_type<T1>::value,
52
Mat< std::complex<typename T1::pod_type> >
54
fft2(const T1& A, const uword n_rows, const uword n_cols)
56
arma_extra_debug_sigprint();
58
typedef typename T1::elem_type eT;
60
const unwrap<T1> tmp(A);
61
const Mat<eT>& B = tmp.M;
63
const bool do_resize = (B.n_rows != n_rows) || (B.n_cols != n_cols);
65
return fft2( do_resize ? resize(B,n_rows,n_cols) : B );
75
(is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value),
76
Mat< std::complex<typename T1::pod_type> >
80
arma_extra_debug_sigprint();
82
// not exactly efficient, but "better-than-nothing" implementation
84
typedef typename T1::pod_type T;
86
Mat< std::complex<T> > B = ifft(A);
88
// for square matrices, strans() will work out that an inplace transpose can be done,
89
// hence we can potentially avoid creating a temporary matrix
93
return strans( ifft(B) );
103
(is_arma_type<T1>::value && is_complex_strict<typename T1::elem_type>::value),
104
Mat< std::complex<typename T1::pod_type> >
106
ifft2(const T1& A, const uword n_rows, const uword n_cols)
108
arma_extra_debug_sigprint();
110
typedef typename T1::elem_type eT;
112
const unwrap<T1> tmp(A);
113
const Mat<eT>& B = tmp.M;
115
const bool do_resize = (B.n_rows != n_rows) || (B.n_cols != n_cols);
117
return ifft2( do_resize ? resize(B,n_rows,n_cols) : B );