I was thinking of using a DC motor
No that will not work, the speed of a pendulum is constantly changing and you do not have that degree of speed control with a DC motor. It might be possible to do it with a stepping motor or servo, but the impulse method described above is perhaps the best unless the period of the pendulum has to be different from it's natural frequency.