Sat Apr 09, 2011 10:16 pm
function ex = inverseFilter(y,h,gamma);
%
% ex = inverseFilter(y,h,gamma);
%
% Generalized inverse filtering using threshold gamma:
%
% inv_g(H) = gamma*abs(fft(h))/fft(h), if abs(fft(h)) <= 1/gamma
% inv_g(H) = inv(H), otherwise
%
% Reference: Lims book
% Created: Tue May 4 16:22:57 CDT 1999, Huipin Zhang
N = size(y,1);
Yf = fft2(y);
Hf = fft2(h,N,N);
% handle singular case (zero case)
sHf = Hf.*(abs(Hf)>0)+1/gamma*(abs(Hf)==0);
iHf = 1./sHf;
%lengthzero = length(abs(Hf)==0)
% invert Hf using threshold gamma
iHf = iHf.*(abs(Hf)*gamma>1)+gamma*abs(sHf).*iHf.*(abs(sHf)*gamma<=1);
ex = real(ifft2(iHf.*Yf));
return
|
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.