Optimised frequency modulation for continuous-wave optical magnetic resonance sensing using nitrogen-vacancy ensembles

Magnetometers based on ensembles of nitrogen-vacancy centres are a promising platform for continuously sensing static and low-frequency magnetic fields. Their combination with phase-sensitive (lock-in) detection creates a highly versatile sensor with a sensitivity that is proportional to the derivative of the optical magnetic resonance lock-in spectrum, which is in turn dependant on the lock-in modulation parameters. Here we study the dependence of the lock-in spectral slope on the modulation of the spin-driving microwave field. Given the presence of the intrinsic nitrogen hyperfine spin transitions, we experimentally show that when the ratio between the hyperfine linewidth and their separation is $\gtrsim 1/4$, square-wave based frequency modulation generates the steepest slope at modulation depths exceeding the separation of the hyperfine lines, compared to sine-wave based modulation. We formulate a model for calculating lock-in spectra which shows excellent agreement with our experiments, and which shows that an optimum slope is achieved when the linewidth/separation ratio is $\lesssim 1/4$ and the modulation depth is less then the resonance linewidth, irrespective of the modulation function used.


Introduction
One of the primary tools for precision measurements in modern experimental physics is phasesensitive detection. As its principle is straightforward -retrieving a modulated signal component obscured in noise by mixing the total signal with a similarly modulated reference -this detection method results in a versatility that is applicable and implementable in a range of scenarios, from atomic magnetometers [1], to single-ion lock-in detection [2], scanning probe microscopy [3], and optical interferometry and spectroscopy [4]. Phase-sensitive detection is often carried out in conjunction with frequency filtration and AC-amplification, which is collectively termed as lock-in detection [5]. For sensing devices, this procedure is usually applied to overcome the problem of increased susceptibility to low-frequency or discrete frequency noise components when attempting to enhance the sensitivity. The main challenge usually lies in identifying suitable system parameters for modulation which lends itself to both maximising the systems response and discriminating it from noise lying outside a given bandwidth. This is pertinent in, for example, low-frequency magnetometry (DC to 1 kHz) where 1/ f noise and slow drifts stemming from the environment start to dominate [6,7].
High sensitivity magnetometry has been mainly spurred on by advances in superconductivity and atomic magneto-optics [8], where <fT/ √ Hz sensitivities have been achieved for a ∼ 0.3 cm 3 sampling volume in both pulsed and continuous-wave operating regimes [9,10]. However, there has been a recent surge of interest in exploring diamond-based magnetometery using ensembles of nitrogen-vacancy (NV) defects, due to the relatively simple technical operation under ambient conditions, their small potential sampling volume (approaching µm 3 volumes), and their chemical inertness which allows for direct physical contact with delicate biological systems [11,12].
NV magnetic sensing schemes are usually based on either continuous-wave optically detected magnetic resonance (cw-ODMR) or pulsed ODMR, both which are used to determine small magnetic field changes δB around a fixed B field offset. Cw-ODMR schemes possess field sensitivities limited by the ratio of the spin resonance linewidth to fluorescence contrast and shot-noise level. On the other hand, pulsed techniques such as Ramsey/π-pulsed schemes result in sensitivities limited by 1/T 2 * , while spin-echo-based schemes possess enhanced field-sensitivities at the expense of limiting their optimised sensitivity to magnetic fields oscillating at frequencies in the order of 1/T 2 [13].
When sensing low frequency fields (< 1 kHz) or spatial field variations over macroscopic areas, the use of cw-ODMR schemes is more technically convenient, which avoids the difficulty facing pulsed schemes in ensuring sufficient uniform intensity and spin control over a macroscopic volume, and involves simply monitoring the spin resonance frequency through shifts in the detected fluorescence level. The efficiency of this scheme is based on how large a change in fluorescence can be generated and how small a change can be detected, for incremental resonance shifts induced by an external magnetic field. The challenge is thus generating the narrowest spectral linewidth during cw-driving while ensuring that the fluorescence contrast is as high as possible. This is primarily limited by the number of spins used and the amount of light that is generated and collected, as well as the inherent collective-spin dephasing rates, the optical and microwave (MW) power-related dephasing, the environmental noise fluctuations, and the technical noise in both the detection apparatus and that introduced by power fluctuations occurring at various frequencies in the drive and measurement fields [14]. The use of lock-in detection is therefore well suited to overcome many of these issues in order to ensure the intrinsic-sensitivity of the NV system is maintained.
Previous NV-related work which addresses the use of lock-in detection has focused on single NV based sensing through multi-pulsed phase estimation schemes [15], or their incorporation within a scanning-probe based schemes [16]. Alternatively, it has also been presented as an integral component for NV ensemble magnetometery using optical fibre-based read-out [17], using the diamond as a light trapping-waveguide [7], through the absorption of the spin-singlet state [18], when avoiding the use of a MW drive field [19], or for sensing biologically generated magnetic fields [20]. However, to our knowledge, there has been no published investigation of the technicalities on optimising the modulation parameters to maximise the slopes in the measured lock-in spectrum. While this technique is conceptually undemanding, the optimum modulation function for NV ensemble magnetometry is not obvious as it is dependent on the systems spin resonance spectrum and its unique response to optical and microwave drive fields. This is especially true as NV systems possesses two/three (depending on the nitrogen isotope) peaks centred around the electron spin resonance frequency, due to the intrinsic hyperfine coupling between the nitrogen nuclear spin and the electron spin, which all respond identically to an external field.
The work presented in this article therefore investigates NV ensemble-specific ODMR spectra with particular emphasis on delineating an optimum modulation function of the microwave field drive for cw-ODMR sensing. This is carried out by first describing the characteristic NV cw-ODMR spectrum, followed by a description of frequency modulated lock-in detection. Finally, experimental and theoretical results are compared and discussed, which show that the optimum modulation function and depth are dependent on the linewidth-to-separation ratio of the measured peaks.

