A spectroscopy approach to measure the gravitational mass of antihydrogen