utils ¶
firings_to_binary ¶
firings_to_binary(firings: list, signal_length: int) -> np.ndarray
Convert firings list to binary matrix representation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
firings
|
list
|
List of firings arrays |
required |
signal_length
|
int
|
Length of the original signal |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Binary matrix of shape (signal_length, n_units) |
Source code in motor_unit_toolbox/utils.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
binary_to_firings ¶
binary_to_firings(binary_matrix: ndarray) -> list
Convert binary matrix representation to firings list
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
binary_matrix
|
ndarray
|
Binary matrix of shape (signal_length, n_units) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
List of firings arrays |
Source code in motor_unit_toolbox/utils.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |