Amplitude median (amplitude_median)

Calculation

Computed simply as the median of the amplitudes for each unit.

Expectation and use

A larger value (larger signal) indicates a better unit.

Example code

import spikeinterface.metrics.quality as sqm

# It is also recommended to run sorting_analyzer.compute(input="spike_amplitudes")
# in order to use amplitude values from all spikes.
amplitude_medians = sqm.compute_amplitude_medians(sorting_analyzer)
# amplitude_medians is a dict containing the unit IDs as keys,
# and their estimated amplitude medians as values.

Reference

spikeinterface.metrics.quality.misc_metrics.compute_amplitude_medians(sorting_analyzer, unit_ids=None, periods=None)

Compute median of the amplitude distributions.

Parameters:
sorting_analyzerSortingAnalyzer

A SortingAnalyzer object.

unit_idslist or None

List of unit ids to compute the amplitude medians. If None, all units are used.

periodsarray of unit_period_dtype | None, default: None

Periods (segment_index, start_sample_index, end_sample_index, unit_index) on which to compute the metric. If None, the entire recording duration is used.

Returns:
all_amplitude_mediansdict

Estimated amplitude median for each unit ID.

References

Inspired by metric described in [IBL] This code is ported from: https://github.com/int-brain-lab/ibllib/blob/master/brainbox/metrics/single_units.py

Literature

Introduced by [IBL].