myogen.simulator.SurfaceEMG.simulate_muaps#

SurfaceEMG.simulate_muaps(
n_jobs: int = -2,
) SURFACE_EMG__Block[source]#

Simulate MUAPs for all electrode arrays using the provided muscle model.

This method generates Motor Unit Action Potential (MUAP) templates that represent the electrical signature of each motor unit as recorded by the surface electrodes. The simulation uses the multi-layered cylindrical volume conductor model with parallel processing for improved performance.

Parameters:

n_jobs (int, optional) – Number of parallel workers for motor unit processing. Default is -2. - n_jobs=-1: Use all CPU cores - n_jobs=-2: Use all cores except one (recommended, keeps system responsive) - n_jobs=-3: Use all cores except two - n_jobs=1: No parallelization - n_jobs=N: Use exactly N cores

Returns:

neo.Block of generated MUAP templates for each electrode array. Results are stored in the muaps property after execution.

Return type:

SURFACE_MUAP__Block

Notes

This method must be called before simulate_surface_emg(). The generated MUAP templates are used as basis functions for EMG signal synthesis.

The motor units are processed in parallel using joblib, with each motor unit’s fibers processed sequentially to maintain optimization efficiency.