function x = ifftn(f, siz)
%IFFTN N-dimensional inverse discrete Fourier transform.
%   IFFTN(F) returns the N-dimensional inverse discrete Fourier
%   transform of the N-D array F.  If F is a vector, the result
%   will have the same orientation.
%
%   IFFTN(F,SIZ) pads F so that its size vector is SIZ before
%   performing the transform.  If any element of SIZ is smaller
%   than the corresponding dimension of F, then F will be cropped
%   in that dimension.
%
%   See also FFT, IFFT, FFT2, IFFT2, FFTN.

%   Steven L. Eddins, January 1996
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.9 $  $Date: 1998/03/26 18:48:08 $

%   Reference: Dudgeon and Mersereau, Multidimensional Digital
%   Signal Processing, Prentice-Hall, 1984.

if (~isa(f,'double'))
    f = double(f);
end

f = conj(f);
if nargin==1
    x = conj(fftn(f));
else
    x = conj(fftn(f,siz));
end
x = x/prod(size(x));
