What's wrong?

Is this when under load (accelerating) or decelerating, or all the time?

Ignition cutting off and on can result in raw fuel going into the exhaust and popping. So it could be erratic power supplied to the ignition, erratic ground, etc. If you can get it to do this sitting still, then you can put a voltmeter on various parts of the ignition system and watch to see if the power to it is steady.