1. A method for determining a threshold for spike detection in an electrophysiological signal, the method comprising: receiving, at an input of a system for determining a threshold for spike detection, an electrophysiological signal comprising one or more spikes representing action potentials from one or more neurons; determining, in a processing unit of the system, an estimated envelope of the electrophysiological signal; based on the estimated envelop; determining, in the processing unit of the system, an estimated Gaussian noise; determining, in the processing unit of the system, a mode of a distribution of the estimated Gaussian noise; and determining, in the processing unit of the system, a threshold for detection of the one or more spikes in the electrophysiological signal based on the mode of the distribution of the estimated Gaussian noise.