320 CHAPTER 5: Frequency Analysis: The Fourier Transform
%%%%%%%%%%%%%%%%%%%%%
% Example 5.8---Fourier series
%%%%%%%%%%%%%%%%%%%%%
T0 = 1; N = 10; w0 = 2∗pi/T0;
m = heaviside(t)−heaviside(t−T0/2);
m1 = heaviside(t−T0/2)−heaviside(t−T0);
x = t∗m + m1∗(−t + T0); x = 2∗x; % periodic signal
[Xk, w] = fourierseries(x, T0, N); % Fourier coefficients, harmonic frequencies
% Fourier series approximation
for k = 1:N,
if k == 1;
x1 = abs(Xk(k));
else
x1 = x1 + 2∗abs(Xk(k))∗cos(w0∗(k−1)∗t + angle(Xk(k)));
end
end
% sequence of Fourier coefficients and harmonic frequencies
k = 0:N−1; Xk1 = 2∗pi∗Xk; wk = [−fliplr(k(2:N−1)) k]∗w0; Xk = [fliplr(Xk1(2:N−1)) Xk1];
In this case, the Laplace transform simplifies the computation of theXkvalues. Indeed, the Fourier
series coefficients are given by
Xk=
∫0.5
0
te−j^2 πktdt+
∫^1
0.5
( 1 −t)e−j^2 πktdt
which need to be found using integration by parts. n
5.6.3 Parseval’s Energy Conservation
We saw in Chapter 4 that for periodic signals having finite power but infinite energy, Parseval’s theo-
rem indicates how the power of the signal is distributed among the harmonic components. Likewise,
for aperiodic signals of finite energy, an energy version of Parseval’s result indicates how the signal
energy is distributed over frequencies.
For a finite-energy signalx(t)with Fourier transformX(), its energy is conserved when going from the time
to the frequency domain, or
Ex=
∫∞
−∞
|x(t)|^2 dt=
1
2 π
∫∞
−∞
|X()|^2 d (5.15)
Thus,|X()|^2 is an energy density indicating the amount of energy at each of the frequencies.
The plot|X()|^2 versusis called the energy spectrum ofx(t), and it displays how the energy of the signal is
distributed over frequency.