Second seed Federer clinched a 6-4, 6-4, 6-7 (5/7), 6-2 victory over world number 69 Groth who fired a 147mph ace in the third game.
Federer will next face Spanish 20th seed Roberto Bautista Agut for a place in the quarter-finals.
“I am very happy. It has been a hot week the first week but thankfully I have had easy matches going through without too many long four or five setters,” said Federer.
“Now we are looking ahead and there are only big matches.”