Code for analyzing flashing stim