rattle with acceloration
Could be a loose exhaust heat shield.
Tester
+1
Or, it is possible that the engine is “pinging”. The OP should have his mechanic check for any loose parts on the exhaust system, and if that doesn’t yield a solution, then he should check to see whether the knock sensor is working.
2014 Elantra anti-knock/detonation sensor.

Tester
First step, check if you can wiggle the heat shield under the cat. Caution, could be very hot, best to do that when the engine is cold.
A rubber mallet or a piece of 2X4 is helpful. Fist, too. Gloves on hands always a good thing here, and eye protection.