如何离散化信号?
How to discretize a signal?
如果我有如下函数:
G(s)= C/(s-p) where s=jw, c and p are constant number.
此外,可用频率为 wa= 100000 rad/s。如何在 Python 中离散化 ∆w = 0.0001wa 处的信号?
使用numpy.arange
完成这个:
import numpy as np
wa = 100000
# np.arange will generate every discrete value given the start, end and the step value
discrete_wa = np.arange(0, wa, 0.0001*wa)
# lets say you have previously defined your function
g_s = [your_function(value) for value in discrete_wa]
如果我有如下函数:
G(s)= C/(s-p) where s=jw, c and p are constant number.
此外,可用频率为 wa= 100000 rad/s。如何在 Python 中离散化 ∆w = 0.0001wa 处的信号?
使用numpy.arange
完成这个:
import numpy as np
wa = 100000
# np.arange will generate every discrete value given the start, end and the step value
discrete_wa = np.arange(0, wa, 0.0001*wa)
# lets say you have previously defined your function
g_s = [your_function(value) for value in discrete_wa]