2006-3-11•–––––Sinc––•–––––•––––MATLAB••–––FT–FT–FT-BESSAL–••FT•FT2006-3-12–010x1/2010x1/2)bxx(step0−)1xx(step0−−⎪⎩⎪⎨⎧==0x,00x,210x,1)x(stepfunctiony=step(x)%STEPstepfunction.%%step(x)=0ifx0%=1/2ifx==0%=1ifx0y=(x0).*1;y(find(x==0))=0.5;2006-3-13–⎪⎩⎪⎨⎧−==0x,10x,00x,1)xsgn(%SIGNSignumfunction.%ForeachelementofX,SIGN(X)returns1iftheelement%isgreaterthanzero,0ifitequalszeroand-1ifitis%lessthanzero.ForthenonzeroelementsofcomplexX,%SIGN(X)=X./ABS(X).%Copyright1984-2002TheMathWorks,Inc.%$Revision:5.8$$Date:2002/04/0820:11:24$%Built-infunction.010x010x)bxxsgn(0−)1xxsgn(0−−2006-3-14–⎪⎩⎪⎨⎧≤=,02ax,1)ax(rectfunctiony=rect(t,Tw)%RECTSampledaperiodicrectanglegenerator.%RECT(T)generatessamplesofacontinuous,aperiodic,%unity-heightrectangleatthepointsspecifiedinarrayT,centered%aboutT=0.Bydefault,therectanglehaswidth1.%RECT(T,W)generatesarectangleofwidthW.error(nargchk(1,2,nargin));ifnargin2,Tw=1;end%Returnsunityininterval[-Tw/2,+Tw/2)t=abs(t);y=(tTw/2)*1.0;y(find(t==Tw/2))=0.5;2006-3-15()⎟⎠⎞⎜⎝⎛=→bxbxbrect1limδ0⎟⎠⎞⎜⎝⎛−−⎟⎠⎞⎜⎝⎛+=⎟⎠⎞⎜⎝⎛2step2steprectbxbxbx()()bxbxbxbbbstepsteplimrect1lim00−+=⎟⎠⎞⎜⎝⎛→→()()xdxdxstepδ=2006-3-16–⎪⎩⎪⎨⎧≤−=,0ax,ax1)ax(tri1-aafunctiony=tri(t)%TRISampledaperiodictrianglegenerator.%TRI(T)generatessamplesofacontinuous,aperiodic,%unity-heighttriangleatthepointsspecifiedinarrayT,centered%aboutT=0.%Returnsnon-zeroininterval[-1,+1)t=abs(t);y=zeros(size(t));idx=find(t1.0);y(idx)=1.0-t(idx);2006-3-172D[x,y]=meshgrid(linspace(-4,4,251));z=tripuls(x/3).*tripuls(y/3);imwrite(z,‘tri.jpg');mysurf(x,y,z);DrawTriangle_5.m2006-3-182D[x,y]=meshgrid(linspace(-4,4,251));r=sqrt(x.*x+y.*y);z=tripuls(r/3);imwrite(z,‘cone.jpg');mysurf(x,y,z);DrawCone_6.m2006-3-19–Sincax)axsin()ax(csinππ=functiony=sinc(x)%SINCSin(pi*x)/(pi*x)function.%SINC(X)returnsamatrixwhose%elementsarethesincoftheelementsofX,i.e.%y=sin(pi*x)/(pi*x)ifx~=0%=1ifx==0%wherexisanelementoftheinputmatrixandyistheresultant%outputelement.%SeealsoSQUARE,SIN,COS,CHIRP,DIRIC,GAUSPULS,PULSTRAN,RECTPULS,%andTRIPULS.%Author(s):T.Krauss,1-14-93%Copyright(c)1988-98byTheMathWorks,Inc.%$Revision:1.2$$Date:1998/07/1319:02:12$y=ones(size(x));i=find(x);y(i)=sin(pi*x(i))./(pi*x(i));2006-3-110–⎥⎦⎤⎢⎣⎡π−=2)ax(exp)ax(Gausfunctiony=gaus(x)%GAUSexp(-pi*N*x.*x)function.%Bydefault,theGAUSdis1.y=exp(-pi*x.*x);2006-3-111–⎪⎩⎪⎨⎧≤+=+,0,1)(022022ryxryxcircfunctionz=cyl(x,y,d)%CYLSampledaperiodiccylindricalstep.%CYL(X,Y)generatessamplesofacontinuous,aperiodic,%unity-heightcylinderatthepointsspecifiedinarray(X,Y)%aboutX=Y=0.Bydefault,thecylinderhasdiameter1.%CYL(X,Y)isacylinderofheight1anddiameter1%CYL(X,Y,D)isacylinderofdiameterderror(nargchk(2,3,nargin));ifnargin3,d=1;endr=sqrt(x.*x+y.*y);z=(rd/2)*1.0;z(find(r==d/2))=0.5;2006-3-1121[x,y]=meshgrid(linspace(-4,4,251));r=sqrt(x.*x+y.*y);??z=cyl(x/3,y/3);mysurf(x,y,z);imwrite(z,‘cyl3.jpg');DrawCyl_1.m2006-3-113z=rect(x/3).*rect(y/2);imwrite(z,'ana_rect.jpg');z=cyl(x/3,y/2);imwrite(z,'ana_cyl.jpg');2006-3-114Somb[x,y]=meshgrid(linspace(-4,4,251));r=sqrt(x.*x+y.*y);z=somb(r);mysurf(x,y,z);r=linspace(-4,4,251);z=somb(r);plot(r,z);-4-3-2-101234-0.200.20.40.60.811.2rrrππ)(J2)somb(1=DrawSymbol_2.m2006-3-115functionz=polygon(x,y,p)ifnargin3p=[-10;10;01.5];endn=size(p,1);z=ones(size(x));fori=1:n,u=p(mod(i,n)+1,:)-p(i,:);v=p(mod(i+1,n)+1,:)-p(i,:);if((u(1)*v(2)-u(2)*v(1))0)u=-u;ends=u(1)*(y-p(i,2))-u(2)*(x-p(i,1));z=z.*(s0);endurpiPi+1Pi+2vr(x,y)PDrawPolyGonTriangle_7.m2006-3-116theta=(pi/3)*(0:5);p=[cos(theta')sin(theta')];z=polygon(x,y,3*p);imshow(z);imwrite(z,'hexagon.bmp');[xy]=meshgrid(linspace(-4,4,251));z=polygon(x,y);imshow(z);%??imwrite(z,'triangle.bmp');2006-3-117⎢⎢⎢⎣⎡=δ≠≠=δ∞∞−∫∫1dxdy)y,x(0y0x,0)y,x(––)Nx(Nrectlim)x(N∞→=δ)xNexp(Nlim)x(22Nπ−=δ∞→)Ny(rect)Nx(rectNlim)y,x(2N∞→=δ[])yx(NexpNlim)y,x(2222N+π−=δ∞→)Ny(csin)Nx(csinNlim)y,x(2N∞→=δ)yxN(circNlim)y,x(222N+π=δ∞→22221Nyx)yxN2(JNlim)y,x(++π=δ∞→1yxδ(x,y)0()2006-3-118–),(),(),(0000yxdxdyyxyyxxφφδ=−−∞∞−∫∫()y,xab1)by,ax(δ=δ()()()()000000yy,xxy,xhyy,xxy,xh−−δ=−−δ1/|ab|x=linspace(-4,4,521);z=100*gaus(10000*x);plot(x,z/100);%100(wcywcyjob)2006-3-119[x,y]=meshgrid(linspace(-4,4,251));r=sqrt(x.*x+y.*y);z=gaus((r-2)/0.2);imwrite(z,'ring.jpg');colormap(jet);mysurf(x,y,z);)δ(0rrrr−)δ(0rr−vs.DrawRing_3.m2006-3-120()()()xgfxgfo={}baxxba+=],linear[()()()xlfbaxfo=+()baxxl+=()[]{}xbafbaxf,linearo=+2006-3-121(Comb=)–∑∞−∞==−δn)x(comb)nx(1⎟⎠⎞⎜⎝⎛ττ=⎟⎠⎞⎜⎝⎛−τδτ=τ−δ∑∑∞−∞=∞−∞=xcomb1nx1)nx(nnτ()∑∞−∞=τ−δτ=⎟⎠⎞⎜⎝⎛ττ•n)nx()n(fxcomb1xf2006-3-122MATLABfunctiony=comb(x,p)%combfunction%Perror(nargchk(1,2,nargin));ifnargin2,p=1;endy=1000*gaus(1000000*sin(pi*x/p));x2006-3-123-2-1.5-1-0.500.511.5200.511.5x=linspace(-2,2,401);y=gaus(sin(pi*x)/0.2);plot(x,y,'k','LineWidth',1.5);axis([-2201.5]);gauscombDrawComb_4.m2006-3-124–)y,x(h)y,x(fdd)y,x(h),(f)y,x(g∗=ηξη−ξ−ηξ=∞∞−∫∫––•2006-3-125––)y,x(f)y,x(h)y,x(h)y,x(f∗=∗[])y,x(h)y,x(w)y,x(h)y,x(v)y,x(h)y,x(w)y,x(v∗+∗=∗+[][])y,x(h)y,x(w)y,x(v)y,x(h)y,x(w)y,x(v∗∗=∗∗ηξη−ξ−δηξ=δ∗∞∞−∫∫dd)y,x(),(f)y,