%
function [spli, fspli]=D_smoothsplaP_2d(z,Par,m,rho) 

%z --values of the input array at the points {k,n,=0:2^m:N/2^m-1}, N=2^j
%2^m--span of the spline
%Par -- order of solution spline, should be even number
%rho -regularization parameter
%calculation of the smoothing spline values 'spli'at integer points {k,n=0:N-1}
%fspli -- 2D DFT of the array 'spli'
[lz,hz]=size(z);
N=2^m*lz;
fz=fft2(z);
[~, fbsp , ~, U2]=per_dbspP(N,m,Par);
 
n=0:N-1;
   si=sin(pi*n/lz);
   W=(2^(1-m)*si).^Par;
    W=repmat(W,N,1); 
  
    W=W'+W;
  %W=W'*W; 
  U2=repmat(U2,1,2^m);
  U2=U2'*U2;
  fbsp=fbsp'*fbsp;
   fz=repmat(fz,2^m,2^m);
    spli=real(ifft2(fz./(rho*W+U2).*fbsp));
 

fspli=abs(fft2(spli));
 %
 % Copyright (c) 2012. Valery A. Zheludev




