% zero padding matrix in the Fourier domain
%
% Add zeros (symmetrically) in each dimension to a centered (fftshifted)
% Fourier spectrum.
%
% A = matZpad(sz,pad)
%
% (c) by Hannes Nickisch, MPI for Biological Cybernetics, 2010 December 6

function A = matZpadF(sz, pad, complex)
  
  if nargin<2, pad = sz*0; end, A.pad  = pad;
  A.imsz = sz; sz = [prod(A.imsz+2*pad), prod(A.imsz)];
  if nargin<3, complex = 1; end
  if numel(complex)==1, complex = complex*[1,1]; end
  
  A = class(A,mfilename,mat(sz,complex));