Код: Выделить всё
import numpy as np
from harold import Transfer, simulate_linear_system
import matplotlib.pyplot as plt
from scipy import signal
nbr_inputs = 5
t_in = np.arange(0, 10, 0.2)
dim = (nbr_inputs, len(t_in))
x = np.cumsum(np.random.normal(0, 2e-3, dim), axis=1)
H = Transfer([[[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 1, 5]]], [[[1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 1, 5]]])
y, t = simulate_linear_system(H, x.T, t_in, per_channel=True)
y = y.squeeze()
plt.plot(t, y)
plt.xlabel('Time')
plt.ylabel('Output')
plt.title('System Output Response')
plt.legend(['Input 1', 'Input 2', 'Input 3', 'Input 4', 'Input 5'])
plt.show()
Код: Выделить всё
for i in range(x.shape[1]):
y[:, i], _ = simulate_linear_system(H, x.T[i], t_in, per_channel=True)
Я хотел бы найти способ получить одношаговый и многоканальный сигнал, < strong>не вызывать функцию много раз и не объединять данные для многоканального сигнала.
Подробнее здесь: https://stackoverflow.com/questions/790 ... me-onestep