Digital noise spectroscopy with a quantum sensor