Making decode_pulses() compute the L2-norm on the fly