PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Time Domain Representation of Continuous and Discrete Signals 75


disp(energyfodd)
disp(‘ (in joules)’)
disp(‘*********************************************’)
disp(‘*********************************************’)
plot(t,check);
title(‘[feven(t) + fodd(t)] vs. t )’);
a xis([-10 10 -5 15]);xla bel(‘time’);
ylabel(‘Amplitude [feven(t) + fodd(t)]’)

Back in the command window the script fi le even_odd is executed and the results are
shown as follows and in Figures 1.61 and 1.62.

>> even _ odd

*************************************************
************** ENERGY ANALYSIS *****************
*************************************************
The energy of f(t) =
838.3500
The energy of feven(t) =
796.6750
The energy of fodd(t) =
41.6750
(in joules)
*************************************************
*************************************************

FIGURE 1.61
Plots of even and odd parts of f(t) of Example 1.14.

10
5

0
− 5
− 10

10
5
0
− 5
− 10 − 8 − 6 − 4 − 2 0 246810

Amplitude [f(t)]

Amplitude [feven(t)]

Amplitude [fodd(t)]

f(t) versus t

feven(t) versus t

time
− 8 − 6 − 4 − 2 0246810

fodd(t) versus t

5

0

− 5
− 10 − 8 − 6 − 4 − 2 0246810

time

time
Free download pdf