tmdsimpy.jax.harmonic_utils.get_fourier_coeff

tmdsimpy.jax.harmonic_utils.get_fourier_coeff(htuple, x_t)

Calculates a specific set of Fourier coefficients of a time series.

Parameters:
htuple(H,) tuple of sorted int

Harmonics considered, 0th harmonic must be first if included.

x_t(Nt, N) numpy.ndarray

Time series of each DOF. Rows are time instants over a cycle (see Notes). Columns are DOFs.

Returns:
v(Nhc, N) numpy.ndarray

Containing Fourier coefficients of harmonics h (rows) and DOFs (columns).

See also

tmdsimpy.utils.harmonic.get_fourier_coeff

Implementation without JAX support.

Notes

The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)

The normalized time instants between [0,1) for a cycle can be calculated as tau = numpy.linspace(0,1,Nt+1)[:-1].

If you have h as a numpy.ndarray of harmonic components, you can use htuple = tuple(h). The tuple is used here to allow for static arguments in JAX compilation.

For JAX and JIT, the top level function that calls this should likely be compiled with htuple as a static argument.