function y=sharperc(x,j,t)

%Y=SHARPERC(X,J,T)    Scales wavelet coefficients 

%--------------------------------------------------------
%      Author: J. M. Aroca
%
%      e-mail: jomaroca@mat.upc.es
%--------------------------------------------------------


sz=size(x);
a=sz(1);
if a<2^j or sz(2)~=a
   disp('invalid arguments')
	return
end
if length(sz)~=3 or sz(3)~=3
   disp('non color image!')
	return
end

[h,g,hr,gr]=daub(4);
xw1=wt2d(x(:,:,1),h,g,j);
xw2=wt2d(x(:,:,2),h,g,j);
xw3=wt2d(x(:,:,3),h,g,j);

z=ones(a/2^j,a/2^j);
for k=1:j
   z=[z,t*z;t*z,t*z];
end

xw1s=xw1.*z;
xw2s=xw2.*z;
xw3s=xw3.*z;
y(:,:,1)=iwt2d(xw1s,hr,gr,j);
y(:,:,2)=iwt2d(xw2s,hr,gr,j);
y(:,:,3)=iwt2d(xw3s,hr,gr,j);


