aklab.signal module#

Signal processing tools: filter, smooth, etc.

aklab.signal.bspline(cv, n=100, degree=3, periodic=False)[source]#

Calculate n samples on a bspline

Parameters
  • cv (list or np.array()) – Array of control vertices

  • n (int) – Number of samples to return

  • degree – Curve degree

  • periodic (bool) – True - Curve is closed, False - Curve is open

aklab.signal.fft_filtering(sample, dt, fc)[source]#

Lowpass filter TODO: calculate sampling time with numpy.gradient, no need to manually suply it

Parameters
  • sample (array-like) – signal

  • dt (float) – sampling interval

  • fc (float) – upper frequency limit

Returns

g – filtered signal

Return type

np.array

aklab.signal.index_of_nearest(signal, value)[source]#

Index of the nearest value in an array

Parameters
  • signal (array) –

  • value (float) –

Returns

index of the nearest value in the signal

Return type

int

aklab.signal.poly_smooth(x, y, order, n=1)[source]#

Fit data with a polinomial and return interpolated signal

Parameters
  • x (list or np.array) –

  • y (list or np.array) –

  • order (int) – order of the polinomial

  • n (int) – multiplier of the number of data points

Returns

interpolated x,y

Return type

tuple