Continuous-wave spectrum
All cw-ODMR measurements presented in this article are carried out using an ensemble of native 14 NV − in an untreated single-crystal diamond (Element 6) grown using chemical vapour  The electronic structure is comprised of a triplet state ( 3 A 2 ↔ 3 E) and a singlet shelving state ( 1 E ↔ 1 A 1 ). The 3 A 2 state levels can be coherently driven with the application of a MW drive with a Rabi frequency Ω, while above band excitation is carried out with a rate Γ p , with the optical excitation processes being almost perfectly spin conserving. The spin levels are split with the introduction of a magnetic field, and couple with the nuclear spin of the N atom, generating an additional two or three hyperfine levels depending on the N isotope. These hyperfine levels are evident in cw-ODMR as shown in the measured spectra (b,i,ii) from an NV ensemble, where a weak magnetic field (∼ 5 mT) has been applied to spectrally separate the distinct crystallographic sub-groups. The dotted blue lines are fits using equation (4) with the parameters Γ p /2π 20 kHz, Ω/2π 30 kHz, and γ * 2 /2π 700 kHz for 14 N, and Γ p /2π 50 kHz, Ω/2π 100 kHz, and γ * 2 /2π 1 MHz for 15 N.
deposition (with the exception of the spectrum shown in Fig. 1(b,ii), which was measured from a custom-grown diamond with an isotopically purified nitrogen source to produce an ensemble of 15 NV − ). The NV centre is a coupled pair of defects within a diamond carbon lattice, consisting of a substitutional nitrogen atom and a point vacancy. The defect pair exists in both a negatively charged and neutral configuration, as well as in two different isotopic forms of 14 N and 15 N. While both the neutral and charged state fluoresce, it is the negatively charged state which possesses a spin triplet configuration because of its extra electron, resulting in a magnetic-dipole transition with magnetically tunable spin levels [21]. The energy levels of the most relevant transitions are shown in Fig. 1(a). Coupled with a near-perfect spin-conserving optical dipole of the NV centre, an optical-contrast spectrum (S cw (ω c ), Fig. 1(b)) of the spin resonances can be generated by simultaneously shining light and sweeping the frequency of an applied microwave (MW) field across the spin Larmor frequency. This presents itself as magnetically sensitive probe, which changes its resonance frequency, and therefore its fluorescence rate, as a function of γ e B z , where γ e ∼ 28 MHz/mT is the electron gyromagnetic ratio, and B z is a magnetic field vector component projected along the crystallographic axis of the NV defect. The use of a single or ensemble of spins has direct implications on the apparatus used, and the overall sensitivity. For single NV spins, the amount of light generated is within the ∼ 0.05 pW range, which falls within the working limits of single photon counting avalanche photodiodes (APD). These usually give excellent signal-to-noise ratios due to their low intrinsic noise levels, and do not require additional lock-in detection provided that the noise in the driving fields or environment do not exceed the shot-noise level. Single spins have a sensitivity ultimately limited to ∼ nT/ √ Hz, when using pulsed sensing protocols (for continuous wave protocols it is in the order of ∼ 100 nT/ √ Hz), and provide nano-scale sensor resolution. If such spatial resolution is not required using an ensemble of spins boosts the sensitivity by 1/ √ N, where N is the number of spins used [13]. However, dense ensembles (> 1 ppm NV) prepared through conventional irradiation and annealing techniques usually display a degraded collective ODMR linewidth due to inhomogeneous broadening and the increased susceptibility to static and driving field inhomogeneities [22]. Furthermore, the generated light from an ensemble is usually beyond the working limits of conventional APDs, and the use of pin-type photodiodes is necessary which are inherently noisier then APDs. For dense ensembles, fluorescence rates in the mW range can be obtained which usually allows for a shot-noise limited noise floor to be reached, however the degraded linewidth and the introduction of inhomogeneity-related degradation for higher density ensembles [22] implies that there may be an optimum balance between NV density and resulting sensitivity. In the low-density case ( 1 ppm NV), an enhanced fluorescence rate can be achieved without too much degradation of the collective coherence/linewidth. However, the inherent cw-ODMR contrast for an ensemble of NVs of a single crystallographic orientation is usually around 1-3% [11], so the working signal-to-noise ratio needs to exceed this limit. Lock-in detection is therefore ideal for tackling these latter issues, usually allowing for a shot-noise limited spectrum to be achieved when optimally driving a low-density ensemble, while maintaining a linewidth that closely resemble those obtained from single NV defects.
By continuously applying a MW drive on the steepest part of S cw (ω c ), and monitoring the level of fluorescence, the presence, frequency, and relative amplitude of a magnetic field can be deduced. The absolute sensitivity δB of such a detection process is proportional to [d ω S cw γ e ] −1 , where d ω S cw is the derivative of S cw (ω c ) at a particular drive frequency ω c /2π [7]. The relevant electronic levels that bring about the characteristic S cw (ω c ) spectrum are summarised in Fig.  1(a). The system ground state spins are driven by a coherent MW field with a drive frequency ω c /2π and a Rabi frequency Ω/2π, together with an above-band excitation rate Γ p /2π, in this case considered for a 532 nm wavelength laser. This wavelength ensures that the NV − NV 0 charge state fluctuation rate is small in comparison to the NV − fluorescence rate [23]. There is an intrinsic hyperfine interaction between the nitrogen nuclear spin and the electron spin of the NV centre which results in two or three hyperfine resonances depending on the nitrogen isotope, as summarised in Fig. 1. The resulting S(ω c ) spectra are shown in Fig. 1(b), with the spectra of the sample used throughout the remaining article shown in Fig. 1(b,i).
A schematic of the experimental setup is shown in Fig. 2(a). A signal generator (Stanford Research Systems SG394) is used to deliver a modulated drive frequency ω c /2π to an antenna placed close to the diamond sample. The diamond is excited with a 532 nm laser (Verdi SLM Coherent), and the fluorescence is collected using a condenser lens, filtered using a long-pass filter with a 600 nm cut-on, and detected using a biased Si detector (Thorlabs DET36A, with a 10 kΩ load, resulting in a bandwidth of 400 kHz). The excitation volume is in the order of 10 −2 mm 3 with an estimated number of 10 9 NVs. The measured full-width at half-maximum of an individual hyperfine transition is γ/2π ∼ 1 MHz, which was well fitted with a linear combination of a Lorentzian and a Gaussian profile (a pseudo-Voigt function) which is ∼98% Lorentzian and ∼2% Gaussian. This indicates that the in-homogeneous broadening is negligible, and the spectra can be confidently analysed using Lorentzian functions. The detector sends the signal to a two-channel digital lock-in amplifier (Stanford Research Systems SR850), while the MW drive frequency ω c /2π is modulated at ν = 30 kHz, for which this frequency was confirmed to be in a flat part of the optical power spectrum, and well within the detectors bandwidth. While the lock-in detector has a bandwidth up to 100 kHz, no further gain was achieved in the signal-to-noise ratio when modulating beyond 30 kHz, beyond which also a reduction in the lock-in signal amplitude is observed due to the limitations of the NV ensemble re-polarisation rate (set by the excitation rates used). Simultaneous excitation of all three hyperfine transitions of 14 NV − is carried out by mixing the modulated MW with a frequency equivalent to the axial hyperfine constant of 14 NV − , which is A = 2.16 MHz.
The S cw (ω c ) spectrum of an NV ensemble can be simulated using a set of optical Bloch equations, by considering a single spin transition (e.g. |m s = 0 ↔ |+1 ) in a total of five levels as shown in Fig. 1(a), with the Hamiltonian: Only the dominant decay paths considered are highlighted in red in Fig. 1(a), and only the ground-state level transition (|1 ↔ |2 ) is described in terms of a coherent resonant drive. In a rotating reference frame with ω c and using the rotating-wave approximation, the optical Bloch equations are: where δ = (ω c − ω 0 ) is the detuning between ω c and the spin transition frequency ω 0 and ρ ii is the normalised population of a level, while the total dephasing rate is defined as a sum of the longitudinal spin relaxation rate k 21 , pure dephasing rate γ * 2 , and the optical pump rate through γ 2 = k 21 /2 + γ * 2 + Γ p /2. A unit-less, detuning-dependant cw-ODMR fluorescence ratio can then be described in terms of the steady-state populations of the excited states |3 and |4 : The exact steady-state solution for equation (3) where R 0 is the off-resonance detection rate, and m I is the nuclear quantum number which spans either {−1, 0, 1} for 14 N or {− 1 2 , 1 2 } for 15 N. Equation (4) sufficiently reproduces experimentally observed cw-ODMR spectra, in particular as it accounts for power-related broadening and the dependence of the linewidth/contrast ratio to the spin excitation and polarisation rates. It is used as a basis for all simulations presented in this article, where the simulated fluorescence contrast and linewidth are an outcome of the given excitation rates, rather than postulated values. Through our measurements, we observe that using this model with rates measured from a single NV [24] can successfully represent a low density NV ensemble, and routinely obtains excellent agreement between the generated and measured spectra, as shown in Fig. 1(b,i,ii).

