www.pudn.com > filt1D.rar > filt1D.m, change:2010-01-08,size:831b


function [H] = filt1D(n,c,epsl) 
 
% FILT1D Low-Pass filter design in the Fourier domain 
%    FILT1D(N,C) computes a vector of N uniformly distribu- 
%    ed samples of the frequency response of a lowpass fil- 
%    ter with cutoff frequency 0 < C < 1, with 1 correspon- 
%    ding to the Nyquist frequency. 
%  
%                  [H] = filt1D(n,c,epsl) 
% Input: 
%              n - length of the filter 
%              c - cutoff frequency (0 < c < 1) 
%           epsl - smoothing parameter (default = 1e-4) 
% Output: 
%              H - frequency response of the filter 
% 
% written by Oleg Michailovich, Summer 2005  
 
if (nargin < 3) 
    epsl=1e-4; 
end 
 
c=c*pi; 
w=2*pi*(0:n-1)'/n; 
w=w-(2*pi)*(w>pi); 
 
betta=0.5/(1+epsl); 
alpha=log((1-betta)/betta/epsl)/(c^2)/2; 
h=exp(-alpha*abs(w).^2); 
H=(h.^2)./(h.^2+epsl);