38 #if defined (HAVE_FFTW)
39 #define FFTSRC "@sc{fftw}"
41 #define FFTSRC "@sc{fftpack}"
49 int nargin = args.
length ();
51 if (nargin < 1 || nargin > 3)
63 double dval = args(1).double_value ();
65 error (
"%s: number of rows (N) cannot be NaN", fcn);
70 error (
"%s: number of rows (N) must be greater than zero", fcn);
80 double dval = args(2).double_value ();
82 error (
"%s: number of columns (M) cannot be NaN", fcn);
87 error (
"%s: number of columns (M) must be greater than zero", fcn);
94 for (
int i = 0; i < dims.
length (); i++)
108 if (dims.
all_zero () || n_rows == 0 || n_cols == 0)
172 @deftypefn {Built-in Function} {} fft2 (@var{A})\n\
173 @deftypefnx {Built-in Function} {} fft2 (@var{A}, @var{m}, @var{n})\n\
174 Compute the two-dimensional discrete Fourier transform of @var{A} using\n\
175 a Fast Fourier Transform (FFT) algorithm.\n\
177 The optional arguments @var{m} and @var{n} may be used specify the\n\
178 number of rows and columns of @var{A} to use. If either of these is\n\
179 larger than the size of @var{A}, @var{A} is resized and padded with\n\
182 If @var{A} is a multi-dimensional matrix, each two-dimensional sub-matrix\n\
183 of @var{A} is treated separately.\n\
184 @seealso {ifft2, fft, fftn, fftw}\n\
187 return do_fft2 (args,
"fft2", 0);
191 DEFUN (ifft2, args, ,
193 @deftypefn {Built-in Function} {} ifft2 (@var{A})\n\
194 @deftypefnx {Built-in Function} {} ifft2 (@var{A}, @var{m}, @var{n})\n\
195 Compute the inverse two-dimensional discrete Fourier transform of @var{A}\n\
196 using a Fast Fourier Transform (FFT) algorithm.\n\
198 The optional arguments @var{m} and @var{n} may be used specify the\n\
199 number of rows and columns of @var{A} to use. If either of these is\n\
200 larger than the size of @var{A}, @var{A} is resized and padded with\n\
203 If @var{A} is a multi-dimensional matrix, each two-dimensional sub-matrix\n\
204 of @var{A} is treated separately\n\
205 @seealso {fft2, ifft, ifftn, fftw}\n\
208 return do_fft2 (args,
"ifft2", 1);