Lock-in spectrum
Generally, an ideally modulated signal can be decomposed as a sum of a static and time-varying component which is a product of a time-independent amplitude and an oscillatory function (i.e. V(t) = V 0 + A cos(2πνt + φ(t))). A modulated cw-ODMR signal recorded with a photo-detector can therefore be described to first order as the sum of the unmodulated steady-state spectrum (4) and a product of two complex phasors rotating in opposite directions, with a time-invariant amplitude also defined by (4): where ϕ s is the signal phase. Using (5), a lock-in signal S LI can be described as a time integrated product of a mixed reference signal S re f and a measured input signal S cw , both modulated at a frequency ν, with an amplification gain factor A, as highlighted in Fig. 2(a): where the static component in (5) is removed by the lock-in bandpass filter at its input, and the remaining signal is then re-normalised and multiplied with a sinusoidal reference signal S r e f = e −i(2πνt+ϕ r ) with a phase difference φ = ϕ s − ϕ r , and integrated in time using a low-pass filter with a time constant τ. The integral results in a complex function of the amplified input signal which can be decomposed into an in-phase (X) and quadrature (Y ) component: These can be measured individually using a two-channel lock-in detector, as schematically illustrated in Fig. 2(a). By measuring the quadratures simultaneously a phase-independent magnitude (R = √ X 2 + Y 2 ) can also be obtained. The decomposition of (5) and the resulting expression in (7) or (8) takes on different forms depending on the modulation mechanism. In the case of ODMR, modulation can be applied to either the MW drive, the bias magnetic field, or the polarising laser drive. Modulation of the MW drive is a technically convenient approach with respect to versatility and fine control, as it can usually be controlled directly from the MW source without repercussions for the rest of the experimental setup. Frequency modulation (FM) is preferable to amplitude modulation (AM) as it results in a dispersion line-shape of the spin resonance, which possesses its highest sensitivity (point of maximum slope) on resonance where the signal is zero, while also displaying an approximately linear response for small field changes. In contrast, AM results in a Lorentzian/Gaussian line-shape which possesses its highest sensitivity on the line-shapes side where the signal is not zero and therefore more susceptible to fluctuations and noise in the driving fields. An example of measured in-phase (X) lock-in ODMR spectra from an ensemble of 14 NV − using an AM or FM MW field is shown in Fig. 2 For FM imposed either through the drive frequency or the external bias magnetic field B z , the detuning δ becomes a function of time. Such a modulation can be either continuous or discrete, and may be represented by modulation functions that are either sine-wave (continuous, ∼) or square-wave (discrete, #), respectively: where J n is a Bessel function of the first kind of order n, ∆ω is the frequency modulation depth and β = ∆ω/2πν is the modulation index. Analysis of the Fourier spectrum of these two functions, shown in Fig. 2(c), provides direct insight into their characteristics. The change in the frequency spectrum as function of β for a fixed ν is stark: B ∼ (t) disperses its power over increasingly larger number of frequency components, while for B # (t) the power remains largely within the two ∆ω separated frequencies. Although the bandwidth needed to analytically describe B ∼ (t) is infinite, ∼99% of the modulated signal power is present in approximately n β frequency components separated by at most nν from the central carrier frequency [25]. With these FM functions in mind, expression (6) can be reformulated in terms of S cw (ω c (t)) using a Taylor series expansion about ω c . This results in an approximation of the in-phase/quadrature components X/Y as the difference between two or n out-of phase spectra separated by ∆ω or ν, respectively. When φ = 0, the in-phase X output for both modulation functions are: With the presence of the hyperfine transitions and their considerable overlap, an increased contrast can be achieved by simultaneously exciting all of them. The enhancement of the slope is verified to be in the order of 2 -3 times depending on the excitation and dephasing rates, and is obtained by mixing ω c with a frequency equal to the hyperfine separation. For 14 NV, this generates the in-phase X lock-in spectrum shown in Fig. 2(b,iii). Analytically, this modifies the expressions (11) and (12) with an additional summation over the number of frequency components m x (which is equal to m I ):

Single and multiple frequency modulation
Given the finite linewidth γ of the individual hyperfine transitions and the constant spectral separation between the hyperfine lines A , the optimal modulation depth ∆ω is expected to occur within the frequency span of all the hyperfine transitions ∼ 2A . Exactly what modulation depth and function is optimal will then depend on γ, which is dependent on both the intrinsic properties of the diamond, and extrinsically on the excitation rates Γ p and Ω.
To investigate the dependence of the sine-and square-type modulation functions on the maximum achievable slope, we measure the in-phase X spectrum and its maximum absolute slope max{|d ω X F M |} as a function of modulation depth ∆ω. These are shown in Fig. 3(a) for single-frequency sine, and in Fig. 3(b) for square-wave modulation, in comparison to simulated spectra using equations (11) and (12). There is very good agreement between the measured and theoretical spectra, particularly as the subtle difference between square-wave and sine-wave modulation is reproducible. Figure 3(c) plots max{|d ω X F M |} for either modulation function for both experimental and theoretical trends. These trends show that, for the given ensemble and measurement parameters, sine-wave modulation gives an optimum max{|d ω X F M |} when ∆ω/2π is ∼ 0.5γ of a single hyperfine-transition peak (∼ 1 MHz), while square-wave modulation exceeds this when ∆ω/2π is larger than the full span of the three hyperfine lines at around ∆ω/2π ∼2.5 MHz. This difference is due to two factors, which include the ratio between γ and the frequency separation (ξ = γ/2π A ), as well as the spectral characteristics of the two modulation functions. Because for a sine-function the MW power is dispersed across a larger bandwidth as the modulation depth is increased, max{|d ω X F M |} is reduced because of the decreasing amplitude. While this should be compensated for by increasing ν to maintain a constant β, this is impractical as ν is usually chosen beforehand on the basis of the inherent noise spectral density and the bandwidth limitations of the apparatus and the system itself. In comparison, square-wave modulation is by definition discrete, and the distribution of power is, to first order, independent of the modulation parameters. A drawback with square-wave modulation is that when mixing with a sine-wave reference, multiple odd harmonics are generated. This degrades the demodulated amplitude by a factor which is dependent on the signal composition, as some of the power is distributed into these odd harmonics. However the power loss through this mechanism is negligible compared to the amplitude decrease when increasing ∆ω of a sine-wave modulated spectrum. The in-phase X spectrum generated when all hyperfine lines are simultaneously excited is shown for sine-wave modulation in Fig. 4(a), and for square-wave modulation in Fig. 4(b), in comparison to the simulated spectra using equation (13). In contrast to single-frequency excitation, max{|d ω X A |} is obtained for a ∆ω that is around half of γ for both modulation functions and the given ensemble and measurement parameters, as highlighted in Fig. 4(c). The discrepancy in this case is related to the effect of the enhanced contrast on |d ω X | in relation to ξ, as discussed in the following section.

Projected modulation function trends
In order to study how the modulation function influences the lock-in signal slope, the dependence of the unmodulated signal slope on the optical and MW excitation rate needs to be assessed. Prior to lock-in detection, the linewidth γ and therefore the slope |d ω S cw | is dependant on the excitation ratio Ω:Γ p , and the effective dephasing rate γ 2 . In particular max{|d ω S cw |} is obtained when the depletion rate of the spin levels 3 A 2 by Γ p is large enough to circumvent the effects of MW power broadening, yet below the pure dephasing rate γ 2 * [26, 27]. This is simulated in Fig.  5(a) which plots |d ω S cw | as a function of Ω and Γ p , and shows an almost 1:1 correspondence for Ω:Γ p is required to achieve an optimum slope for a given γ * 2 /2π 500 kHz. The optimum point of max{|d ω S cw |} is highlighted by a star, and using these driving rates, |d ω X F M | is studied as a function of ξ and ∆ω for both modulation functions and isotopic forms of the NV center. These are plotted as a function of ξ and ∆ω for single-frequency excitation in Fig. 5(b).
Despite the stark difference between the modulation functions excitation spectrum (shown in Fig. 2(c)), it is the ratio ξ which is observed to be the limiting factor when generating the maximum obtainable slope max{|d ω X F M |}. As ξ approaches 1/4 for both 14 NV and 15 NV, the inherent overlap of the hyperfine lines degrades the |d ω X F M | values in the region between the peaks, while increasing the overall amplitude and therefore enhances |d ω X F M | on the sides of the peak generated by the sum of all the hyperfine lines. As such, for ξ > 1/4, square-wave modulation outperforms sine-wave modulation, and the optimum ∆ω will be the full span of all the hyperfine transitions. For ξ < 1/4, the difference between square-and sine-wave modulation is negligible, and the optimum ∆ω remains within γ for both modulation functions, at values equivalent to A for square-wave modulation. Given the inherent A values of NVs, these ratios translate into γ/2π of ∼ 0.5 MHz for 14 NV, and ∼ 0.8 MHz for 15 NV. Ultimately, this implies that square-wave modulation is the optimum choice when γ exceeds these values, to maximise |d ω X(ω c )|, and thereby the achievable sensitivity δB ∝ [d ω X(ω c )γ e ] −1 .
From these simulations, it is evident that the optimum ∆ω is dependent on the relative variation of |d ω X F M | within the spectrum: the more 'smeared' a spectrum is, the larger ∆ω is needed to optimise |d ω X F M |. As such, exciting all three transitions increases the contrast without significantly affecting the relative |d ω X F M | throughout the spectrum, thereby offsetting ξ to larger values. For simultaneous hyperfine level excitation, a larger ξ ratio is therefore required for square-wave modulation to be advantageous. The simulations highlight a threshold that is increased by a factor proportional to the number of excited hyperfine lines m I . This behaviour is highlighted in Fig. 6 where max{|d ω X A # |} occurs at a modulation depth that is larger than the inherent linewidth only when ξ > 3/4. Ultimately, it should be emphasised that with an increase in ξ, max{|d ω X |} is inherently degraded. The optimum scenario will therefore always occur with three-frequency excitation and ensembles possessing as low a ξ ratio as possible, for which there is no advantage in using either modulation function.

Conclusion
In this work we identify the optimum lock-in modulation parameters for obtaining the steepest spectral slope in the ODMR spectra measured from a low-density ensemble of 14 NV, for the purpose of cw-sensing of magnetic fields. Experimental measurements of the in-phase lock-in spectra from a 14 NV ensemble as a function of modulation depth and modulation function highlighted the advantage of square-wave modulation for the given sample. This also provided an assessment check for the spectral simulations based on a five-level set of optical Bloch equations and its reformulation in terms of a modulated drive frequency. Through accounting for the spectral difference of the modulation functions, this model was able to accurately reproduce the experimentally observed subtleties in the lock-in spectra. Their correspondence provides confidence to the simulated projections, which highlight the key relationship between ∆ω and ξ. In particular, this showed that for single-frequency excitation when ξ 1/4, square-wave modulation is optimal with a ∆ω which spans the sum of all the hyperfine linewidths. Below this threshold, there is no significant advantage in using either modulation functions. For NVs, this translated into linewidth limits of ∼ 0.5 MHz for 14 NV, and ∼ 0.8 MHz for 15 NV. Ultimately, the model indicates that an optimum slope will always be achieved with as low a ξ ratio as possible, with multi-frequency excitation and a modulation depth that is within the hyperfine linewidth, irrespective of the modulation function. It is anticipated this analysis will benefit the development and optimisation of NV-based sensing schemes and devices, while the simplicity of the presented model should allow for its easy re-modification for alternative systems with different spectral properties. This is envisaged especially as many off-the-shelf NV ensembles display poor ξ ratios, and the production of optimised isotopically-pure diamonds is resource and time intensive. Aside from this, the relationship delineated here may be relevant to any spectral measurement or cw-sensing scheme which uses closely-spaced spectral features that respond identically to external perturbations.