function omat=threhard(imat,sw1,ph1,thre)
% *** Inject frequency zeros by hard thresholding ***
% Y. Matsuki, April, 2008
% usage:
% omat=thresoft(imat,sw1,ph1,thre)
% ========================================================

% tic
nr=length(imat(:,1));
nc=length(imat(1,:));

temp=mphasec(imat,sw1,ph1,2);

 for m=1:nc
     for n=1:nr
         if abs(real(temp(n,m))) < thre
             temp(n,m)=0+0i;
         end
%          if abs(imag(omat(n,m))) > thre
%              imag(temp(n,m))=0.0;
%          end
     end
 end
omat=mphasec(temp,sw1,-1.*ph1,2);

% toc
