Some improvements; Visualization of pulse train and detection function