Spike sorting and analysis