ECE 366: Mini-Project 2
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
ECE 366: Mini-Project 2
2022
For the following questions, please include your responses along with your code and plots. Please submit your answers as a single pdf file through D2L.
1. [30] The function lsim can be used to simulate the output of continuous-time, causal
LTI systems described by linear constant-coefficient differential equations of the form:
ak = m(M)=0 bt) , To use lsim, the coefficients ak and bm must be stored
in MATLAB vectors a and b, respectively, in descending order of the indices k and m.
Consider the following example where the causal LTI system can be described by the first-order differential equation:
= y(t) + x(t).
(1)
The step response of this system can be computed by first defining the input step function as:
t=0:10;
x=ones(1,length(t));
The simulated step response can then be computed and plotted by executing b=1;
a=[1 0 .5];
s=lsim(b,a,x,t);
plot(t,s);
(a) [8] Use lsim to compute the response of the causal LTI system described by = -2y(t) + x(t) to the input x(t) = u(t - 2). Plot the computed response using t=[0:0 .5:10].
(b) [8] For the system in part (a), find the step response, s(t), by using lsim with the input x(t) = u(t).
(c) [6] For the system in part (a), find the impulse response by using the MATLAB function impulse.
(d) [8] Compare the signal returned by impulse with the derivative of s(t) computed by hand. Put both results on the same plot for t=[0:0 .5:10].
2. [35] In this exercise, you will compute numerical approximations to the convolution integral. In order to approximate the continuous functions in this integral using MATLAB vectors, you will use piecewise constant functions. One can show that y∆ (n∆) = ∆ 一& x(k∆)h((n - k)∆). x∆ (t) is a sequence of pulses spaced ev- ery ∆ in time with heights x(k∆), i.e. x∆ (t) = 一& x(k∆)δ∆ (t - k∆), where δ∆ (t) = Similarly, h(t) can be approximated by h∆ (t) =
一& h(k∆)δ∆ (t - k∆). In this problem, you will approximate the convolution of
x(t) = e一2tu(t) with h(t) = u(t) using piecewise constant functions for several different values of ∆ .
(a) [5] Compute the convolution of x(t) with h(t) by hand.
(b) [5] Define x1 to be the values of x∆ (n∆) on the interval 0 ≤ t ≤ 6 with ∆ = 0.5. The m-th element of x1 should be x∆ ((m - 1)∆),x1(1) = x∆ (0). Similarly, define h1 to be samples of h(t) for ∆ = 0.5 over the same time interval.
(c) [10] Use MATLAB function conv to compute y1, the discrete-time convolution of x1 and h1. Don’t forget to multiply the result of your convolution by ∆ . Note that because x1 and h1 are finite-length segments of infinite-length signals, only a finite-length segment of y1 is a valid approximation of y(t). The rest of y1 must be discarded. For what values of t does y1 approximate y(t)? Plot the valid elements of y1 using stem using a correctly labeled time axis. Is y1 a close approximation to the analytic expression you found in Part (a)?
(d) [15] Represent x∆ (n∆) for ∆ = 0.25, 0.1, 0.01 on the time interval 0 ≤ t ≤ 6 using vectors x2 through x4. Define h2 through h4 to represent h∆ (n∆) on the same interval with the same sampling periods. Compute y2 through y4 using conv and the appropriate inputs and impulse responses. In each case, the output signal is valid over the same range of t, but because ∆ is different for each output, this corresponds to a different set of samples. Plot y1 through y4 on the same set of axes using stem (you may use subplot). For which values of ∆ is the asymptotic value of the approximation within 10% of the asymptotic value of the true y(t) that you found in Part (a)?
3. [20] In this problem, you will use MATLAB to solve differential equations that describe the input-output relationship of an LTI system. You will use dsolve to solve the differential equations. The example given below solves the differential equation = -w(t) with the initial conditions, w(0) = -1, w\ (0) = 0, w\\ (0) = 0:
syms w(t)
Dw=diff(w);
D2w=diff(w,2);
w=dsolve(diff(D2w)==-w,w(0)==1,Dw(0)==0,D2w(0)==0);
Given + 3y(t) = x(t) with y(0) = -1:
(a) [5] Find the zero-input response of the system by letting the input be equal to 0. Plot your output using fplot over the time interval 0 ≤ t ≤ 10.
(b) [5] Find the zero-state response of the system by letting the initial condition be equal to 0 and x(t) = 3u(t). Plot your output using fplot over the time interval 0 ≤ t ≤ 10.
(c) [10] Find the total response of the system by solving the differential equation with the input x(t) = 3u(t) and the nonzero initial condition given above. Plot your output using fplot over the time interval 0 ≤ t ≤ 10. Compare the zero-state response, zero-input response and the total response in terms of their initial and steady-state values.
4. [15] For LTI systems, the output of the system to eigensignals, x(t) = Xest , is y(t) = XH(s)est , where H(s) is the transfer function of the system. Given an LTI system with H(s) = , find the steady-state response of the system y(t) to the following input signals using MATLAB. You will use the MATLAB polyval function to evaluate H(s) for different s values (see ece366sysresponse.m on D2L for an example):
(a) [3] x(t) = e一3tu(t).
(b) [3] x(t) = 5 cos(4t).
(c) [3] x(t) = 4ej3t .
(d) [3] x(t) = 5 sin(4t).
(e) [3] How are the response of Parts (b) and (d) related ?
2022-10-02