MATLAB: How to complete the fourier Analysis using Matlab

digital signal processingfftfourierfourier transformMATLABplottingsignal processingtransform

Hello !!
I have tried using the Matlab tutorial for FFT and DFT but I'm having extreme difficulty understanding the code and how I can use it in my question. My experience with matlab is only in data manipulation and plotting, so I'm struggling with the concepts.
So here is the question…
To compute the Cn coefficient given by
  • Cn = 1/T * ∫ f(t)*e^(-2*pi*n*t/T) dt,
in which T is the period, and then Amplitude is
  • sqrt(Re(Cn)^2 + Im(Cn)^2)
  • F = n/T
then… how can I plot Amplitude vs Frequency using matlab functions. So far I have this function and req as mentioned above.
  1. f(t) = e^-t from -3 to 3
  2. T = 6
  3. F = -10:1:10
I would like to plot using matlab, but so far I'm doing integral manually and then just iterating values, and plotting them in matlab, can I use fft function or any other function to speed up the process ??
Many thanks
Megh

Best Answer

doc fft
doc fftshift
doc abs
doc angle
doc plot
doc stem
doc xlabel
doc ylabel
doc grid
doc xlim
doc ylim
Related Question