Detection of neuronal spikes using an adaptive threshold based on the max–min spread sorting method