Skip to content

Signal Functions

Some useful signal functions. * sigmoid * minimum_jerk

from indl.misc.sigfuncs import sigmoid
import numpy as np
import matplotlib.pyplot as plt

x = np.arange(-6, 6, 0.1)

plt.subplot(1, 2, 1)
for B in [0.5, 1, 2, 5, 10]:
    plt.plot(x, sigmoid(x, B=B), label=f"B={B}")
plt.legend()

plt.subplot(1, 2, 2)
for x_offset in [-3.0, -1.5, 0, 1.5, 3.0]:
    plt.plot(x, sigmoid(x, x_offset=x_offset), label=f"{x_offset}")
plt.legend()

plt.show()
a = np.array([[0.2, 0.5]]).T
sigmoid(x, A=a).shape
(2, 120)
from indl.misc.sigfuncs import minimum_jerk
x = np.arange(0, 6.0, 0.1)
for degree in [0, 1, 2]:
    plt.plot(x, minimum_jerk(x, degree=degree), label=f"{degree}")
plt.legend()
plt.show()
a = np.random.rand(5, 2)
Y = minimum_jerk(x, a0=a[:, 0], af=a[:, 1], degree=0)
plt.plot(x, Y)
plt.show()