Code for preprocessing neural data