PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

376 Practical MATLAB® Applications for Engineers


R.4.134 To conclude, let us discuss the reason for having defi ned and used two very similar
transforms, the FTs and LTs in this chapter.


Observe that both transforms basically state the same mathematical relation.
Both are obtained by integrating over time f(t) multiplied by an exponential raised
to a negative time complex frequency. Recall that for Laplace’s case f(t) is multiplied
by e−st (where s is complex), and the reason is that the convergence of the Fourier
integral is enhanced, meaning that the LT may exist for many functions for which
there is no FT. This is one of the main advantages of the LT, the ability to transform
functions which are not otherwise transformable by means of Fourier.
In addition, Laplace incorporates the initial conditions in the evaluation of its
transform and provides a more complete system model representation, in which
information in the frequency domain are directly related to the time domain, as is
the case of the initial and fi nal value theorems.


4.4 Examples


Example 4.1

Let the FS expansion of a periodic square wave be given by

ft
n

nw t
n

() ( )


217
^0
odd

∑ sin


where the period is T = 2 s, and the fundamental frequency is w 0 = 2 π/T = π.
Create the script fi le square_Fourier that returns the following plots, over the range
0 ≤ t ≤ 4:
a. The fi rst four nonzero Fourier components of f(t) versus t (for n = 1, 3, 5, 7) on
separate plots
b. The components of part a on one plot (indicating the phase, frequency, and ampli-
tude relations)
c. Successive partial approximation sums of the FS expansion on separate plots
d. Successive partial sums of the FS expansion on the same plot
e. The errors(t) versus t for each one of the approximations (sums) of part c

MATLAB Solution
% Script file: square _ Fourier
% Harmonic Analysis of a square wave by a Fourier Series
% approximation, fundamental frequency wo=pi
echo off;
T = 2;
w0 = 2*pi/T;
t = 0:.01:2*T;
% Harnonics are generated below
Harmonic _ 1 = 2/pi*sin(w0.*t);
Harmonic _ 3 = 2/(3*pi)*sin(3*w0.*t);
Harmonic _ 5 = 2/(5*pi)*sin(5*w0.*t);
Harmonic _ 7 = 2/(7*pi)*sin(7*w0.*t);
Free download pdf