Ramsey spectroscopy