Estimate the proportion of common input index (PCI) from MU spike
trains.
This implementation follows the logic of Negro et al. (2016), where
coherence is calculated between two CSTs containing n MUs each.
The number of MUs per CST is varied from 1 to floor (total number
of MUs / 2).
The relationship between average coherence and number of units per CST is
fitted using Eq. 4:
C(n) = ((n^2 * A)^2) / ((n * B + n^2 * A)^2)
PCI is then calculated as:
References:
| PARAMETER |
DESCRIPTION |
emgfile
|
The dictionary containing the emgfile.
TYPE:
dict
|
number_iterations
|
Number of random permutations. If the number of unique splits
is smaller than number_iterations, all unique splits are used.
TYPE:
int
DEFAULT:
100
|
window_type
|
Type of window used for spectral estimation. Can be:
hanning
A Hann window.
hamming
A Hamming window
TYPE:
str {"hanning", "hamming"}
DEFAULT:
"hanning"
|
window_duration_seconds
|
Size of the window for coherence estimation in seconds.
TYPE:
float
DEFAULT:
1
|
overlap_seconds
|
Number of seconds of overlap between adjoining segments.
TYPE:
float
DEFAULT:
0
|
nfft
|
Number of FFT points.
If None, defaults to 10 * fsamp.
TYPE:
int or None
DEFAULT:
None
|
delta_frequency_range
|
Delta frequency range in Hz.
TYPE:
list
DEFAULT:
[1, 5]
|
alpha_frequency_range
|
Alpha frequency range in Hz.
TYPE:
list
DEFAULT:
[5, 15]
|
beta_frequency_range
|
Beta frequency range in Hz.
TYPE:
list
DEFAULT:
[15, 35]
|
random_state
|
Random seed for reproducible random permutations.
TYPE:
int
DEFAULT:
42
|
| RETURNS |
DESCRIPTION |
pci_results
|
Dictionary containing coherence-vs-CST-size values and fitted PCI
values. Keys are:
- "average_coherence_df": dataframe containing the number of MUs per
CST and the corresponding average coherence values for each frequency
band (dataframe).
- "fitted_average_coherence_df": dataframe containing the number of MUs
per CST and the corresponding fitted coherence values using the fitted
A and B parameters for each frequency band (dataframe).
- "pci_fit_df": dataframe containing the fitted A and B parameters,
and the PCI index for each frequency band (dataframe).
TYPE:
dict
|
Notes
The PCI index is typically implemented only for the delta band (see Negro
et al., 2016), but this function also fits the model and estimates the PCI
for alpha and beta bands.
Examples:
Estimate the proportion of common input index.
>>> import openhdemg.library as emg
>>> emgfile = emg.emg_from_samplefile()
>>> pci_results = emg.pci_index(
... emgfile=emgfile,
... number_iterations=100,
... )
>>> pci_results["average_coherence_df"]