function D_cl = rem_noise_WTHresh(D,sigma,MultipFac,THRrule);


[M,N]=size(D);
Thr= sigma*sqrt(2*log10(M*N))*MultipFac;

if(THRrule==1)
    % soft thresholding
  D_cl=sign(D).*max(0,abs(D)-Thr);
else
    % hard thresholding
  D_cl=D;
  z=find(abs(D_cl)<Thr);
  D_cl(z)=0;
end

 




 








