Optical encoding and multiplexing of detector signals with dual threshold time-over-threshold