neurodec.mdt.ImpulseTrains#

class neurodec.mdt.ImpulseTrains(dictionary: dict)#

The impulse trains of the motor units of a single muscle

property data: ArrayLike#

Returns the data associated with this impulse train

property id: int#

Returns the ID of the object

classmethod new(muaps: MotorUnitsActionPotentials, activation: ArrayLike, recruitment_rate: float = 75.0, excitation_frequency_min: float = 8.0, excitation_frequency_max: float = 32.0, inter_impulse_variance: float = 0.2, force_computation: bool = False, random_seed: int = 0) ImpulseTrains#

Create new impulse trains for the motor units of a single muscle

Creates new impulse trains for the motor units of a muscle. This will initiate a call to the Neurodec Myoelectric Digital Twin (MDT) API that will generate impulse trains and return their metadata.

Parameters
  • muaps – The MUAPs of the motor units for which the impulse trains are generated.

  • activation – The % of muscle contraction in time.

  • recruitment_rate – The recruitment rate of the motor units.

  • excitation_frequency_min – The minimum excitation frequency of the motor units.

  • excitation_frequency_max – The maximum excitation frequency of the motor units.

  • inter_impulse_variance – The inter impulse variance.

  • force_computation – Boolean flag that allows to bypass a status check. Normally, the API would check if an object with the requested parameters was already present in the database. If this was the case, the API would not request its computation and would simply return its identifier. By setting this flag to True, the user can bypass this logic and force the computation of the resource even if it existed already. The main reason is to allow starting a calculation again in case of unexpected errors.

  • random_seed – A specific random seed to be used for the calculations. Changing the seed allows to create multiple instances from the same parameters.

Returns

The metadata of the new impulse trains. If another set of impulse trains with the same parameters already exits, those will be returned instead of generating new ones.

property status: Status#

Returns the up-to-date status of the object, by performing an API request.

wait()#

Wait for the object to be ready