Moments at "discontinuous signals" with applications: model reduction for hybrid systems and phasor transform for switching circuits