function [GS]=D_wP_coefP(Par,N,De)

%N- length of period
%Par- order of spline

%De- maximal depth of decomposition
%preparation of DFT spectra of discrete spline waveletpackets of order Par on the fragment
%of length N down to the level De
%GS- cell array of DFT spectra coefficients of discrete  wavelet packets



GS=cell(De,1);

GS{1}=cell(1,2);

[S D ]= D_lohifilP(Par,N,1);
GS{1}{1}=S*sqrt(2);  
GS{1}{2}=D*sqrt(2); 




for d=2:De 
    dd=2^d; 
    
   GS{d}=cell(1,dd);
    
   [S D ]= D_lohifilP(Par,N,d);
   % co=[];si=[];
%     S=repmat(S,1,dd/2);
%         D=repmat(D,1,dd/2);

	
      
    for b=0:(dd-1)
        bb=floor(b/2);  
        rr=rem(bb,2);  
        us=GS{d-1}{bb+1};
        GS{d}{2*bb+2}=us.*(rr*S+(1-rr)*D)*sqrt(2); 
        GS{d}{2*bb+1}=us.*(rr*D+(1-rr)*S)*sqrt(2); 
   
    end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Copyright (c) 2011. Valery A. Zheludev
 