electricpy.harmonics

electricpy.harmonics(real, imag=None, dc=0, freq=60, domain=None)[source]

Harmonic Function Generator.

Generate a function or dataset for a harmonic system given the real (cosine), imaginary (sine), and DC components of the system.

Parameters:
  • real (list of float) – The real (cosine) component coefficients for the harmonic system.

  • imag (list of float, optional) – The imaginary (sine) component coefficients for the harmonic system.

  • dc (float, optional) – The DC offset for the harmonic system, default=0

  • freq (float, optional) – The fundamental frequency of the system in Hz, default=60

  • domain (list of float, optional) – Domain of time samples at which to calculate the harmonic system, must be array-like, will cause function to return numpy array instead of function object.

Returns:

system – Function object handle which can be used to call the function to evaluate the harmonic system at specified times.

Return type:

function