448 Practical MATLAB® Applications for Engineers
ttt t− 2 0 1 2− 1− 1+11f 7 (t)f 4 (t)f 6 (t)f 5 (t)f 1 (t) f 2 (t) f 3 (t)20 110 2 − 2 0 2t
tt1− 1 0 3 − 130 2 33211.5FIGURE 4.89
Plots of P.4.1.
P.4.5 Let
ft
nnt
n2
11
2
11
() sin( 2 )
∑
Sketch by hand
a. f 2 (t) versus t
b. [f 3 (t) = 1 − f 2 (t)] versus t
c. mag[F 3 (w)] versus w
d. phase[F 3 (w)] versus wP.4.6 Repeat P.4.5 using MATLAB.
P.4.7 The script fi le drill returns the FS expansion of the function f(t), as shown in the
following, as well as its fi rst four partial FS approximations shown in Figure 4.90.
% Script file: drill
w1=1; w3 =3; w5 =5; w7=7;
k1= 4/pi;k3 = 4/(pi*3);
k5 = 4/(pi*5);k7= 4/(pi*7);
k = 0:pi/30:2*pi;
x1 =k1*sin(w1*k);x3 = k3*sin(w3*k);