bionet.utils.trig_poly.get_dirichlet_coeffs¶
- bionet.utils.trig_poly.get_dirichlet_coeffs(u, dt, M, method='fft')¶
Compute the Dirichlet coefficients of a trigonometric polynomial.
Parameters: u : numpy.ndarray
Input signal.
dt : float
Time resolution (s).
M : int
Trigonometric polynomial order.
method : {‘fft’, ‘inner’}
Method to use when computing coefficients. The FFT method is generally faster than using inner products.
Returns: am : numpy.ndarray
Array of 2*M+1 Dirichlet coefficients.
Notes
Assumes that u is defined over times dt*arange(0, len(u)) and that dt*len(u) is equal to the period of the trigonometric polynomial.