Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.9 KB

amplitude_cv.rst

File metadata and controls

55 lines (34 loc) · 1.9 KB

Amplitude CV (amplitude_cv_median, amplitude_cv_range)

Calculation

The amplitude CV (coefficient of variation) is a measure of the amplitude variability. It is computed as the ratio between the standard deviation and the amplitude mean. To obtain a better estimate of this measure, it is first computed separately for several temporal bins. Out of these values, the median and the range (percentile distance, by default between the 5th and 95th percentiles) are computed.

The computation requires either spike amplitudes (see :py:func:`~spikeinterface.postprocessing.compute_spike_amplitudes()`) or amplitude scalings (see :py:func:`~spikeinterface.postprocessing.compute_amplitude_scalings()`) to be pre-computed.

Expectation and use

The amplitude CV median is expected to be relatively low for well-isolated units, indicating a "stereotypical" spike shape.

The amplitude CV range can be high in the presence of noise contamination, due to amplitude outliers like in the example below.

amplitudes.png

Example code

import spikeinterface.qualitymetrics as sqm

# Make recording, sorting and wvf_extractor object for your data.
    # It is required to run `compute_spike_amplitudes(wvf_extractor)` or
    # `compute_amplitude_scalings(wvf_extractor)` (if missing, values will be NaN)
amplitude_cv_median, amplitude_cv_range = sqm.compute_amplitude_cv_metrics(waveform_extractor=wvf_extractor)
# amplitude_cv_median and  amplitude_cv_range are dicts containing the unit ids as keys,
# and their amplitude_cv metrics as values.

References

.. autofunction:: spikeinterface.qualitymetrics.misc_metrics.compute_amplitude_cv_metrics


Literature

Designed by Simon Musall and adapted to SpikeInterface by Alessio Buccino.