factor out poly_pulse