# # > restart; > #Here we define several functions with support in the interval [-1,1]. > f0 := x->piecewise(x>-1 and x<1, 1, 0); > f1 := x-> piecewise(x>-1 and x<1, (1-x^2), 0); > f2 := x-> (f1(x))^2; > #We plot the functions defined above. f0 has a jump discontinuity, f1 > is continuous and f2 is once differentiable. > plot([f0(x), f1(x),f2(x)],x=-2..2); > #We can use maple to symbolically integrate and find the Fourier > transforms of the functions defined above. > int((1-x^2)*exp(-I*x*y),x=-1..1); > int((1-x^2)^2*exp(-I*x*y),x=-1..1); > #Using these formulae we define the functions g and h. They are the > Fourier transforms of f1 and f2 respectively. This is a much more > efficient way to work than to define the function in terms of the > integral. > g := y-> piecewise(y=0,4/3, 4*(sin(y)-y*cos(y))/y^3); > h := y-> piecewise(y=0, 16/15, > 16*((3*sin(y)-3*y*cos(y)-y^2*sin(y))/y^5)); > # We plot the Fourier transforms. The slowest decaying graph is the > F.T. of f0 the middle one is the F.T. of f1 and the fastest decaying > graph is the F.T. of f2. Note how smoothness of a function translates > into decay of its Fourier transform. > plot([2*sin(y)/y,(3/2)*g(y), 15/8*h(y)],y=-40..40,discont=true); > #In the next formula we define the partial Fourier inverse of g: > instead of integrating from -infinity to infinity, we integrate from > -R to R. > F := (R,x) -> int((4/Pi)*(sin(y)-y*cos(y))/y^3*cos(x*y),y=0..R); > #We plot the partial Fourier inverse for several values of R along > with the graph of f1. The partial inverse quickly does a good job away > from x=1. > plot([F(5,x),F(10,x),F(15,x),F(20,x),f1(x)],x=0..2); > #Here we check things outside the interval [-1,1]. Note that the > partial Fourier inverses oscillate around the true value of zero. > plot([F(5,x),F(10,x),F(15,x),F(20,x)],x=10..15); > with(plots): > #In the next line we look at the Fourier transform of the function f1 > translated by different amounts. The animation shows the F.T. of > f1(x-t) for $t=0,1,...,20. > animate({cos((t/4)*y)*g(y),-sin((t/4)*y)*g(y)},y=-10..10,t=0..20,numpo > ints=200);# > #Here we examine the effect of scaling a function on its Fourier > transform. The next animation shows the Fourier transforms of the > functions f1(t*x) for t=1/4, 2/4,...5. Note that the peak goes down as > t increases. > animate(4*g(t*y/4)/t,y=.01..10,t=1..20); > #To see better what is happenning in the previous example, we rescale > so that all the functions take the same value at zero. These are the > Fourier transforms of the functions t*f1(t*x) for t in the same range > as before. > animate(4*g(t*y/4),y=.01..10,t=1..20); > #Try these routines out with functions of your own design! > >