pulse generator working principle