optical pulse detection