Signals&Systems Laboratory 2013/2014
Fourier Series. Signal expansion and synthesis.
Consider a periodic signal x(t) with period T. If some conditions (see Dirichlet conditions from lecture book) are satisfied, the function (signal) x(t) can be expressed as series:
Coefficients of the trigonometric Fourier series may be calculated from the following relations:
where t0 is any real number.
Formula (1) can be also expressed in more convenient equivalent form:
Cosine terms in (1) and (5) are called harmonic (n-th harmonic has amplitude, phase and angular frequency , constant term (2) is the 0-th harmonic. First harmonic:
is called usually basic harmonic with angular (basic) frequency . The plot of amplitude An i terms of n is called amplitude spectrum and plot of phase as a function of n is called phase spectrum. Amplitudes and phases may be calculated from the relations:
The periodic signals are often presented in more compact form called exponential Fourier series:
Relations between different Fourier series forms are specified as follows:
Similarly, the plot of versus n is called the amplitude spectrum and the plot of versus n is called phase spectrum. Note, that following relationships are valid:
How to compute coefficients.
The amplitude and phase spectra, based on formulas (5) or (10) can be computed by use of Matlab integration formulas like:
int(expr,var,a,b)- computes the definite integral of expr with respect to var from a to b.
More often, Fourier series computations are performed numerically using the Discrete Fourier Transform (DFT), which in turn is implemented numerically using an efficient algorithm known as the Fast Fourier Transform (FFT). Assuming, that sampling frequency used for discretization of the periodic function interval is equal to fs (samples per second) and applied DFT transform has N-elements, basic harmonic of the Fourier series may be calculated from he formula:
Frequence of the next stripes of Fourier series spectrum are of the form:
Constant term and amplitudes of the harmonics (up to i=N/2) of the Fourier series having form(5) follows the relations:
Phases of the harmonic are computed from the arguments (command angle)of Xn.
As an illustration, the following code (core of the m-file) shows how to use fft approach to obtain Fourier expansion coefficients. You can study this code and further enhance it to complete your work.
%N==> dlugosc transformaty DFT (Length of DFT)
%T==> czas pomiaru (wielokrotnosc okresu?) (oservation time, suggested:multiplicity of the period T)
y1=feval(fun,t1); %function 'fun' after disretization for DFT
ya=feval(fun,ta); %function 'fun' after discretization enabling to print analog curve
function y=synth(T,N,Amp,faza,x); %
Useful Matlab functions: fft(x,N), length(), abs, angle, stem figure, xlabel, ylabel, title.
Numerical calculations may be performed also by Simulink models (available only in Matlab 5.3 installation). Exemplary scheme is shown in Fig.1
Fig.1. FFT based algorithm for finding harmonic’s coefficients – Simulink implemetation.
For given set of periodic signals calculate Fourier series coefficients (for all three forms) using
FFT-based method - Matlab script (open Matlab 5.3) delivered by your teacher (from website).
Numerical integration (Symbolic Toolbox from Matlab 2013b)
Find Fourier expansions (approximations) in the form (1) , (5) and (9). Complete Table with coefficients, plot spectra. Discuss the coefficients of various Fourier series in relation to the symmetry of the signal.
Observe the Gibbs phenomena (changing number of synthesized harmonics). Briefly explain!
Observe, what happens, if the sampling period Ts is not an integer multiplicity of the signal period T.
Exemplary m-file enabling us to calculate (and plot) Canonical Fourier Series Coefficients
% Plotting the Fourier Series Coefficients
% Współczynniki kanonicznej postaci Szeregu Fouriera
syms t k n
x=triangle1(t); % funkcja zawierająca opis sygnału (function containing signal description)
title('Canonical Fourier Series Coefficients: Amplitude An')
title('Canonical Fourier Series Coefficients: Phase theta_n')