You are on page 1of 8

# % Issue the commands to perform the outlined tasks for % Matlab Problem Set #9 Prob. 1.

% sys1=tf([1,0],[1,2,3]), % Enter the transfer function of the system from % Problem 6.4-1. Transfer function: s ------------s^2 + 2 s + 3 z1=zero(sys1), % Examine the finite zeros of this system. % origin! z1 = 0 p1=pole(sys1), % Examine the location of the two poles of this system. p1 = -1.0000 + 1.4142i -1.0000 - 1.4142i % With a zero at the origin, and two poles (which happen to be complex % conjugates), this system should produce a band-pass filtering type of % behavior. % % Problem Set #9, Problem 1 (b). % Plot the Bode plot of the given system. bode(sys1) % The magnitude response does exhibit a bandpass filter shape. % The passband's center frequency (peak value) is around 2 radians/second. % % Part (c): Generate the step response and the impulse response for this % system. figure(2) step(sys1), % Step Response. % The ringing behavior is a consequence of the complex conjugate poles. % The final value of the step response goes to zero, since there is no DC % gain. % Remember, the system had a zero at the origin or at DC. % figure(3) impulse(sys1), % Examine the impulse response. % This impulse response does seem consistent with the H[s] transfer function. % The response decays after about 5 seconds, which is consistent with the % real part of the poles equalling 1.0 or providing a time constant of % 1 second. % % Part (d): % From the Bode plot, I would expect the harmonics close to omega equal to % 2 rad/sec. % to be passed more favorably than any of the other harmonics. Based on It should be at

Display the figure windows from the above diary file.

Figure 1 (below): Bode plot of the system.
Bode Diagram 0 -10
Magnitude (dB) Phase (deg)

-20 -30 -40 -50 -60 90 45 0 -45 -90 10
-2

10

-1

10

0

10

1

10

2

Figure 2 (below): Step Response.
Step Response 0.3

0.25

0.2

Amplitude

0.15

0.1

0.05

0

-0.05

0

1

2

3

4 Time (sec)

5

6

7

8

Figure 3 (below): Impulse Response.
Impulse Response 1

0.8

0.6

Amplitude

0.4

0.2

0

-0.2

-0.4

0

1

2

3 Time (sec)

4

5

6

Figure 4 (below): Input Waveform and Output Response of System.
Bandpass Filter Behavior 1.2 Input Output

1

0.8

Waveforms

0.6

0.4

0.2

0

-0.2

0

2

4

6

8

10 Time

12

14

16

18

20

Matlab Problem Set #9, Problem 2.
% Issue commands to help check the answer obtained in Problem 7.1-4(a). % Problem 7.1-4(a) concerns computing the Fourier Transform of a time % limited exponentially decaying waveform. % I have arbitrarily decided to use an exponential decay value of 0.5 % and a time duration for the waveform of 2.0 seconds. % For these choices, the exponential decay rate provides a time constant of % (1/0.5) or 2 seconds, which is the length of time I have decided to allow % the waveform to be non-zero. syms t w % Define "t" and "w" as a symbolic time and % frequency variable, respectively. a=0.5;T=2; % Assign numerical values for the decay rate and waveform % time duration. % Compute the Fourier Transform symbolically. X=int(exp(-a*t)*exp(-j*w*t),t,0,T), % Perform the symbolic integration. X = (2*((1/exp(2*w*i))/exp(1) - 1)*i)/(2*w - i) pretty(X), % Display a "pretty" version of the Fourier Transform result. / 1 \ | ---------| | exp(2 w i) | 2 | ---------- - 1 | i \ exp(1) / ---------------------2 w - i % The above Fourier Transform can be made to equal the answer in % Problem 7.1-4(a) % if the above expression is multiplied by "1". In this case, a good choice % for the number "1" is to use (0.5i/0.5i), where "i" is the square root % of -1.0. The variable "i" in the above Fourier Transform is sqrt(-1). diary off

Matlab Problem Set #9, Problem 3.
% Generate the Fourier Transform of a decaying exponential that is non-zero % for all positive values of time including t=0. syms t % Define "t" as a symbolic time variable. h=exp(-0.5*t)*heaviside(t), % Define the decaying exponential for t>=0. h = heaviside(t)/exp(t/2) % The "heaviside" function behaves (acts) like the unit step. H=fourier(h), % Compute the Fourier Transform of the exponential function. H = 1/(1/2 + w*i) % This Fourier Transform is consistent with the Fourier Transform of a % decaying exponential waveform that is defined for non-negative values % of time. % One can compare this Fourier Transform with the Laplace Transform % of the same decaying exponential. The Fourier Transform can be obtained % by replacing "s" in the Laplace Transform H[s] with "jw", % since the decaying exponential corresponds to a stable waveform, i.e., % the waveform is absolutely integrable or the region of convergence of the % Laplace Transform contains the imaginary axis (jw-axis) or % the poles of the Laplace Transformed waveform are in the closed, % Left-Half Plane. % In the s-plane pole/zero diagram associated with this waveform, the pole % of the Laplace Transformed waveform is located at s=-0.5 for the specific % decay rate selected for this example. diary off