function  res = TVOP(imSize)

%res = TVOP()
%
% Implements a spatial finite-differencing operator.
%
% (c) Michael Lustig 2007

% modified to be circulant and compute FFT version

res.adjoint = 0;

if exist('imSize','var') && ~isempty(imSize)
    % Dx convolution
    res.DxFFT = fft([-1;zeros(imSize(1)-2,1);1]);
    res.DyFFT = fft([-1,zeros(1,imSize(2)-2),1]);
%     res.DxFFT = fft2c(zpad([1;-1]*sqrt(imSize(1)),imSize(1),1));
%     res.DyFFT = fft2c(zpad([1,-1]*sqrt(imSize(2)),1,imSize(2)));
else
    res.DxFFT = [];
    res.DyFFT = [];
end

res = class(res,'TVOP');

