Documente Academic
Documente Profesional
Documente Cultură
. . . . . .
Part 2. Use MATLAB to plot the amplitude and phase line spectra of the periodic signal from Part 1.
Part 3. Plot the magnitude and phase spectra of the system defined in Example 3.19 by using the MATLAB
function freqs(num,den), where the vectors num and den contain the coefficients of the transfer function
numerator and denominator in descending order.
Part 4. For the system defined in Example 3.19, and xN (t) determined in Part 1 with E = 5; !0 = 1 rad=s,
calculate the Fourier series coefficients of the output signal for n = 0; 1; 3; 5. Print the values for the magnitudes
of the Fourier series coefficients of the output signal. Plot the approximations xN (t) and observe the convergence
of the output signal as N increases. Take N = 1; 3; 5 and t 2 [0; 4]. Comment on the frequency of the output
signal and check its value from the plot obtained.
Submit all plots and comment on the results obtained.
SUPPLEMENT:
1
xN (t) = a0 +
XN [a cos (n!0 t) + b sin (n!0 t)]
n n (3.4)
2
n=1
The system in Example 3.19 is defined by
d2 y(t) dy(t)
+2 + 3y ( t) = x(t)
dt2 dt
MATLAB Progam
% Experiment 3
%
% PART 1
%
% Hint: The program for Example 3.1 and Figure 3.3 can be downloaded
% from the textbook webpage and appropriately modified
t=-1.5:0.01:1.5; w0=2*pi; E=1; a0=1;
% Since the signal is even its bn coefficients are zero
% Approximation with 5 harmonics
N=5; xN=a0/2;
for n=1:N
an=(E/(n*pi))*(sin(n*pi/2)-sin(n*3*pi/2));
11