  Precision optical measurements of the electron-spin precession of
nitrogen-vacancy (NV) centers in diamond form the basis of numerous
applications. The most sensitivity-demanding applications, such as femtotesla
magnetometry, require the ability to measure changes in GHz spin transition
frequencies at the sub-millihertz level, corresponding to a fractional
resolution of better than 10^{-12}. Here we study the impact of microwave (MW)
phase noise on the response of an NV sensor. Fluctuations of the phase of the
MW waveform cause undesired rotations of the NV spin state. These fluctuations
are imprinted in the optical readout signal and, left unmitigated, are
indistinguishable from magnetic field noise. We show that the phase noise of
several common commercial MW generators results in an effective pT
s^{1/2}-range noise floor that varies with the MW carrier frequency and the
detection frequency of the pulse sequence. The data are described by a
frequency domain model incorporating the MW phase noise spectrum and the
filter-function response of the sensing protocol. For controlled injection of
white and random-walk phase noise, the observed NV magnetic noise floor is
described by simple analytic expressions that accurately capture the scaling
with pulse sequence length and the number of pi pulses. We outline several
strategies to suppress the impact of MW phase noise and implement a version,
based on gradiometry, that realizes a >10-fold suppression. Our study
highlights an important challenge in the pursuit of sensitive diamond quantum
sensors and is applicable to other qubit systems with a large transition
frequency.
