function impulse = paddiff(varargin)
%    disp("Number of input arguments: " + nargin)
%    celldisp(varargin)
    if nargin>1
        d=varargin{2};
    else
	d=1;
    end

    [r c]=size(varargin{1});
    if r==1
       padded=[zeros(r,d)  varargin{1}  zeros(r,d) ];
    else
       padded=[zeros(d,c) ; varargin{1} ; zeros(d,c) ];
    end
    impulse= diff(padded,d);
end
