SurfaceElectrodeArray#

class SurfaceElectrodeArray(
num_rows,
num_cols,
inter_electrode_distances__mm,
electrode_radius__mm,
center_point__mm_deg=(0.0, 0.0),
bending_radius__mm=0.0,
rotation_angle__deg=0.0,
differentiation_mode='monopolar',
)[source]#

Bases: object

Surface electrode array for EMG recording.

Represents a grid of surface electrodes with configurable spacing, size, and differentiation modes.

Parameters:
  • num_rows (int) – Number of rows in the electrode array

  • num_cols (int) – Number of columns in the electrode array

  • inter_electrode_distances__mm (float) – Inter-electrode distances in mm.

  • electrode_radius__mm (float, optional) – Radius of the electrodes in mm

  • center_point__mm_deg (tuple[float, float]) – Position along z in mm and rotation around the muscle theta in degrees.

  • bending_radius__mm (float, optional) – Bending radius around which the electrode grid is bent. Usually this is equal to the radius of the muscle.

  • rotation_angle__deg (float, optional) – Rotation angle of the electrodes in degrees. This is the angle between the electrode grid and the muscle surface.

  • differentiation_mode ({"monopolar", "bipolar_longitudinal", "bipolar_transversal", "laplacian"}) – Differentiation mode. Default is monopolar.

pos_z#

Longitudinal electrode positions in mm, shape (num_rows, num_cols). Available after class initialization via _create_electrode_grid().

Type:

numpy.ndarray

pos_theta#

Angular electrode positions in radians, shape (num_rows, num_cols). Available after class initialization via _create_electrode_grid().

Type:

numpy.ndarray

electrode_positions#

Complete electrode position arrays (pos_z, pos_theta). Available after class initialization via _create_electrode_grid().

Type:

tuple[np.ndarray, np.ndarray]

num_electrodes#

Total number of electrodes (num_rows * num_cols).

Type:

int

num_channels#

Number of recording channels based on differentiation mode.

Type:

int

Methods

__init__

get_H_sf

Get the spatial filter for the electrode array.

Attributes

electrode_positions

Complete electrode position arrays (z, theta) in physical coordinates.

pos_theta

Angular positions of electrodes in radians.

pos_z

Longitudinal positions of electrodes in mm.

property pos_z: ndarray#

Longitudinal positions of electrodes in mm.

Returns:

Array of shape (num_rows, num_cols) containing z-coordinates of each electrode position in mm.

Return type:

numpy.ndarray

Raises:

AttributeError – If electrode grid has not been created. Run constructor first.

property pos_theta: ndarray#

Angular positions of electrodes in radians.

Returns:

Array of shape (num_rows, num_cols) containing angular coordinates of each electrode position in radians.

Return type:

numpy.ndarray

Raises:

AttributeError – If electrode grid has not been created. Run constructor first.

property electrode_positions: tuple[ndarray, ndarray]#

Complete electrode position arrays (z, theta) in physical coordinates.

Returns:

Tuple containing: - pos_z: Longitudinal positions in mm, shape (num_rows, num_cols) - pos_theta: Angular positions in radians, shape (num_rows, num_cols)

Return type:

tuple[np.ndarray, np.ndarray]

Raises:

AttributeError – If electrode grid has not been created. Run constructor first.

get_H_sf(ktheta_mesh_kzktheta, kz_mesh_kzktheta)[source]#

Get the spatial filter for the electrode array.

Parameters:
  • ktheta_mesh_kzktheta (numpy.ndarray) – Angular spatial frequency mesh

  • kz_mesh_kzktheta (numpy.ndarray) – Longitudinal spatial frequency mesh

Returns:

H_sf – Spatial filter for the specified differentiation mode

Return type:

numpy.ndarray or float