Signals & Systems

Fourier Series Example #2

Problem Statement

A periodic pulse train has a fundamental period of T0 = 8 seconds and a pulse width of 2 seconds. The fundamental frequency is w0 = pi/4 = 0.7854 rad/sec. Three periods of the signal are shown in the figure. The amplitude of the signal is 1 during the pulse width and 0 elsewhere. Since the signal is periodic, it repeats itself for all time in both directions.
Periodic Signal x(t)

Since x(t) is periodic and satisfies the Dirichlet conditions, it can be represented by a Fourier series. Since the signal is not a pure sinusoidal signal, the Fourier series will consist of an infinite sum of sine and/or cosine terms. It is clear from the graph of x(t) that the average value of the signal is positive, and that the signal does not contain symmetry (even, odd, or half-wave odd).

Calculating the Trig Coefficients

All three forms of the Fourier series (trig, cosine, and exponential) will be computed, beginning with the trig form. Because of the definition of x(t), computation of the a0, an, and bn coefficients will only require integration from t = 0 to t = 2 seconds. The trignometric form of the Fourier series is given by

The expression for a0, the average value of the signal, is

The expression for the an coefficients is:

Thus, the an coefficients will be 0 for all even values of n and non-zero with alternating signs for odd values of n. The expression for an can be written in an alternate way as

The expression for the bn coefficients is

The bn coefficients will be 0 whenever cos(n*pi/2) = 1, which occurs for n = 4, 8, 12, 16, иии.

Approximating x(t) with Partial Sums of Fourier Series Terms

The complete Fourier series representation of a signal requires an infinite number of terms in general. When the complete series is used, the series converges to the exact value of the signal at every point in time where the signal is continuous and converges to the midpoint of the discontinuity wherever the signal is discontinuous. 

The signal x(t) can be approximated by using a truncated form of the Fourier series, that is, stopping the summation after a finite number N of terms. The approximation may be 'good' or 'bad' in a subjective sense, but it will be the best approximation for a given N in terms of minimizing the mean squared error between the approximation and the actual signal. The approximation is given by

The next figure shows the approximations to the x(t) in this example for N = 10, 30, 50. The figure shows clearly that as the number of terms increases, the approximation becomes better. The transitions between the two amplitude values become steeper and the magnitudes of the oscillations become smaller for the larger values of N. An interesting point to note in the graphs is that the magnitudes of the oscillations just before and just after the discontinuity do not decrease. In fact they increase slightly with our values of N from approximately 7.3% to 8.4% to 8.6% of the pulse height for the values of N = 10, 30, 50. The magnitude of the overshoot will eventually approach a value of 9% of the pulse height. This is known as the Gibbs phenomenon.
Approximations to x(t)

When plots of the an and bn coefficients are examined, it is seen that magnitudes of the coefficients drop off rapidly with increasing harmonic number n, particularly for an. Most of the energy in x(t) and the general shape of the signal come from the lower frequency terms. The high frequencies refine the curve in terms of making the transitions steeper. The (red) vertical dashed lines in the plots of the an and bn coefficients show the coefficients used in the three approximations presented before. To the left of the first vertical line are all the terms included in the partial sum for N = 10.  Between the two vertical lines are the 20 additional terms added to the partial sum for N = 30.  To the right of the second vertical line are the 20 additional terms added to the partial sum for N = 50.

Plotting the Single-Sided Spectrum from the Cosine Series

The frequency spectrum of x(t) can be easily plotted by converting the trig version of the Fourier series into the cosine form. This allows the magnitude and phase of each frequency component to be readily visible. The expressions for magnitude and phase in the cosine form are

Since an takes on negative values, care must be used when computing the phase angle in a computer or calculator using the atan function. Whenever an < 0, pi radians or 180 degrees must be added to the answer returned by the atan function. It is easier and safer to use the atan2 function if it is available. The syntax for the atan2 function for this problem is thetan = atan2(-bn, an).

The single-sided magnitude and phase spectra are shown in the next figure. The independent variable in each of the plots is frequency in rad/sec. Since x(t) is periodic, all the frequencies in the signal are integer multiples of the fundamental frequency w0 = 0.7854 rad/sec. The magnitude is seen to generally decrease with increasing frequency. This indicates that the higher frequency terms contribute less and less to the construction of x(t). The phase follows a periodic pattern, repeating itself after every four terms.
Single-Sided Magnitude and Phase Spectra

Plotting the Double-Sided Spectrum from the Exponential Series

 The complex exponential form of the Fourier series is derived from the trig form by making use of the Euler relations between sine and cosine functions and the complex exponential function

The complex exponentials provide a more convenient and compact way of expressing the Fourier series representation of x(t) than either the trig or cosine forms. It also allows the magnitude and phase spectra to be easily calculated. It does, however, introduce negative frequencies into the representation, which were not present in either of the other two forms. The expressions for the complex exponential form are given by

These equations show that x(t) is represented in the complex exponential form by terms taking on all integer multiples of w0, negative as well as positive. The magnitude spectrum has even symmetry, with the magnitudes in this form being one-half the magnitudes in the cosine form (except at 0 frequency, where they are equal). The phase spectrum has odd symmetry. At positive frequencies, the phases in the complex exponential form have the same values as the phases in the cosine form. At negative frequencies, the phases have the opposite signs as they do at positive frequencies. The next figure shows the double-sided spectra for this example, and the symmetry properties of the spectra are easily seen.
Double-Sided Magnitude and Phase Spectra

MATLAB Code

Click the icon to return to Dr. Beale's home page

Latest revision on Thursday, May 18, 2006 10:54 PM