create_sawtooth_current#

myogen.utils.currents.create_sawtooth_current(n_pools, t_points, timestep_ms, amplitudes__muV, frequencies__Hz, offsets__muV=0.0, widths=0.5, phases__rad=0.0)[source]#

Create a matrix of sawtooth currents for multiple pools.

Parameters:
  • n_pools (int) – Number of current pools to generate

  • t_points (int) – Number of time points

  • timestep_ms (float) – Time step in milliseconds

  • amplitudes__muV (float | list[float]) –

    Amplitude(s) of the sawtooth current(s) in microvolts.

    Must be:
    • Single float: used for all pools

    • List of floats: must match n_pools

  • frequencies__Hz (float | list[float]) –

    Frequency(s) of the sawtooth current(s) in Hertz.

    Must be:
    • Single float: used for all pools

    • List of floats: must match n_pools

  • offsets__muV (float | list[float]) –

    DC offset(s) to add to the sawtooth current(s) in microvolts.

    Must be:
    • Single float: used for all pools

    • List of floats: must match n_pools

  • widths (float | list[float]) –

    Width(s) of the rising edge as proportion of period (0 to 1).

    Must be:
    • Single float: used for all pools

    • List of floats: must match n_pools

  • phases__rad (float | list[float]) –

    Phase(s) of the sawtooth current(s) in radians.

    Must be:
    • Single float: used for all pools

    • List of floats: must match n_pools

Raises:

ValueError – If the parameters are lists and the length of the parameters does not match n_pools

Returns:

Matrix of shape (n_pools, t_points) containing sawtooth currents

Return type:

INPUT_CURRENT__MATRIX