0% found this document useful (0 votes)
52 views1 page

3.6 Fourier Analysis MATLAB Laboratory Experiment: FIGURE 3.18: A Square Wave Signal

This document describes a MATLAB experiment to analyze periodic signals using Fourier series approximations. It involves plotting Fourier series approximations of a square wave signal with increasing numbers of terms to observe the Gibbs phenomenon. It also involves using MATLAB functions to plot the frequency spectra of the signal and the response of a system to the periodic input signal. The purpose is for students to observe Fourier series approximations and Gibbs phenomenon, as well as analyze system frequency response characteristics.

Uploaded by

Deva Ragu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views1 page

3.6 Fourier Analysis MATLAB Laboratory Experiment: FIGURE 3.18: A Square Wave Signal

This document describes a MATLAB experiment to analyze periodic signals using Fourier series approximations. It involves plotting Fourier series approximations of a square wave signal with increasing numbers of terms to observe the Gibbs phenomenon. It also involves using MATLAB functions to plot the frequency spectra of the signal and the response of a system to the periodic input signal. The purpose is for students to observe Fourier series approximations and Gibbs phenomenon, as well as analyze system frequency response characteristics.

Uploaded by

Deva Ragu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

3.

6 Fourier Analysis MATLAB Laboratory Experiment


Purpose: This experiment demonstrates approximations of periodic signals by truncated Fourier series as defined
in formula (3.4). Using MATLAB students will plot the actual approximate signals and observe, for large values
of N , the Gibbs phenomenon at the jump discontinuity points. In addition, students will use MATLAB to plot the
system frequency spectra, and to find the system response due to periodic inputs.
Part 1. Find the trigonometric form of the Fourier series for the periodic signal presented in Figure 3.18.
Take E = 1; T = 1 and use MATLAB to calculate the coefficients of the Fourier series for n = 0; 1; 2; :::; N . Plot
the approximations xN (t) as defined in (3.4) for N = 5; 10; 20; 30; 40; 50. Observe the Gibbs phenomenon and for
N = 50 estimate the relative magnitude of ripples at the jump discontinuity points.
x(t)
E

. . . . . .

-T -T/2 -T/4 0 T/4 T/2 T t

FIGURE 3.18: A square wave signal

Part 2. Use MATLAB to plot the amplitude and phase line spectra of the periodic signal from Part 1.
Part 3. Plot the magnitude and phase spectra of the system defined in Example 3.19 by using the MATLAB
function freqs(num,den), where the vectors num and den contain the coefficients of the transfer function
numerator and denominator in descending order.
Part 4. For the system defined in Example 3.19, and xN (t) determined in Part 1 with E = 5; !0 = 1 rad=s,
calculate the Fourier series coefficients of the output signal for n = 0; 1; 3; 5. Print the values for the magnitudes
of the Fourier series coefficients of the output signal. Plot the approximations xN (t) and observe the convergence
of the output signal as N increases. Take N = 1; 3; 5 and t 2 [0; 4]. Comment on the frequency of the output
signal and check its value from the plot obtained.
Submit all plots and comment on the results obtained.
SUPPLEMENT:
1
xN (t) = a0 +
XN [a cos (n!0 t) + b sin (n!0 t)]
n n (3.4)
2
n=1
The system in Example 3.19 is defined by

d2 y(t) dy(t)
+2 + 3y ( t) = x(t)
dt2 dt

MATLAB Progam
% Experiment 3
%
% PART 1
%
% Hint: The program for Example 3.1 and Figure 3.3 can be downloaded
% from the textbook webpage and appropriately modified
t=-1.5:0.01:1.5; w0=2*pi; E=1; a0=1;
% Since the signal is even its bn coefficients are zero
% Approximation with 5 harmonics
N=5; xN=a0/2;
for n=1:N
an=(E/(n*pi))*(sin(n*pi/2)-sin(n*3*pi/2));

11

You might also like