Universidad Tecnológica de Bolívar: e A T X
Universidad Tecnológica de Bolívar: e A T X
Universidad Tecnológica de Bolívar: e A T X
SIGNALS & SYSTEMS
LAB 3. Fourier transforms
Objectives
By the end of this laboratory assignment, you should be able to:
Compute the Fourier series coefficients with MATLAB.
Compute the continuous‐time Fourier transform with MATLAB and analyze its
properties.
Background
Much of the signal processing, communication and control systems analysis relies upon
frequency analysis of signals and systems. Frequency response, bandwidth, and filtering
are all concepts based on the idea that a signal can be thought of as comprising sinusoidal
components at different frequencies.
Traditional frequency analysis uses two basic transforms: the Fourier series, for periodic
waveforms, and the Fourier transform, for non‐periodic waveforms. In both cases the
information from a signal is converted to a frequency‐domain representation; instead of
representing the information in the signal as a function of time, it is represented as a
function of frequency. Being transforms, no information is created or lost in the process,
so the original signal can be recovered from knowing the Fourier transform, and vice
versa.
What does plotting the signal content as a function of frequency tell us? In a broad sense,
it tells us at what frequencies the signal has energy, just as a prism visually shows the
colors – frequencies – present in a light source, or a stereo spectrum analyzer shows the
relative loudness of tones in a musical piece. In this lab we investigate how to evaluate the
Fourier spectrum of a signal.
Fourier series
A periodic signal x(t) can be represented by an exponential Fourier series as follows:
2
xt ak e
j kt
T
k (1)
Where T indicates the period of the signal and ak are called Fourier series coefficients,
which, in general, are complex. To obtain those coefficients, we can use the following
expressions:
UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
2
1 j
xt e T dt
kt
ak
TT
(2)
1
xt dt
T T
a0
(3)
Fourier transform
The continuous‐time Fourier transform of a non‐periodic signal x(t) is given by:
X j xt e
jt
dt
(4)
In contrast to a periodic signal, the amplitude and phase spectra of a non‐periodic signal
consist of a continuum of frequencies. Note that the Fourier transform is a function that
depends only on frequency: = 2f [rad/sec].
The signal x(t) can be recovered from X(j) via the inverse transform equation:
1
xt X j e
jt
d
2 (5)
Some of the properties of the Fourier transform are listed in table 1.
Table 1. Properties of Fourier transform
Linearity Ax(t) + By(t) AX(j) + BY(j)
Time Translation x(t ‐ t0) e jt0 X j
Scale Change x(at) 1
X j a
a
Frequency Translation e j0t xt X(j‐0)
Time Differentiation d xt
n
(j)nX(j)
dt n
Integration 1
X j
t
x d
j
Time Convolution x(t) * h(t) X(j)H(j)
UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
Procedure
Part 1. Fourier series.
The Fourier series coefficients of a periodic signal can be calculated in MATLAB using the
function fft (Fast Fourier Transform). To do that, we have to extract a single period of
the signal.
3
x(t)
-1
-4 -3 -2 -1 0 1 2 3 4
time (sec)
Figure 1. Signal x(t)
1. Generate and plot the signal x(t) in Figure 1 for 0 < t < 10 with MATLAB using the
function sawtooth(2*pi*f0*t). Use a sampling rate of 1000 Hz to define the
time variable. Make sure that the signal resembles the wave‐shape in Figure 1. The
fundamental frequency of the signal is the inverse of its period: f0 = 1/T.
2. Extract a single period of the signal and save it in a new variable: x1. Calculate the
Fourier series coefficients as follows:
N=length(x1);
X=fft(x1)/N;
3. Plot the magnitude and phase of the first 11 coefficients using the function stem:
subplot(211)
stem([0:10],abs(X(1:11))),xlabel(‘k’),ylabel(‘|a_k|’)
subplot(212)
stem([0:10],abs(X(1:11))),xlabel(‘k’),ylabel(‘Phase’)
4. Use equations 2 and 3 to calculate the Fourier series coefficients of the signal.
Evaluate the first three coefficients (for k = 0, 1 and 2). Compare with the results given
by MATLAB. Are they the same?
UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
Part 2. Fourier transform.
The MATLAB symbolic math toolbox can be used to compute the Fourier transform of a
signal. There are MATLAB commands for computing both the Fourier transform and the
inverse Fourier transform, fourier(f) and ifourier(F), where both f and F are
symbolic objects that have been defined. These commands use the function int that
calculates the integrals given in equations (4) and (5) respectively. As an example, consider
a decaying sinusoid of the form:
yt e at sinbt u t
Figure 3 displays y(t) for the case a = 2, b = 10.
0.5
y(t)
-0.5
-1
-1 -0.5 0 0.5 1 1.5 2 2.5
time (sec)
Figure 3. Signal y(t)
The following commands can be used to determine the Fourier transform of y(t):
syms y t Y w
a=2; b=10;
y=exp(-a*t)*sin(b*pi*t)*heaviside(t);
Y=fourier(y);
pretty(Y)
5. Define the following signals as symbols and plot them using the command ezplot.
x1 t te 2t u t
UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
x3 t 3t ut ut 2 6 ut 2 ut 6 2t 18 ut 6 ut 9
6. Compute the Fourier transform of the signals from the previous problem using the
command Fourier.
7. Graph the magnitude |X()| and phase X() of the Fourier transforms from the
previous exercise using the function freqs(B,A). You have to provide the
coefficients of the polynomials in the numerator and denominator of the Fourier
transform.
8. Perform the following operations on the signals and plot their Fourier transforms.
Compare the results with the transforms of the original signals.
Multiply the first signal by any positive constant different than zero.
Shift the second signal in time to obtain x(t‐1).
Change the scale of the third signal to obtain x(2t).
Analysis
Observe the graph of the Fourier coefficients in numeral 3 and answer the following
questions:
o What is the DC value of the signal?
o What is the coefficient that has more energy?
o What are the magnitudes of the first and second harmonic?
Analyze the graphs of magnitude and phase of the Fourier transform from exercise 7
and answer the following questions:
o What frequency or frequencies have more energy?
o What is the maximum value of the magnitude of the Fourier transform?
o What is the general shape of the phase?
Describe the changes in the magnitude and phase of the Fourier transforms after the
operations in exercise 8. Verify that your results agree with the properties in table 1.
o Multiplication by a constant.
o Time shifting.
o Time scaling.