Lab #9:FOURIER SERIES                                                               SSUET/QR/114
LAB # 9
                                        FOURIER SERIES
Objective
        Fourier analysis plays an important role in communication systems. The main objectives
of this experiment are
    1. Generate and plot periodic wave amplitude and magnitude spectrum.
    2. Potting magnitude and phase spectrums for periodic square pulse waves.
Theory
Introduction
A Fourier series is an expansion of a periodic function         in terms of an infinite sum of sine’s
and cosines. Fourier series make use of the orthogonality relationships of the sine and cosine
functions. The Fourier series is a sum of sine and cosine functions that describes a periodic
signal. It is represented in either the trigonometric form or the exponential form.
The usual Fourier series involving sines and cosines is obtained by taking                                   &
             Since these functions form a complete orthogonal system over                         , the Fourier
series of a function     is given by
                                                                                                            (1)
   Any periodic signal can be represented by the sum of sine and cosine series.
   For periodic signals, we use the Fourier series to find the frequency components in a signal.
   Any periodic signal can be expressed as:
                  
    x(t )  a 0   a n cos n 0 t  bn sin n 0 t   where  0  2f 0
                 N 1
            T                       T                                     T
    a0  T1  x(t ) dt ,    an  T2  x(t ) cos n0t dt and    bn    2
                                                                      T    x(t ) sin n t
                                                                                        0    dt
            0                       0                                     0
CE -302:Signals and Systems                                                                        1
Lab #9:FOURIER SERIES                                                                SSUET/QR/114
Amplitude and phase
   The exponential Fourier representation of these signals is given as:
                
               d n e jn0t
                                                           T
 x (t )                                               1
                                                            x(t )e
                                                                       jn0t
                                         and      dn                           dt
             n                                      T   0
Example 9.1
       The “half-sinusoidal” waveform shown in the figure below represents a voltage response
        of a circuit. Find the Fourier series of this signal and plot the amplitudes for different
        frequency components.
                                        2Vm   cos(n / 2)
       The final expression is a n                     n  1 and for n  1, take the limit tends to 1
                                               1  n2
        for this expression. Also note that bn  0 because the function v (t ) is an even function.
CE -302:Signals and Systems                                                                      2
Lab #9:FOURIER SERIES                                                             SSUET/QR/114
        Note that in this example, we are not going to directly use this expression. Instead, we are going
         to evaluate this expression.
        Also we are going to see that how bn  0 without using the symmetric properties of the original
         signal.
        From you lecture notes, we have seen that : v(t )  Vm cos 5t for  0.1  t  0.1
    0              for 0.1  t  0.3
        The following program finds a0  C0 , an  C n and bn  0  n  0 or   .
        Assume Vm  2 .
Program
syms anbnnvtCnC0
%initialization
T0 = 0.4;
f0 = 1/T0;
Vm = 2;
n = [1:5]
v = Vm*cos(2*pi*f0*t)          %Actual signal
%a0,bn and an formulas for periodic signals
a0 = (1/T0)*int(v,t,-0.1,0.1)
bn = int ( (2/T0)* v * sin(n*2*pi*f0*t) , t , -0.1,0.1 )
an = int ( (2/T0)* v * cos(n*2*pi*f0*t) , t , -0.1,0.1 )
C0 = a0
Cn = ( (an.^2) + (bn.^2) ).^0.5
Cn_values = [eval(C0), eval(Cn)]
plot([0,n],Cn_values,'r')
hold on
stem([0,n],Cn_values,'k')
hold off
%Another plot with negative values indicating the phases
an_values = [eval(a0), eval(an)]
figure
plot([0,n],an_values,'r')
hold on
stem([0,n],an_values,'k')
hold off
%==== Try different n,f0,Vm values of this example.====
CE -302:Signals and Systems                                                                     3
Lab #9:FOURIER SERIES                                                 SSUET/QR/114
clear all
Example 9.2
    1. A periodic square wave of amplitude V 0 and period T with pulse duration of  can be
       shown below:
    2. The Fourier representation of a rectangular pulse is sinc function.
    3. It has infinite frequency components. This means that it has infinite BW.
    4. When the pulse duration equals to half signal duration, then only odd harmonics
       (frequencies) are present.
    5. It can be verified that for such waveforms:
             V0
     dn         sin c( 12 n0 )e  jn0 (t0  / 2)
              T
    6. It is obvious that d n  d n e  jn .
    7. Different spectrum plots can be used to see the behavior of such waveforms in frequency
       domain.
    8. By adding the Harmonics with their corresponding amplitudes and phases together is
       going to give us the original (approximate) square wave. Use the compact form to find
       these harmonics:
                    
     x(t )  C 0   C n cos( n 0 t   n )
                   N 1
    where Cn  2 d n .
Program
V = 1;
T = 0.5;
Tp = 0.2;
F = 1 / T;
CE -302:Signals and Systems                                                       4
Lab #9:FOURIER SERIES                                           SSUET/QR/114
To = 0
n = [-10:10]
dn1 = ( ( V * (Tp / T)) * sinc (0.5 * n * 2 * pi * F * Tp) )
dn2 = exp ( -j * n * 2 * pi * F * (To + (0.5 * Tp) ) )
dn = dn1 + dn2
dn_value = ( V * Tp / T ) * sinc ( 0.5 * n * 2 * pi *F * Tp )
dn_mag = abs (dn)
dn_ang = angle (dn)
stem(n,dn_ang);
figure;
stem (n,dn_mag);
hold on
plot (n,dn_mag,'r');
hold off
figure
stem (n,dn_value);
hold on
plot (n,dn_value,'r');
hold off
Cn = 2 * dn_value;
Cn_value = abs (Cn);
figure
stem (n,Cn_value);
hold on
plot (n,Cn_value,'r');
hold off
CE -302:Signals and Systems                                                5
Lab #9:FOURIER SERIES                                                  SSUET/QR/114
                                 LAB ACTIVITY
Task 1: Calculate the Fourier transform of Sine wave with unit amplitude and frequency.
      Consider any constant value for ω and the range of t is 0 ≤ t ≤ 100.
Task 2: Calculate the magnitude and phase response of above signal (i.e. signal in task 1) and
      also plot them.
CE -302:Signals and Systems                                                        6