I would like to use scipy.signal.lti
and scipy.signal.impulse
function to calculate the transfer function. I import the scipy
module in the following way.
import scipy as sp
import numpy as np
import matplotlib.pyplot as plt
from math import *
However, when I type the following scripts,
tf = sp.signal.lti(numH, denH)
The Kernel gives an error:
---> 10 tf = sp.signal.lti(numH, denH)
AttributeError: 'module' object has no attribute 'signal'
I tried another way to import the signal module,
from scipy.signal import lti, step, impulse
Then, the script works,
tf = lti(numH, denH)
So, my questions is, must we import every subpackage in the script? Then what's the point of importing the scipy
package?
Thanks.