1. Use MATLAB to calculate the Fourier transform of f(x)=[cos(6x)+sin(7x)]ex2 on the interval [−20,20] with 4096 evenly spaced points.
2. Plot f(x) on [-2,2] and the real and imaginary parts of the Fourier transform g(y) on [-7,7].
3. The Fourier transform can be approximated using the discrete Fourier transform (DFT) by defining f(x) on evenly spaced points and relating g(y) to a sum involving f(x) and complex exponentials.
please use MATLABplease use MATLABplease use MATLA.pdf
1. please use MATLAB!!!!!please use MATLAB!!!!!please use MATLAB!!!!!please use MATLAB!!!!!
please provide a neatly code!!!!!
please provide detailed explanation!!!
Q1. For a function f(x), its Fourier transform can be defined as g(y)=f(x)ei2xydx Use FFT, calculate
(approximately) the Fourier transform of f(x)=[cos(6x)+sin(7x)]ex2 Suggestions: Truncate x to [L,L)
for L=20 with N=2m=4096 points, truncate y to [m/(2L),(m1)/(2L)] with also 2m points, plot f(x) on [
2,2] and plot real and imaginary parts of g on [7,7]. Hints: We need to approximate the integral
relation and write it to something like Eq. (5) of lecture note. Define xj=jL/m for j=m,m+1,,0,1,,m1,
define yk=k/(2L) for k=m,m+1,,m1. Notice that xjyk=jk/(2m)=jk/N. We can approximate g(y) as g(yk
)=mLj=mm1f(xj)ei2xjyk=mLj=mm1f(xj)ei2jk/N,k=m,m+1,,m1. The above is somewhat similar to Eq.
(5) of the lecture note, but the ranges for j and k are different. For DFT, we should have indices
from 0 to N1. Now, suppose j is negative, we can add N to it and define j+N as the new j. Notice
that since ei2k=1 for any integer k, we have ei2jk/N=ei2(j+N)k/N. Similarly, for a negative k, we
can replace it by k+N. This implies that if we can define f~=f~0f~1f~2f~N1=f(x0)f(x1)f(xm1)f(xm)f(x
2)f(x1),g~=g~0g~1g~2g~N1=g(y0)g(y1)g(ym1)g(ym)g(y2)g(y1) then g~k=mLj=0N1f~jei2jk/N,k=0,1
,,N1