In the simulations performed thus far, the limitation has been decoherence and the strength of the magnetic field to be detected. One of the methods to reduce decoherence is dynamic decoupling [1]}, [2]}, [3]}, [4]}, [5]}, [6]}, [7]} which involves the use of pulse sequences such as the Carr-Purcell-Meiboom-Gill (CPMG) pulse sequence. The applied pulses keep on flipping the sign of the NV center-spin bath interaction Hamiltonian, which, if done in rapid succession, can effectively eliminate the effect of the spin bath. Unfortunately, the effect of a static field is also removed. However, for an oscillating field the direction of the magnetic field also continues to change direction allowing its detection using dynamic decoupling protocols, provided that we apply the pulses at (or near) the nodes of the magnetic field to allow the accumulation of the phase difference. In particular, the CPMG sequence is characterised by \([U(\tau /2)R(\pi )U(\tau )R(\pi )U(\tau /2)]^{N/2}\) , meaning that we allow the NV center to evolve freely for time \(\tau /2\) , then apply a control pulse defined by \(R(\pi )=e^{-i\pi \sigma _x /2}\) , followed by further evolution for time \(\tau \) . This cycle is repeated \(N/2\)  times, where \(N\)  corresponds to the number of pulses applied. The magnetic field to be detected has the form \(B(t)=b_0 \cos {(2\pi ft)}\) , and we assume a Gaussian distribution for the amplitude. To ensure that the pulses are applied at the nodes we set \(\tau =1/2f\) . We then find \(\mu =e^{-i2N\gamma b_0/f}e^{-2N^2\gamma ^2\sigma _{b}^2/f^2}\) . The computation for \(\nu \)  is more challenging. In the presence of pulses, \(\nu =\langle \exp [-i\int _{0}^{T}\xi (t)B_d(t)dt]\rangle \)  where \(\xi (t)\)  can assume values of \(+1\)  and \(-1\)  - the switching of the sign account for the action of a pulse. It can then be shown that \(\nu =e^{-\kappa ^2W(T)}\)  with \(W(T)=\int _{0}^{T}e^{-Rs}p(s)ds\) , where \(R=1/\tau _c\)  and \(p(s)=\int _{0}^{T-s}\xi (t)\xi (t+s) dt\) . With full derivations available in Refs. [8]}, [9]}, [10]}, the expression of \(\nu \)  can be calculated allowing us to find the number of pulses \(N\)  that would maximize the confidence of the measurement. The results for the case where \(f=1\)  MHz is given in Figs.REF -REF . As we can see from these figures, the effect of the CPMG pulses reduces the effect of decoherence, making the values of \(\nu \)  remain much closer to one. This consequently leads to considerably high levels of confidence in our measurements for \(b_0=1\mu T\)  compared to the static case. However, similar to the static case, a greater spread in the magnetic field corresponds to our detectors becoming biased towards giving one result with better confidence.
<FIGURE>