www.pudn.com > shearlet.rar > smooth.m, change:2010-01-01,size:978b


function f=smooth(x,lb,ub,h) 
% function: 
%        shearlet 
% input: 
%        x: (lb,ub); 
%        h: S(a,b),smooth function with compact support; 
%        [lb,ub]: the bound of interval. 
% output: 
%        f:; 
% Call: bump 
%---------------------------------------- 
% Principle:  f:S(a,b)=> int(f,a,x):S-type 
% Application: construct smooth funciton S-type 
% Attention: x in [lb,ub] 
% Example:  
% See also bump 
%---------------------------------------- 
% Designer: function 
% Date: 10-Sep-2009 
 
if nargin<=3,h=@bump;          % default bump function 
    if nargin<=1 
        lb=-1;ub=1; 
        if nargin==0 
            x=linspace(lb,ub,100); 
        end 
    end 
end 
I=quad(h,-1,1);                % I 
 
[Mx,Nx]=size(x); 
for(i=1:Mx) 
    for(j=1:Nx) 
        xij=x(i,j); 
        if xij<=lb,f(i,j)=0; 
        elseif xij>=ub,f(i,j)=1; 
        else 
            f(i,j)=quad(h,-1,2*(xij-lb)/(ub-lb)-1)/I;  % S-type function 
        end 
    end 
end