how to generate pwm signal