Synthesis Equation Analysis Equation

Final Project Fall 2021 Part 1: Fourier Series Analysis of the Signal
Explaining FFT in Matlab
Synthesis Equation Analysis Equation
Continuous Time Fourier Series
𝒙(𝒕) = 𝒙(𝒕 + 𝑻)
= βˆ‘ π’‚π’Œπ’†π’‹π’Œ(
πŸπ… 𝑻 )𝒕
+∞
π’Œ=βˆ’βˆž
π’‚π’Œ = ∫ 𝒙(𝒕)π’†βˆ’π’‹π’Œ(
πŸπ… 𝑻 )𝒕𝒅𝒕
𝑻
Discrete Time Fourier Series
𝒙[𝒏] = 𝒙[𝒏 + 𝑡]
= βˆ‘ π’‚π’Œπ’†π’‹π’Œ(πŸπ…/𝑡)𝒏 π’Œ=<𝑡>
π’‚π’Œ =
𝟏 𝑡
βˆ‘ 𝒙[𝒏]π’†βˆ’π’‹π’Œ(
πŸπ… 𝑡 )𝒏
𝒏=<𝑡>
In Matlab, there are commands fft(x) and ifft(X) that performs Discrete Fourier Transform (DFT) and inverse DFT.

  1. Unfortunate naming history: DFT is NOT DTFT (discrete time Fourier Transform). It is rather a numerically method that performs fast Fourier Transform (fft) so that Fourier Series coefficient of a (periodic) signal (sequence) can be obtained. We can thus use these commands to compute π’‚π’Œ with the given the x[n].
  2. In MATLAB a signal can only be stored in discrete in nature. So the analysis is based on Discrete Time Fourier Series (DTFS) analysis.
  3. In MATLAB DFT analysis, we treat the signal duration N as the fundamental period. So fundamental frequency or frequency resolution is given by πœ”π‘Ÿ Μ‚ = 2πœ‹ 𝑁 or 𝑓 π‘Ÿ Μ‚ = 1 𝑁 .
  4. In MATLAB a vector starts with index 1.
  5. Fourier Series coefficients are periodic with N, and Matlab outputs N coefficients. You can use one-sided spectrum (take the first 𝑁/2) or two-sided spectrum (the last 𝑁/2 coefficients are the same as the negative frequencies’ coefficients). You can use command fftshift for the purpose of re-arranging needed in two-sided spectrum representation.
  6. The scaling definition in MATLAB is not the same as how we define our FS coefficients (see table) for a discrete time sequence. So, you must take care of the scaling for fft and ifft to match the definition in the table.
  7. To conveniently plot the two-sided spectrum, we provide fdomain.m and tdomain.m. The script fdomain.m is a function that takes a time-domain sequence, and output/plot
    the two-sided spectrum of the signal in the frequency domain. The script tdomain.m can be used to reconstruct the time domain sequence from a given set of coefficients.
    function [X,f]=fdomain(x,Fs) % FDOMAIN computes the Fourier coefficients from vector x % and the corresponding frequencies (two-sided) % usage: [X,f]=fdomain(x,Fs) N=length(x); if mod(N,2)==0 k=-N/2:N/2-1; % N even else k=-(N-1)/2:(N-1)/2; % N odd end T=N/Fs; f=k/T; %create a vector for two sided frequencies (for the given resolution) X=fft(x)/N; X=fftshift(X);
  8. DFT/FFT implies the periodic assumption during the analysis. In order to avoid artificial frequency due to discontinuity of the beginning of the data and end of the data, a window often times are multiplied to taper off the large jump in the edge. A Hanning window is a commonly used window [2]. You may want to use this in your data spectrum analysis.
    w = hann(L)
    w = hann(L) returns an L-point symmetric Hann window in the column vector w. L must be a positive integer. The coefficients of a Hann window are computed from the following equation.
    𝑀[𝑛] = 0.5(1 βˆ’ cos(2πœ‹
    𝑛 𝑁 )) 0 ≀ 𝑛 ≀ 𝑁
    The window length is L=N+1.
    Additional References: (1)https://www.mathworks.com/help/matlab/ref/fft.html?searchHighlight=fft&s_tid= doc_srchtitle (2) https://www.mathworks.com/help/signal/ref/hann.html
    (3) https://www.mathworks.com/help/signal/windows.html
× How can I help you?