Lab 6 1
Lab 6 1
LTI System
1. For each of the following system. Determine whether or not the system is time-invariant
=> A time-invariant system is a type of system in which the output of the system is only
dependent on the current and past inputs of the system and not on the time at which
these inputs occur. In other words, the system's behavior does not change over time.
If y(t) = x(t) denotes the output of the system when the input is x(t), and y1(t) = x(t-T0)
denotes the output of the system when the input is x(t-T0) then y(t-T0) = x(t-T0) = y1(t) for
all values of t and T0.
a. y(t) = tx(t)
=> Code:
def x(t): # take x(t) = sin(t)
return np.sin(t)
def y(t):
return t*x(t)
def _y(t):
return t*x(t-t0)
def y1(t):
return (t-t0)*x(t-t0)
plt.plot(t, _y(t))
plt.plot(t, y1(t))
plt.show()
Output:
Code:
def y(t):
return np.exp(x(t))
def _y(t):
return np.exp(x(t-t0))
def y1(t):
return np.exp(x(t-t0))
plt.plot(t, _y(t))
plt.plot(t, y1(t))
plt.show()
Output:
Code:
def y(t):
return x(t+10) + x(t)**2
plt.plot(t, _y(t))
plt.plot(t, y1(t))
Output:
4. y(n) = si n(x(n))
Code:
def y(t):
return np.sin(x(t))
def _y(t):
return np.sin(x(t-t0))
def y1(t):
return np.sin(x(t-t0))
plt.plot(t, _y(t))
plt.plot(t, y1(t))
plt.show()
Output:
# This system is not a time varient system
Code:
def y(t):
return x(t+1) + x(t) + x(t-1)
def _y(t):
return x(t+1-t0) + x(t-t0) + x(t-1-t0)
def y1(t):
return x(t-t0+1) + x(t-t0) + x(t-t0-1)
plt.plot(t, _y(t))
plt.plot(t, y1(t))
plt.show()
Output:
a.
Code:
import sympy as sp
Output:
The system does not satisfy the superposition property
The system does not satisfy the homogeneity property
b.
Code:
Output:
c.
Code:
import numpy as np
# Define the coefficients of the characteristic equation
a=1
b = -1
c = -2
Output:
The system is not asymptotically stable.
3. The output response y(t) of a continuous time LTI system is 2e −3t u(t),
when the input x(t) is u(t). Find the system function.
Code:
t, s, F = sp.symbols('t, s F')
def u(t):
return sp.Heaviside(t)
def laplas(f):
F = sp.laplace_transform(f, t, s)
return F
def inverseLaplas(f):
f = sp.inverse_laplace_transform(F, s, t)
return f
f = u(t)
# sp.plot(f)
f = 2*(sp.exp(-3*t)*u(t))
# sp.plot(f)
x_s = laplas(sp.Heaviside(t))
y_s = laplas(f)
h_s = y_s[0] / x_s[0]
_h = inverseLaplas(h_s)
Output: 𝐹(𝐹)
4. Find the output response of an LTI system with impulse response h(t) =
δ(t − 3) for
input x(t) = cos4t + cos7t
Code:
F = sp.DiracDelta(t-3)
x = sp.cos(4*t) + sp.cos(7*t)
f_s = laplas(F)
x_s = laplas(x)
y_t = f_s[0] * x_s[0]
inverseLaplas(y_t)
Output: (𝐹)𝐹(𝐹−3)