function f = ifour(fh,dim)
% f = ifour(fh)      % apply ifour for first dimension with size>1
% f = ifour(fh,dim)  % apply ifour for dimension dim of array fh
% inverse discrete Fourier transform
% for Fourier coefficients fh = [fhat_0,...,fhat_{N-1}] in frequency domain
% find signal f = [f_0,...,f_{N-1}] in time domain 
%
% f = four(fh,dim)  % apply across dimension dim of array fh
% f = four(fh,1)    % take transform of each column
% f = four(fh,2)    % take tansform of each row

if nargin==1
  dim = find(size(fh)>1,1);
  if isempty(dim)
    dim = 1;
  end
end

f = ifft(fh,[],dim)*size(fh,dim);


