# Sub-second Temporal Magnetic Field Microscopy Using Quantum Defects in
Diamond

Madhur Parashar  Information Processing Laboratory, Department of Electronics
and Electrical Communication Engineering, Indian Institute of Technology
Kharagpur, Kharagpur, West Bengal, India -721302  School of Medical Science
and Technology, Indian Institute of Technology Kharagpur, Kharagpur, West
Bengal, India - 721302  Anuj Bathla  Department of Electrical Engineering,
Indian Institute of Technology Bombay, Mumbai, Maharashtra, India-400076
Centre for Research in Nanotechnology and Science, Indian Institute of
Technology Bombay, Mumbai, Maharashtra, India-400076  Dasika Shishir
Department of Electrical Engineering, Indian Institute of Technology Bombay,
Mumbai, Maharashtra, India-400076  Alok Gokhale  Department of Electrical
Engineering, Indian Institute of Technology Bombay, Mumbai, Maharashtra,
India-400076  Sharba Bandyopadhyay  Information Processing Laboratory,
Department of Electronics and Electrical Communication Engineering, Indian
Institute of Technology Kharagpur, Kharagpur, West Bengal, India -721302
Kasturi Saha  Department of Electrical Engineering, Indian Institute of
Technology Bombay, Mumbai, Maharashtra, India-400076<EMAIL_ADDRESS>
###### Abstract

Wide field-of-view magnetic field microscopy has been realised by probing
shifts in optically detected magnetic resonance (ODMR) spectrum of Nitrogen
Vacancy (NV) defect centers in diamond. However, these widefield diamond NV
magnetometers require few to several minutes of acquisition to get a single
magnetic field image, rendering the technique temporally static in it’s
current form. This limitation prevents application of diamond NV magnetometers
to novel imaging of dynamically varying microscale magnetic field processes.
Here, we show that the magnetic field imaging frame rate can be significantly
enhanced by performing lock-in detection of NV photo-luminescence (PL),
simultaneously over multiple pixels of a lock-in camera. A detailed protocol
for synchronization of frequency modulated PL of NV centers with fast camera
frame demodulation, at few kilohertz frequencies, has been experimentally
demonstrated. This experimental technique allows magnetic field imaging of
sub-second varying microscale currents in planar microcoils with imaging frame
rates in the range of 50 to 200 frames per second (fps). Our work demonstrates
that widefield per-pixel lock-in detection of frequency modulated NV ODMR
enables dynamic magnetic field microscopy.

##  1 Introduction

The past decade has seen a revolution in high-resolution diffraction-limited
microscale and wide field-of-view magnetometry based on optically detected
magnetic resonance (ODMR) imaging of Nitrogen Vacancy (NV) defect centers in
diamond [1, 2, 3, 4, 5, 6]. These room-temperature ultra-sensitive diamond NV
magnetometers [7, 8, 9, 10] have enabled a new class of magnetic field
microscopy, for example - probing magnetic particles in living cells [3, 11],
imaging fluid-like current flow in graphene [6, 12], microscopy of novel
quantum materials [13] and rapidly evolving other applications [14, 15, 16,
17]. In diamond NV-based widefield magnetic field (WMF) imaging, red photo-
luminescence (PL) emitted from a microscale volume of NV centers is collected
and imaged on to a conventional scientific CMOS or CCD camera. Microwave (MW)
resonant frequencies applied to NV centers create changes in NV fluorescence
and the precise estimation or tracking of these resonant MW frequencies yields
a 2D microscale magnetic field map. The changes in magnetic field experienced
by small microscopic volumes of NVs in the diamond crystal get mapped to
corresponding pixels on the camera pixel array. However, magnetic field images
acquired by this method have remained temporally static in nature, demanding
few to several minutes of acquisition time for each image frame [4, 11, 6].
Inherently low NV ensemble resonance contrast and division of informative NV
light onto thousands to millions of pixels significantly decrease per-pixel
signal-to-noise ratio (SNR) and consequently the magnetic field sensitivity.
NV imaging frame rate for DC to low-frequency magnetometry is fundamentally
limited by the NV’s optical re-polarization rate i.e. $\sim$
$1\text{\,}\mathrm{MHz}$. However, practical SNR bounds have limited imaging
frame rates to primarily static magnetic field maps. Development of high-
spatially-resolved and high-frame-rate imaging capabilities will enable new
applications of NV centers to investigate processes like vortex dynamics in
superconductors [18], estimating fluctuating magnetic fields from quantum
materials [13], magnetic nano-particle motion in living cells [11, 19] and
imaging mammalian action potential associated magnetic fields [20, 21, 22,
23].

Detection of weak signals embedded in noise hinges on smart techniques such as
the lock-in amplification method, wherein a near-DC or slowly varying signal,
mainly submerged in $1/f$ noise, can be periodically modulated and filtered
from a narrow band while the noise spanning a large bandwidth can be
eliminated leading to significant improvement in signal-to-noise ratio. Pico-
Newton scale resolution in atomic force microscopy [24] and high sensitivity
magnetometry in SQUIDs and atomic magnetometers [25] are testament to this
detection methodology. With the advent of lock-in cameras [26], parallel per-
pixel lock-in detection of optical light can be performed over many pixels. In
contrast to conventional cameras, the lock-in cameras require synchronized
external triggers to perform light integration over specific time windows for
each pixel. Intensity measured during these externally timed windows can be
used to subtract DC components and estimate the frequency content of the
optical signal. With these high frame rate lock-in cameras, new improvements
have been observed in techniques where light can be frequency or phase
modulated, e.g., deep tissue optical coherence tomography (OCT) [27] and
ultrasound-modulated OCT [28] and other avenues [29, 30]. NV’s emitted light
can be frequency modulated by microwave control of NV resonance [31].
Frequency modulated optically detected magnetic resonance (fm-ODMR) schemes
for NVs have been used for real-time single point (SP) bulk magnetometry [32,
33, 20, 34, 22], where total emitted NV light is collected onto a single
photodetector and also for boosting DC-magnetic field sensitivity. A prior
work on camera review [35] has also suggested potential application of high-
frame rate lock-in camera to perform real-time NV imaging.

In this work, we demonstrate a novel per-pixel lock-in detection protocol that
enables dynamic millisecond scale magnetic field imaging in wide-field using
NV centers in diamond. The paper describes a procedure for synchronizing
camera frames of a commercial lock-in camera (Heliotis Helicam C3 [36]) with
NV microwave modulation to obtain fm-ODMR across thousands of pixels. Post
calibration of noise statistics and magnetic field sensitivity across
different pixels, we measured a median
$731\text{\,}\mathrm{n}\mathrm{T}\mathrm{/}\sqrt{\mathrm{Hz}}$ sensitivity per
pixel. To demonstrate spatially and temporally resolved magnetometry, we
perform imaging of microscale magnetic fields produced by current flow in two
different samples fabricated using e-beam lithography: first, a
$10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ track width gold (Au) microwire
with a $90\text{\,}\mathrm{\SIUnitSymbolDegree}$ bend and second, a square-
spiral planar microcoil of $10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ track
width and full dimensions of $100\text{\,}\mathrm{\SIUnitSymbolMicro m}$
$\times$ $125\text{\,}\mathrm{\SIUnitSymbolMicro m}$. We show dynamic
widefield magnetic field images obtained by probing periodically varying
current flow in the above samples at near 1Hz , 20Hz and 50Hz magnetic field
variations. Multi-pixel fluorescence time traces, scaled to magnetic field
values by NV resonance parameters, show expected magnetic field tracking.
These sub-second temporal magnetic field images are enabled by fast NV imaging
frame rates of 50 to 200 frames per second (fps). To further demonstrate a
general application of temporally varying magnetic fields, we show
millisecond-scale magnetic field images of current flow in the microcoil from
an arbitrary current waveform of varying amplitude and rapid inversion of
current direction where the entire event duration is
$\approx$$150\text{\,}\mathrm{ms}$. We discuss the coupling of imaging frame
rates and per-pixel SNR to the NV’s modulation frequency and the number of
signal averaging cycles. Our experimental results demonstrate that frequency-
locked widefield imaging of NV emitted light enables dynamic widefield
magnetic field imaging at frame rates ranging from $50200$fps. Recent work
towards dynamic NV widefield imaging [37, 38], employ more advanced microwave
pulse sequences based on double quantum protocols to significantly reduce
heterogeneity in resonant frequencies across imaging field of view which
enables high sensitivity magnetic field imaging. In contrast, our results
demonstrate high imaging frame rates with a relatively simpler protocol with
the application of single resonant MW frequency and could be potentially
relevant for a wide variety of NV based imaging applications and can be
further improved with spatial homogeneity of resonant frequencies across the
field of view. The scope of the work demonstrated in this paper is not limited
to just imaging single crystalline diamonds, but can also be extended to
perform improved temporal imaging of nanodiamonds in cellular environments
[39, 40, 41].

##  2 Experimental Methods

###  2.1 Magnetic Resonance in Nitrogen Vacancy Defects in Diamond

Negatively charged Nitrogen Vacancy defect centers are point localized
Nitrogen substitution of Carbon atoms in the diamond lattice with an adjacent
vacancy and an overall negative charge. Due to the unique electronic
properties of these vacancies [9], they are sensitive to external environment
changes like, magnetic field, electric field, strain and temperature. The
ground state is a spin-triplet with $m_{s}=0$ and a doubly degenerate
$m_{s}=+1$ and $m_{s}=-1$ in the absence of magnetic field with a zero field
splitting of $2.87\text{\,}\mathrm{GHz}$. The degeneracy of $m_{s}=+1$ and
$m_{s}=-1$ is lifted by Zeeman splitting in the presence of an external
magnetic field. Transitions to the excited state are spin conserved, however,
the relaxation from excited triplet state take two paths - a radiative spin
conserving path and a non-radiative decay via intersystem crossing (ISCs). The
radiative decay produces broadband red photo-luminescence with the zero-phonon
line centered at $637\text{\,}\mathrm{nm}$. The non-radiative ISCs are highly
spin-selective towards the $m_{s}=0$ spin sublevel. Therefore, continuous
optical excitation leads to electron spin polarization. Neglecting the
hyperfine interaction between the nuclear spin of the nitrogen atom the NV’s
electronic spin, the ground state NV Hamiltonian is given by

$H=hDS_{z}^{2}+hE\left(S_{x}^{2}-S_{y}^{2}\right)+g\mu_{B}B\cdot S,$ (1)

where, $h$ is the Planck’s constant, $D$ is the zero-field splitting,
$\mu_{B}$ is the Bohr magneton, $g$ is the gyromagnetic ratio, $E$ is the
applied electric field and the last term corresponds to the Zeeman term, with
$B$, the externally applied magnetic field. $S_{x},S_{y},S_{z}$ correspond to
the Pauli matrices for a spin-1 system. In the weak-field regime where
$\mathrm{B}_{\perp}\ll\mathrm{B}_{\|}$, the electron spin resonance
frequencies are given by

$\nu_{\pm}\left(B_{NV}\right)=D\pm\sqrt{\left(\frac{g\mu_{B}}{h}B_{NV}\right)^{2}+E^{2}}$
(2)

where, $B_{NV}$ is the component of the applied field parallel to the NV axis.
For cases where applied bias field is high enough to neglect the $E$ term, the
electron spin resonance frequencies vary linearly with the applied magnetic
field. Such a regime is ideal for sensitive magnetometry with diamond NV
centers.

Figure 1: Schematic of the experimental setup and protocol for data
acquisition: (a) Schematic describing the experimental setup for single
photodiode diamond NV magnetometry (SP) or widefield per pixel lock-in diamond
nitrogen-vacancy magnetometry (WMF) (b) Illustration explaining generation of
frequency modulated NV emitted red light by applying frequency shift key type
microwave resonant frequencies. The applied microwave resonant frequencies
shuttle between $\omega$ and $\omega-\omega_{dev}$ in sync with square wave
waveform of frequency $\omega_{mod}$. When the microwave frequencies are
resonant, the emitted NV red light is frequency modulated at $\omega_{mod}$
(c) Pulse protocol to control and synchronize the demodulation of internal
camera frames with modulation frequency of optical signal to obtain lock-in
in-phase (I) and quadrature (Q) images. A green laser illumination at 532-nm
is continuously on and frequency shift key microwave (MW) waveform with
modulation $\omega_{mod}$ is applied. Lock-in camera external trigger pulses,
controlling internal frame acquisition timings, are provided at
$2\omega_{mod}$, synced with MW modulation, where they define 4 quarters for
light integration $S_{1}S_{2}S_{3}S_{4}$. These four quarters of light
integration allow in-phase ($S_{1}-S_{3}$) and quadrature ($S_{2}-S_{4}$)
estimation of optical signal and are averaged over N cycles to give single
pair of In-phase image and Quadrature Image (IQ Frame)

###  2.2 Experimental Setup

Fig. 1(a) is an illustration of the experimental setup used to perform diamond
NV magnetometry. A non-resonant green light excitation at
$532\text{\,}\mathrm{nm}$ (Sprout Laser) is used to illuminate NV centers via
a $100\times$ objective (Olympus, MLPNFLN series). The excitation beam is
focused on the back focal plane of the objective to obtain $\sim$
$200\text{\,}\mathrm{\SIUnitSymbolMicro m}$ diameter spot size on the NV
layer. Optical power impinging the objective back aperture is
$\sim$$1.5\text{\,}\mathrm{W}$. We use an isotopically pure diamond crystal
(procured from Element Six) of lateral dimensions
$4.5\text{\,}\mathrm{mm}$$\times$ $4.5\text{\,}\mathrm{mm}$ and
$500\text{\,}\mathrm{\SIUnitSymbolMicro m}$ thick with a thin
$1\text{\,}\mathrm{\SIUnitSymbolMicro m}$ NV- implanted layer of 1-2 ppm NV-
concentration. The emitted light from NV centers is collected via the same
objective, filtered to select the red light (above $567\text{\,}\mathrm{nm}$)
and reject green excitation light at ($532\text{\,}\mathrm{nm}$ using a notch
stop filter (SEMROCK NF03-532E-25). The collected light is focused onto a
widefield lock-in camera (Heliotis Helicam C3) to perform widefield
magnetometry. The diamond sample is mounted on a microwave loop PCB, and
associated microwave electronics are used to deliver amplified microwave
frequencies in the range $\sim$ 2.5-3.2 $\text{\,}\mathrm{GHz}$. The applied
microwave frequencies follow frequency shift keying waveforms with square-wave
envelopes. The camera imaging frames are synchronized with the microwave
modulation with specific pulse sequences generated by a high-speed TTL pulse
generator card (SpinCore PulseBlaster ESR-PRO $500\text{\,}\mathrm{MHz}$).
Samarium-Cobalt (Sm-Co) ring magnets are used for applying a bias magnetic
field and have not been shown in the experimental schematic. Two microscale
conductive samples, a $\sim$$10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ track-
width microwire and a $\sim$$10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ track
width planar spiral microcoil was fabricated on two independent silicon
substrates. Sample patterning was done using e-beam lithography followed by
$100\text{\,}\mathrm{nm}$ thick deposition of Ti/Au. Typical resistances of
these structures were found to be $\sim$
$400\text{\,}\mathrm{\SIUnitSymbolOhm}$. These samples are mounted on a custom
PCB and wire-bonded to supply the drive voltage. The entire assembly was then
glued with Loctite (cyanoacrylate glue) to the diamond crystal. Due to the
back focal plane focusing, the 100X objective used in this work suffered a
damage in the center of the imaging field of view (FOV) because of high
optical intensity localized in a very small area. Consequently, a small number
of pixels in the FOV center have zero or minimal ODMR response and can be
observed as a small blank hole in all magnetometry related images (for example
see Fig. 3(a) and Fig. 4 (c),(f),(g)).

###  2.3 NV Frequency Modulation and Synchronization of Lock-in Camera

The generation of modulated NV light with frequency $\omega_{mod}$ in the fm-
ODMR protocol is shown via the schematic shown in Fig. 1(b). In a frequency
shift keying waveform, two microwave frequencies $\omega$ and
$\omega-\delta\omega$ are delivered via the MW resonator, where they shuttle
between each other with the square wave waveform of frequency $\omega_{mod}$.
For each MW frequency, the NV fluorescence settles to a steady-state value,
given by the NV’s resonance curve at the applied MW frequency. To measure the
amplitude of modulated NV PL, we perform lock-in detection of the collected
light at reference frequency $\omega_{mod}$. For the rest of the article, by
referring to the ’modulation frequency’ of NVs, we also mean the ’reference
frequency’ of the lock-in camera.

To synchronize the applied MW waveform with the camera’s internal frames, an
external reference signal of $2\omega_{mod}$, carefully synced to MW
modulation reference at $\omega_{mod}$, is provided to the camera’s external
trigger input, see Fig. 1(c). This TTL signal, of twice the modulation
frequency, defines the four quarter periods of the sensor light integration
whose values are denoted by $S_{1},S_{2},S_{3},S_{4}$. The in-phase signal is
$S_{1}-S_{3}$ and the quadrature signal $S_{2}-S_{4}$. Additionally, as shown
in the schematic Fig. 1(c), each cycle of demodulation is internally averaged
$N$ times to provide a pair of 2D images containing in-phase (I) and
quadrature (Q) values for each pixel. Therefore, to get a single 2D IQ image,
the total time is $(1/2\omega_{mod})*cyc$, which sets the imaging frame rate.
Further, since the NV signal scales with $\omega_{mod}$ different imaging
frame rates have different SNR as discussed later. The lock-in camera is
limited to frame rates of $3.2\text{\,}\mathrm{kHz}$ and a maximum
$250\text{\,}\mathrm{kHz}$ signal demodulation.

##  3 Results

###  3.1 Optically Detected Magnetic Resonance of Multiple Pixels

Figure 2: Frequency modulated optically detected magnetic resonance spectrum
(ODMR) of multiple pixels: (a) A 2D array of $300\times 300$ pixels have been
concatenated into a 1D array of pixels and their magnetic resonance responses
have been color coded. We observe 8 NV resonant frequencies across multiple
pixels, with each resonance feature further split into 2 peaks due to N15
hyperfine transitions. (b) Three randomly chosen pixels are used to
demonstrate individual pixel ODMR response. The baseline of the pixels,
centered at 0, has been shifted to represent them in the same plot. (c)
Example pixel ODMR response data recorded at $6.25\text{\,}\mathrm{kHz}$
modulation frequency and 122 frame averaging cycles. Each red dot represents
data at a single microwave frequency and the black curve represent non-linear
Lorentzian-derivative curve fit (d) Example pixel ODMR response data recorded
at $8.33\text{\,}\mathrm{kHz}$ modulation frequency and 82 frame averaging
cycles. Each red dot represents data at a single microwave frequency and the
black curve represents non-linear Lorentzian-derivative curve-fit. Reduced
ODMR zero-crossing slope can be observed at faster modulation frequencies.

Optically detected resonance spectrum of an ensemble of NV centers
corresponding to each pixel on the Helicam C3 Array is shown in Fig. 2(a). A
2D array of camera pixels have been concatenated into a 1D vector of pixels
and their lock-in ODMR response across multiple microwave excitation
frequencies have been color-coded. Three randomly selected pixel’s individual
ODMR traces have been shown in Fig. 2(b). For each pixel, the NV response
curve can be described by a Lorentzian function,

$f(\omega)=A\left[1-\frac{C}{\left[1+\left(\frac{\omega-\omega_{0}}{\Gamma}\right)^{2}\right]}\right],$
(3)

where $A,C,\Gamma,\omega,\omega_{0}$ denote baseline PL, contrast, the
linewidth of resonance, applied MW frequency, and resonant MW frequency of the
NV center respectively.The lock-in signal is proportional to the derivative of
the NV ODMR response curve given in Eq. (3). The derivative of the response
curve with an added baseline term was used to fit the lock-in ODMR response,
with examples shown in Fig. 2(c) and (d). To highlight the importance of NV
modulation frequency and frame averaging, two examples of ODMR traces (Fig.
2(c) and Fig. 2(d) acquired at different NV modulation frequencies
($6.25\text{\,}\mathrm{kHz}$ and $8.33\text{\,}\mathrm{kHz}$) and frame
averaging cycles (122 cycles and 82 cycles respectively) are shown. The slope
at the zero-crossing point of the fm-ODMR response curve along with the noise
floor are critical factors that determine the magnetic field sensitivity of
individual pixels. In agreement with previous studies [31], we observe reduced
zero-crossing slope at higher modulation frequency due to reduced NV
interaction time with the resonant microwave frequencies, oscillating between
$\omega$ and $\omega-\omega_{dev}$. The camera pixel readout noise grows with
square root of number of the demodulation cycles (HelicamC3 datasheet). This
factor introduces a trade-off between the NV response signal and the noise
floor with different parameters. Further, the imaging frame rate is dependent
on the ratio between modulation frequency to averaging cycles (see Methods,
HelicamC3 synchronization), and hence is coupled to the SNR of the NV’s ODMR
response.

###  3.2 Magnetic Field Sensitivity and Static Imaging

Figure 3: Per-pixel sensitivity: (a) Measured 2D map of sensitivity of all
responsive pixels. Due to the Gaussian nature of the beam spot, the SNR drops
in the outer periphery of the field-of-view(FOV). Pixels with sensitivity
better than 3$\mu T/\sqrt{Hz}$ have been included. Some pixels at the center
of FOV are non-responsive due to a damage in the objective. (b) Histogram of
sensitivity of all responding pixels, with median sensitivity of
$731\text{\,}\mathrm{n}\mathrm{T}\mathrm{/}\sqrt{Hz}$.

As evident from the two example ODMR traces at different acquisition rates,
the noise statistics and fm-ODMR signal of pixels can vary significantly with
varying image acquisition parameters. Typically, the sensitivity of a sensor
is defined by the ratio of uncertainty in the measurement to the maximum slope
point i.e.the point of operation of the sensor where the smallest perturbation
in the input creates a maximal change in the output of the sensor.
Specifically, for fm-ODMR the slope is maximum at the zero-crossing of the
lock-in output, also corresponding to the resonant frequency of NV centers.
Therefore, the magnetic field sensitivity is defined as:

$\eta=\frac{\sigma\sqrt{\tau}}{\left.\frac{dV_{\text{lock
}}}{df}\right|_{V_{\text{lock }}=0,f=\omega_{\text{res }}}}$ (4)

where $\sigma$ is the standard deviation of measurement (voltage for lock-in
amplifier or arbitrary units for camera) and $\tau$ is the measurement time of
the signal and f is the frequency. The denominator denotes the slope at the
resonant frequency $\omega_{res}$.

To acquire the $\sigma$ for individual pixels, sixty imaging frames were
acquired and the mean and standard deviation of each pixel’s intensity were
recorded. Example noise spectrum of WMF pixels as a function of lock-in
modulation frequencies have been shown in Supplementary Fig. S1(b),(c) along
with a typical $1/f$ noise spectrum of a single-photodiode (SP) lockin
measurement (Supplementary Fig. S1(a). The WMF $\sigma$ spectrum for most
pixels remained approximately flat, as compared to the SP $\sigma$ spectrum,
between modulation frequencies of 3-100 $\text{\,}\mathrm{kHz}$, with mean
value of 1.95 units (out of 10-bit 1024 point scale) for all pixels in Fig.
S1(c). Since the minimum possible camera modulation frequency is
$2.2\text{\,}\mathrm{kHz}$, most of the low-frequency noise is eliminated in
the WMF noise spectrum. For WMF imaging experiments
$\tau=(1/\omega_{mod})*n_{cyc}$, where $n_{cyc}$ is the number of frame
averaging cycle. To measure the zero-crossing slope an ODMR spectrum is
measured with a frequency resolution of ($100\text{\,}\mathrm{kHz}$). The
slope at zero-crossing for each pixel is then obtained by non-linear curve
fitting and the corresponding 2D sensitivity map is shown in Fig. 3(a),
depicting a spatial variation of pixel sensitivity by evaluating Eq. (4) for
each pixel. The pixel response mimics the excitation profile. As expected,
pixels with high response, fall within the central region of the FOV and
pixels with low or no response, fall towards the outer periphery of the NVs PL
intensity profile. The distribution of per-pixel sensitivity is shown in
Fig.3(b) where a median pixel sensitivity of
$731\text{\,}\mathrm{n}\mathrm{T}\mathrm{/}\sqrt{\mathrm{Hz}}$ is observed.
Only pixels with sensitivity more than
$3\text{\,}\mathrm{\SIUnitSymbolMicro}\mathrm{T}\mathrm{/}\sqrt{\mathrm{Hz}}$
have been considered due to the low ODMR response at the outer periphery of
the beam. Additionally, before the curve fitting for each pixel, a selection
threshold was applied to select pixels with a minimum threshold level of fm-
ODMR response (see Supplementary notes, per-pixel raw data processing) and
only the responding pixels were further analyzed.

Figure 4: Static magnetic field images of the microwire and the microcoil
sample: (a) Color microscope image of the U shaped microwire sample. Microwire
track width is $10\text{\,}\mathrm{\SIUnitSymbolMicro m}$. Scale Bar
$200\text{\,}\mathrm{\SIUnitSymbolMicro m}$. Inset shows the
$90\text{\,}\mathrm{\SIUnitSymbolDegree}$ bend feature which has been imaged.
(b) Simulation of single NV-axis magnetic field map of the
$90\text{\,}\mathrm{\SIUnitSymbolDegree}$ bend feature of the microwire, at a
standoff $13\text{\,}\mathrm{\SIUnitSymbolMicro m}$ and current
$2.4\text{\,}\mathrm{mA}$. Scale bar $40\text{\,}\mathrm{\SIUnitSymbolMicro
m}$. Black square indicates the approximate NV magnetic field imaging field of
view location. (c) Experimentally measured magnetic field image of the
microwire with $2.4\text{\,}\mathrm{mA}$ current flow, about the same NV axis
as shown in simulation. Scale bar $27\text{\,}\mathrm{\SIUnitSymbolMicro m}$.
(d) Color microscope image of the microcoil sample with metal track width
$10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ and overall dimensions
$100\text{\,}\mathrm{\SIUnitSymbolMicro m}$$\times$
$125\text{\,}\mathrm{\SIUnitSymbolMicro m}$ . Scale bar
$50\text{\,}\mathrm{\SIUnitSymbolMicro m}$. (e) Simulation of the single NV-
axis magnetic field map of the microcoil, at standoff
$14\text{\,}\mathrm{\SIUnitSymbolMicro m}$ and
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$ current flow. Sample geometry,
translucent gray lines, has been scaled to simulation field image and overlaid
for easy comprehension of the current flow path. Scale Bar
$40\text{\,}\mathrm{\SIUnitSymbolMicro m}$. (f) Experimentally obtained single
axis magnetic field image of the microcoil for positive direction
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$ current flow, about the same NV
axis as shown in simulation. Scale Bar $34\text{\,}\mathrm{\SIUnitSymbolMicro
m}$. (g) Experimentally obtained single axis magnetic field image of the
microcoil for negative direction $500\text{\,}\mathrm{\SIUnitSymbolMicro A}$
current flow, about the same NV axis as shown in simulation. Scale Bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$.

Spatial and temporal resolutions are inherently coupled in diamond NV
microscopy. We verify magnetic field image formation with static acquisition
(5-10 minutes) for two microscale samples, one
$10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ track width microwire and one
spiral microcoil of $10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ track width and
overall dimensions of $100\text{\,}\mathrm{\SIUnitSymbolMicro m}$$\times$
$125\text{\,}\mathrm{\SIUnitSymbolMicro m}$ , as described earlier in methods.
The two sample images are shown in Fig. 4(a) and Fig. 4(d). Magnetic field
images, projected onto a single NV axis, of these samples were formed by
$100\text{\,}\mathrm{kHz}$ step size sampling of the NV resonance, non-linear
parameter fits for individual pixels and subsequent determination of a map of
resonant frequencies for 2D array of pixels. The resonant frequency maps of
these samples were acquired for both DC current on and off and subtracted to
probe sample magnetic field dependent on linear shifts in the resonant
frequencies. Single NV axis magnetic field images of these samples (Fig. 4(c)
microwire and Fig. 4(f),(g) microcoil) were in agreement with simulated
magnetic field images obtained using COMSOL Multiphysics, ( Fig. 4(b)
microwire and Fig. 4(e) microcoil for expected simulated field images) at an
estimated standoff of $\sim$ $13\text{\,}\mathrm{\SIUnitSymbolMicro m}$ for
the microwire and $\sim$$14\text{\,}\mathrm{\SIUnitSymbolMicro m}$ for the
microcoil.

The $\textbf{B}_{NV}$ field is measured by resonant frequency shifts on either
side of a reference bias field resonant frequency. Therefore, on inverting the
current direction in the sample we observed an inverted contrast in the
magnetic field image of the microcoil sample as shown in Fig. 4(f) for
arbitrarily defined positive current and Fig. 4(g) for negative current, which
further affirms that the magnetic field images obtained are from the
microscale current flow in the sample. Additionally, static acquisition allows
for quantification of the field of view, the spatial resolution of the imaging
setup and the effective magnification. The imaging field of view, with
sufficient NV resonance SNR, is $\sim$ $150\text{\,}\mathrm{\SIUnitSymbolMicro
m}$ $\times$ $150\text{\,}\mathrm{\SIUnitSymbolMicro m}$ (Fig. 3) and is
limited by the excitation beam spot size on the NV layer and the total optical
power of the Gaussian excitation $532\text{\,}\mathrm{nm}$ beam in our
experimental setup (with $\sim$$1.5\text{\,}\mathrm{W}$ entering the objective
back aperture). We estimated the spatial resolution to be
$1.7\text{\,}\mathrm{\SIUnitSymbolMicro m}$ per camera pixel (see
Supplementary note for pixel resolution estimation method) during microcoil
measurements and $1.33\text{\,}\mathrm{\SIUnitSymbolMicro m}$ per camera pixel
during microwire measurements. Spatial resolution slightly differs in the two
measurements due to minor differences in positioning of a focusing plano-
convex lens in the red emitted light collection path to incorporate a larger
field of view for the microcoil. Consequently, corresponding effective
magnifications were 30X for microwire measurements and 23.5X for microcoil
measurements in our widefield microscope. While we acquire only single NV axis
magnetic field static and dynamic images in this study, we show that the
microcoil sample’s vector magnetic field can be reliably reconstructed
(Supplementary Fig. S2) from single NV axis magnetic field images by well
established Fourier reconstruction methods [42, 4].

###  3.3 Dynamic Widefield Magnetic Imaging

In this section we describe the acquisition of millisecond scale widefield
magnetic field images. To perform real-time imaging, the applied microwave
frequency is fixed to a specific NV resonant frequency along one NV axis. An
externally applied magnetic field causes a linear shift in pixel intensity,
proportional to the zero-crossing NV slope. Therefore, tracking the pixel
intensities, scaled by the slope, gives a measure of the external magnetic
field fluctuation along the chosen NV axis corresponding to each pixel. The
time-dependent magnetic field can be estimated from

$B(t)=\frac{v(t)-v_{o}}{\left.\frac{dV_{\text{lock
}}}{df}\right|_{V_{\text{lock }}=0,f=\omega_{\text{res }}}}\gamma$ (5)

where $v(t)$ is the lock-in pixel intensity, $v_{o}$ is a fixed offset
baseline of the pixel and $\gamma=$
$28\text{\,}\mathrm{kHz}\text{\,}{\mathrm{\SIUnitSymbolMicro T}}^{-1}$ is the
gyromagnetic ratio. The zero-crossing slope scale factor is independently
determined corresponding to each pixel in the imaging window. Individual
pixels are heterogeneous in their resonant frequencies due to small deviation
arising from local crystal strain, non-uniform bias magnetic field and
temperature in the excitation volume of the diamond sample. Therefore, we
choose to select the median resonant frequency from the distribution of
resonant frequencies in the imaging window for widefield magnetic field
tracking.

We demonstrate temporal magnetic field imaging examples for both samples, the
microwire and the microcoil, at different magnetic field variations and
imaging frame rates. The current flow in these samples are controlled by an
arbitrary waveform analog voltage generator (NIDAQ PCIe-6363, Analog output)
and the applied voltage waveform is triggered in synchronization with camera
frame acquisition (see Fig. 1). A low peak current level of
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$ was chosen for temporal field
imaging demonstration of both samples to keep peak magnetic field values below
$\sim$ $6\text{\,}\mathrm{\SIUnitSymbolMicro T}$ in the entire FOV, at the
given sample-standoff (see static imaging section and Fig. 4).

Figure 5: Temporal imaging of 1.26 Hz magnetic field variation at 78 frames
per second of the $90\text{\,}\mathrm{\SIUnitSymbolDegree}$ bend feature of
the microwire sample: (a) Magnetic field frames at single time-points
(averaged $n=15$ iterations) showing alternating field image contrast with
reversal in current direction. No voltage applied for a baseline time of
$0.5\text{\,}\mathrm{s}$, first frame selected from baseline window. A
periodic square wave voltage waveform of alternating polarity was applied
after the baseline time, at $1.26\text{\,}\mathrm{Hz}$ periodicity and peak
current $500\text{\,}\mathrm{\SIUnitSymbolMicro A}$. Exact magnetic field
frame time-points have been shown on top of each image. Scale bar
$27\text{\,}\mathrm{\SIUnitSymbolMicro m}$ (b) Full temporal time traces of
example pixels showing magnetic field tracking in time. Location of example
pixels, labelled as P1 to P4 in the field of view have been shown in the
magnetic field images. For each pixel, magnetic field traces versus time show
tracking of applied the magnetic field, with faded gray lines as single
iteration traces and solid black lines showing mean ($n=15$) magnetic field
traces for the given pixel. Amplitude spectral density of single-pixel field
traces are shown on the left, where pixel Fourier spectra are in blue and
applied voltage Fourier spectra has been shown in gray. Applied voltage
spectral density is scaled to a constant to compare spectral content with
pixel Fourier spectra. Since pixels track magnetic field, peaks in the pixel
Fourier spectra matches with peaks in the Fourier spectrum of the applied
voltage, with peaks occurring at magnetic field variation
$1.26\text{\,}\mathrm{H}\mathrm{z}$ and it’s odd harmonics.

Microwire imaging, $1.26\text{\,}\mathrm{Hz}$ sample field variation, 78 fps
NV acquisition: Dynamic magnetic field imaging was performed on the microwire
sample, where acquisition rate of magnetic field frames was set to 78 fps and
a $1.26\text{\,}\mathrm{Hz}$ periodic square bipolar voltage waveform was
applied to the microwire. A peak current of
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$ produced peak magnetic field
around $5\text{\,}\mathrm{\SIUnitSymbolMicro T}$ in the imaging FOV. Fig. 5(a)
shows example single magnetic field frames (iterations $n=15$) at selected
time-points demonstrating temporally varying, alternating field magnetic image
contrast due to periodic changes in current polarity. Few example pixels P1 to
P4 (see Fig. 5(b)) have been selected to show full temporal response of these
individual pixels. Single-iteration time traces (Fig. 5(b), faded gray traces
from all $n=15$ iteration) and mean time traces ($n=15$, Fig. 5(b), black
solid traces) of individual pixels track applied magnetic field waveform.
Fourier spectra of these pixel time traces are observed to contain peaks at
odd harmonics of applied magnetic field variation
$1.26\text{\,}\mathrm{H}\mathrm{z}$ as expected. Example pixels P2 and P4 were
selected at perpendicular locations to the current path near pixels P1 and P3.
Therefore, we observe P2 and P4 time traces are $\sim$
$90\text{\,}\mathrm{\SIUnitSymbolDegree}$ phase shifted to P1 and P3 time
traces, inline with expected spatial magnetic field profile of the microwire.
To the best of our knowledge this demonstrates the first real-time tracking of
microscale magnetic fields which faithfully reconstructs the frequency and
phase of the applied field. A link to the video file of this imaging dataset
has been provided in the supplementary section.

Figure 6: Temporal imaging of $17.9\text{\,}\mathrm{Hz}$ magnetic field
variation at 78 frames per second of the microcoil sample: (a) Magnetic field
frames at single time points (averaged $n=15$ iterations) showing alternating
field image contrast with reversal in current direction. No voltage applied
for a baseline time of $0.5\text{\,}\mathrm{s}$, first frame selected from
baseline window. A periodic square wave voltage waveform of alternating
polarity was applied after the baseline time, at $17.9\text{\,}\mathrm{Hz}$
periodicity and peak current $500\text{\,}\mathrm{\SIUnitSymbolMicro A}$.
Exact magnetic field frame time points have been shown on top of each image.
Scale bar $34\text{\,}\mathrm{\SIUnitSymbolMicro m}$ (b) Full temporal time
traces of example pixels showing magnetic field tracking in time. Location of
example pixels, labelled P1-P4 in the field of view have been shown in the
magnetic field images. For each pixel, magnetic field traces versus time show
tracking of applied the magnetic field, with faded gray lines as single
iteration traces and solid black lines showing mean ($n=15$) magnetic field
traces for the pixel. Amplitude spectral density of single-pixel field traces
are shown on the left, where pixel Fourier spectra are in blue and applied
voltage Fourier spectra has been shown in gray. Applied voltage spectral
density is scaled to a constant to compare spectral content with pixel Fourier
spectra. Since pixels track magnetic field, the prominent peak in the pixel
Fourier spectra matches with the peak in the Fourier spectrum of the applied
voltage, both occurring at magnetic field variation
$17.9\text{\,}\mathrm{Hz}$.

Microcoil imaging, $17.98\text{\,}\mathrm{Hz}$ sample field variation, 78 fps
NV acquisition: Dynamic magnetic field imaging was performed on the planar
microcoil sample, where the NV acquisition rate was set to 78 fps and a
$17.98\text{\,}\mathrm{Hz}$ periodic square voltage waveform was applied to
the microcoil. Results of microcoil imaging (see Fig. 6) have been similarly
organized as discussed in the microwire temporal imaging text. Microscale
magnetic field profiles of the microcoil are spatially resolved in single sub-
second magnetic field frames (Fig. 6(a), 12ms per frame, $n=15$). Magnetic
field time traces of example pixels have been shown in Fig. 6(b) and example
pixel locations on the microcoil images have been marked in Fig. 6(a). Fourier
spectra of these pixels show peak at the frequency of applied
$17.98\text{\,}\mathrm{H}\mathrm{z}$ periodic magnetic field waveform. These
results demonstrate resolving spatially intricate field profiles, in this case
multiple current flow paths separated by
$\sim$$7\text{\,}\mathrm{\SIUnitSymbolMicro m}$, at millisecond scale
snapshots of magnetic field images. A link to the video file of this imaging
dataset has been provided in the supplementary section.

Temporal imaging data for the microcoil at similar magnetic field variation
$18.9\text{\,}\mathrm{Hz}$ but higher NV acquisition rate of 208 fps has been
shown in the supplementary section (Supplementary Fig. S3). Microcoil magnetic
field features are spatially-resolved with reduced SNR and the first odd
harmonic of $18.9\text{\,}\mathrm{Hz}$ field variation is also observed in the
Fourier spectra of individual pixel responses. A higher magnetic field
variation $41.52\text{\,}\mathrm{Hz}$ applied to the microcoil at 208fps
acquisition rate is also shown (Supplementary Fig. S4). Additionally, for
completeness, we show dynamics in the microwire sample at similar magnetic
field variations ($16.3\text{\,}\mathrm{Hz}$) and 78fps NV acquisition rate.
Supplementary Fig. S5 shows spatially resolved magnetic field images of the
microwire and expected magnetic field tracking in individual pixel responses.

Figure 7: Temporal imaging of an arbitrary millisecond scale magnetic field
variation at 208 frames per second of the microcoil sample: (a) Applied
current profile to the microcoil sample. The main waveform signature lasts for
less than $150\text{\,}\mathrm{ms}$. Vertical blue lines indicates time-points
where single magnetic field image frames have been shown further. (b) Example
magnetic field frames at selected time-points (averaged $n=15$ iterations)
have been shown. Magnetic field images are Gaussian-smoothened with
4.5$\sigma$ filter. The applied current profile is reflected in the series of
spatially resolved magnetic field images of the microcoil. Magnetic field
image at $413\text{\,}\mathrm{ms}$ is observed to faithfully capture the fast
inversion of current polarity. Scale bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$.

Arbitrary waveform dynamics: Here, we show millisecond scale widefield
magnetometry for a generalized arbitrary waveform signal (Fig. 7a) with a
rapid inversion of current polarity and where the total fluctuation event
lasts less than 150ms. Fourier spectrum of this applied waveform contains
energy in frequencies upto $100\text{\,}\mathrm{Hz}$. Therefore, to
sufficiently sample the magnetic field profile, number of demodulation cycles
were reduced to get NV acquisition rate of 208fps. Fig. 7(b) shows selected
single magnetic field frames ($4.8\text{\,}\mathrm{ms}$ NV acquisition time
per frame, $n=15$ iterations) that show expected microcoil field temporal
profile in response to the applied waveform. Notably, field frame at
$413\text{\,}\mathrm{ms}$ captures the point of near-zero magnetic field
profile when the current rapidly switches polarity within
$\sim$$30\text{\,}\mathrm{ms}$. Since magnitude of the peak negative current
is higher than the peak positive current, microcoil features are more
prominent in field frame at $427\text{\,}\mathrm{ms}$ as compared to field
frame at $394\text{\,}\mathrm{ms}$. Magnetic field images for this case have
been Guassian-smoothened with $4.5\sigma$ filter to remove additional noise in
temporal images incorporated at higher imaging frame rates. A link to the
video file of this imaging dataset has been provided in the supplementary
section.

Further, we observed high frequency noise in lock-in camera pixel response
which can be reduced by the use of appropriate filtering techniques like
Bayesian filtering to further enhance imaging SNR. To the best of our
knowledge, the acquired single-axis widefield magnetic field images constitute
a novel demonstration of real-time millisecond scale widefield magnetic field
microscopy. Improved temporal resolution is primarily enabled by pixel noise-
rejection at higher lock-in frequencies, high imaging frame rates offered by
the lock-in camera and ability to synchronize modulation of NV emitted light
with lock-in camera frame integration timings. At high imaging frame rates,
the SNR is primarily limited by the NV’s emitted fluorescence rate from the
diamond sample, and not by the lock-in camera demodulation rates. Therefore,
the temporal imaging enhancement demonstrated in this work is expected to
improve at least one-two fold with optimized optical and microwave excitation
power of the NV ensemble and further, by the use state-of-art ion-irradiated
high density nitrogen vacancy diamond samples.

Imaging speed and sensitivity trade-off: Finally, we discuss the interplay of
four key parameters of WMF imaging method, namely, the imaging frame rate $I$,
the mean per-pixel sensitivity $\eta$, the NV modulation frequency
$\omega_{mod}$ and the number of frame averaging cycles $n_{cyc}$. A
phenomenological understanding of the coupling of parameters will be useful in
deciding the trade-off. To maximize the imaging frame rate $I$
$\propto\omega_{mod}/n_{cyc}$, we need to modulate NVs faster (increase
$\omega_{mod}$) and average for lesser number of internal frames (decrease
$n_{cyc}$). Increasing $\omega_{mod}$ leads to a decrease in the zero-crossing
NV slope but the noise, $\sigma$, remains mostly constant. Therefore, $\eta$
will drop at higher $\omega_{mod}$, keeping $n_{cyc}$ same. Increasing the
$n_{c}yc$ has more interesting effects on $\eta$, since the camera readout
noise $\sigma$ increases with more $n_{cyc}$ but the NV signal strength also
improves. Therefore, a multi-parameter optimization is required for
understanding the trade-offs and zone of best performance for the sensor for a
given specific application.

In summary, we have developed a novel widefield magnetic field microscope
capable of probing dynamically varying microscale magnetic field features at
tunable imaging frame rates of 50-200 frames per second. Millisecond to sub-
second magnetic field images have been demonstrated for a planar microcoil
sample with detailed microscale features, consisting of multiple current flow
paths separated by $\sim$ $7\text{\,}\mathrm{\SIUnitSymbolMicro m}$, current
flow track width $10\text{\,}\mathrm{\SIUnitSymbolMicro m}$ and multiple
$90\text{\,}\mathrm{\SIUnitSymbolDegree}$ turns in the current flow path.
While maintaining microscale spatial resolution, individual pixels in the
imaging FOV have been shown to track applied magnetic fields in time with
correct amplitude and phase for both periodic current waveforms and short
$150\text{\,}\mathrm{ms}$ arbitrary current waveform. Frequency spectrum of
individual pixels reveal near exact match to the frequency spectrum of applied
periodic current waveforms. Further, the NV imaging speed enhancements have
been shown for small magnetic fields, typically less than
$\sim$$6\text{\,}\mathrm{\SIUnitSymbolMicro T}$ in the entire FOV. Therefore,
to the best of our knowledge, the widefield per-pixel lock-in method proposed
here marks significant improvement over conventional ODMR imaging, where few
to several minutes of averaging time is required to obtain a single magnetic
field image of similar microscale spatial resolution.

##  4 Conclusion and Outlook

In this work, we have developed and demonstrated an experimental technique to
perform real-time widefield magnetic field imaging using diamond NV centers in
diamond. Per-pixel SNR is significantly enhanced using lock-in detection
techniques implemented on a commercial lock-in camera which allows
simultaneous demodulation of multiple pixels. While previous diamond NV based
magnetometers have shown acquisition rate of several minutes per frame, to the
best of our knowledge, we demonstrate for the first time, spatio-temporal
magnetic field imaging at timescale around 1-40 $\text{\,}\mathrm{Hz}$ at
imaging speed of $50200$ fps. The fm-ODMR protocol used in this demonstration
is easy to implement, demanding only frequency modulated NV-PL and microsecond
digital pulses that control camera frame demodulation. We expect temporal
imaging SNR and imaging FOV shown in our work to significantly improve with
increase in optical excitation of NV centers and with application of state-of-
art higher NV density diamond crystals. Additionally, the spatio-temporal
resolution is expected to improve in future with the use of higher NV
concentration diamond samples and improved coherence time. We emphasize that
while we operate the camera at demodulation of 6.25-8.33
$\text{\,}\mathrm{kHz}$ and imaging frame rates of $\sim\,50-200$ fps, the
demonstration is primarily limited by the low NV fluorescence and not by
maximum achievable lock-in modulation rates (possible up to
$250\text{\,}\mathrm{kHz}$) and imaging frame rates (maximum possible 3200
fps) for the camera used here. Other lock-in cameras [43, 44] are expected to
offer similar high frame rate advantages. We are aware of a similar
independent preprint submission by Webb et al. [45] where the authors
demonstrate an application of widefield lock-in detection to enhance imaging
speed of diamond NV magnetometry. Both our work and their work, with
differences in experimental implementation, show that widefield lock-in
detection enables sub-second magnetic field microscopy using NV defect centers
in diamond, in contrast to conventional static diamond NV magnetic field
microscopy.

## References

  * [1] Steinert, S. _et al._ High sensitivity magnetic imaging using an array of spins in diamond.  _Rev. Sci. Instrum._ 81, 043705, DOI: 10.1063/1.3385689 (2010).
  * [2] Pham, L. M. _et al._ Magnetic field imaging with nitrogen-vacancy ensembles.  _New J. Phys._ 13, 045021, DOI: 10.1088/1367-2630/13/4/045021 (2011).
  * [3] Le Sage, D. _et al._ Optical magnetic imaging of living cells.  _Nature_ 496, 486–489 (2013).
  * [4] Glenn, D. R. _et al._ Micrometer-scale magnetic imaging of geological samples using a quantum diamond microscope.  _Geochemistry, Geophysics, Geosystems_ 18, 3254–3267 (2017).
  * [5] Levine, E. V. _et al._ Principles and techniques of the quantum diamond microscope.  _Nanophotonics_ 8, 1945–1973, DOI: doi:10.1515/nanoph-2019-0209 (2019).
  * [6] Tetienne, J.-P. _et al._ Quantum imaging of current flow in graphene.  _Science advances_ 3, e1602429 (2017).
  * [7] Wolf, T. _et al._ Subpicotesla diamond magnetometry.  _Phys. Rev. X_ 5, 041001, DOI: 10.1103/PhysRevX.5.041001 (2015).
  * [8] Barry, J. F. _et al._ Optical magnetic detection of single-neuron action potentials using quantum defects in diamond.  _Proceedings of the National Academy of Sciences_ 113, 14133–14138, DOI: 10.1073/pnas.1601513113 (2016).
  * [9] Rondin, L. _et al._ Magnetometry with nitrogen-vacancy defects in diamond.  _Reports on progress in physics_ 77, 056503 (2014).
  * [10] Petrini, G. _et al._ Is a quantum biosensing revolution approaching? perspectives in nv-assisted current and thermal biosensing in living cells.  _Advanced Quantum Technologies_ 3, 2000066, DOI: https://doi.org/10.1002/qute.202000066 (2020).
  * [11] Davis, H. C. _et al._ Mapping the microscale origins of magnetic resonance image contrast with subcellular diamond magnetometry.  _Nature communications_ 9, 1–9 (2018).
  * [12] Ku, M. J. H. _et al._ Imaging viscous flow of the dirac fluid in graphene.  _Nature_ 583, 537–541, DOI: 10.1038/s41586-020-2507-2 (2020).
  * [13] Casola, F., van der Sar, T. & Yacoby, A.  Probing condensed matter physics with magnetometry based on nitrogen-vacancy centres in diamond.  _Nat. Rev. Mater_ 3, 17088, DOI: 10.1038/natrevmats.2017.88 (2018).
  * [14] Turner, M. J. _et al._ Magnetic field fingerprinting of integrated-circuit activity with a quantum diamond microscope.  _Physical Review Applied_ 14, 014097 (2020).
  * [15] Mizuno, K., Ishiwata, H., Masuyama, Y., Iwasaki, T. & Hatano, M.  Simultaneous wide-field imaging of phase and magnitude of ac magnetic signal using diamond quantum magnetometry.  _Scientific Reports_ 10, 1–10 (2020).
  * [16] Lillie, S. E. _et al._ Imaging graphene field-effect transistors on diamond using nitrogen-vacancy microscopy.  _Phys. Rev. Applied_ 12, 024018, DOI: 10.1103/PhysRevApplied.12.024018 (2019).
  * [17] Broadway, D. A. _et al._ Spatial mapping of band bending in semiconductor devices using in situ quantum sensors.  _Nature Electronics_ 1, 502–507, DOI: 10.1038/s41928-018-0130-0 (2018).
  * [18] Lillie, S. E. _et al._ Laser modulation of superconductivity in a cryogenic wide-field nitrogen-vacancy microscope.  _Nano Letters_ 20, 1855–1861, DOI: 10.1021/acs.nanolett.9b05071 (2020).
  * [19] Mahmoudi, M. _et al._ Magnetic resonance imaging tracking of stem cells in vivo using iron oxide nanoparticles as a tool for the advancement of clinical regenerative medicine.  _Chemical Reviews_ 111, 253–280, DOI: 10.1021/cr1001832 (2011).
  * [20] Barry, J. F. _et al._ Optical magnetic detection of single-neuron action potentials using quantum defects in diamond.  _Proceedings of the National Academy of Sciences_ 113, 14133–14138 (2016).
  * [21] Price, J. C., Mesquita-Ribeiro, R., Dajas-Bailador, F. & Mather, M. L.  Widefield, spatiotemporal mapping of spontaneous activity of mouse cultured neuronal networks using quantum diamond sensors.  _Frontiers in Physics_ 8, 255, DOI: 10.3389/fphy.2020.00255 (2020).
  * [22] Webb, J. L. _et al._ Detection of biological signals from a live mammalian muscle using an early stage diamond quantum sensor.  _Scientific Reports_ 11, 2412, DOI: 10.1038/s41598-021-81828-x (2021).
  * [23] Parashar, M., Saha, K. & Bandyopadhyay, S.  Axon hillock currents enable single-neuron-resolved 3d reconstruction using diamond nitrogen-vacancy magnetometry.  _Communications Physics_ 3, 174, DOI: 10.1038/s42005-020-00439-6 (2020).
  * [24] Schlierf, M., Berkemeier, F. & Rief, M.  Direct observation of active protein folding using lock-in force spectroscopy.  _Biophysical Journal_ 93, 3989–3998, DOI: https://doi.org/10.1529/biophysj.107.114397 (2007).
  * [25] Shah, V., Knappe, S., Schwindt, P. D. D. & Kitching, J.  Subpicotesla atomic magnetometry with a microfabricated vapour cell.  _Nature Photonics_ 1, 649–652, DOI: 10.1038/nphoton.2007.201 (2007).
  * [26] Beer, S. & Seitz, P.  Real-time tomographic imaging without x-rays: a smart pixel array with massively parallel signal processing for real-time optical coherence tomography performing close to the physical limits.  In _Research in Microelectronics and Electronics, 2005 PhD_ , vol. 2, 135–138, DOI: 10.1109/RME.2005.1542955 (2005).
  * [27] Changhuei Yang, A. M. & Alford, J.  Systems and methods for quasi-ballistic photon optical coherence tomography in diffusive scattering media using a lock-in camera detector.  US Patent US10881300B2 (2021).
  * [28] Liu, Y., Shen, Y., Ma, C., Shi, J. & Wang, L. V.  Lock-in camera based heterodyne holography for ultrasound-modulated optical tomography inside dynamic scattering media.  _Applied physics letters_ 108, 231106 (2016).
  * [29] Meier, A. H. & Roesgen, T.  Imaging laser doppler velocimetry.  _Experiments in Fluids_ 52, 1017–1026, DOI: 10.1007/s00348-011-1192-1 (2012).
  * [30] Sinclair, L. C., Cossel, K. C., Coffey, T., Ye, J. & Cornell, E. A.  Frequency comb velocity-modulation spectroscopy.  _Phys. Rev. Lett._ 107, 093002, DOI: 10.1103/PhysRevLett.107.093002 (2011).
  * [31] Schoenfeld, R. S. & Harneit, W.  Real time magnetic field sensing and imaging using a single spin in diamond.  _Physical review letters_ 106, 030802 (2011).
  * [32] Schloss, J. M., Barry, J. F., Turner, M. J. & Walsworth, R. L.  Simultaneous broadband vector magnetometry using solid-state spins.  _Physical Review Applied_ 10, 034044 (2018).
  * [33] Clevenson, H. _et al._ Robust high-dynamic-range vector magnetometry with nitrogen-vacancy centers in diamond.  _Applied Physics Letters_ 112, 252406 (2018).
  * [34] Webb, J. L. _et al._ Nanotesla sensitivity magnetic field sensing using a compact diamond nitrogen-vacancy magnetometer.  _Applied Physics Letters_ 114, 231103 (2019).
  * [35] Wojciechowski, A. M. _et al._ Contributed review: Camera-limits for wide-field magnetic resonance imaging with a nitrogen-vacancy spin sensor.  _Review of Scientific Instruments_ 89, 031501 (2018).
  * [36] Heliotis helicam ™ c3 – lock-in camera.
  * [37] Kazi, Z. _et al._ Wide-field dynamic magnetic microscopy using double-double quantum driving of a diamond defect ensemble.  _Physical Review Applied_ 15, 054032 (2021).
  * [38] Hart, C. A. _et al._ $\mathrm{N}$-$v$–diamond magnetic microscopy using a double quantum 4-ramsey protocol.  _Phys. Rev. Applied_ 15, 044020, DOI: 10.1103/PhysRevApplied.15.044020 (2021).
  * [39] Kucsko, G. _et al._ Nanometre-scale thermometry in a living cell.  _Nature_ 500, 54–58, DOI: 10.1038/nature12373 (2013).
  * [40] Fujiwara, M. _et al._ Real-time estimation of the optically detected magnetic resonance shift in diamond quantum thermometry toward biological applications.  _Phys. Rev. Research_ 2, 043415, DOI: 10.1103/PhysRevResearch.2.043415 (2020).
  * [41] Fujiwara, M. _et al._ Real-time nanodiamond thermometry probing in vivo thermogenic responses.  _Science Advances_ 6, DOI: 10.1126/sciadv.aba9636 (2020).
  * [42] Lima, E. A. & Weiss, B. P.  Obtaining vector magnetic field maps from single-component measurements of geological samples.  _Journal of Geophysical Research_ 114 (2009).
  * [43] Cao, H. T., Brown, D. D., Veitch, P. J. & Ottaway, D. J.  Optical lock-in camera for gravitational wave detectors.  _Opt. Express_ 28, 14405–14413, DOI: 10.1364/OE.384754 (2020).
  * [44] Changhuei Yang, J. A., Adam Marblestone & Wentz, C.  System and method for simultaneously detecting phase modulated optical signals.  US Patents US10016137B1 (2018).
  * [45] Webb, J. L. _et al._ High speed microcircuit and synthetic biosignal widefield imaging using nitrogen vacancies in diamond (2021).  2107.14156.

## Acknowledgements

K.S. acknowledges financial support from IIT Bombay seed grant number
17IRCCSG009, DST Inspire Faculty Fellowship - DST/ INSPIRE/04/2016/002284,
SERB EMR grant Number EMR/2016/007420 and Asian Office of Aerospace Research
and Development (AOARD) R$\&$D grant No. FA2386-19-1-4042. K.S. acknowledges
the support and usage of fabrication facilities in the IIT Bombay
Nanofabrication facility via the NNetra project sponsored by Department of
Science and Technology (DST) and Ministry of Electronics and Information
Technology (MEITY), India. This work was also supported by the DBT/Wellcome
Trust India Alliance Fellowship IA/I/11/2500270 awarded to S.B.. M.P. thanks
MHRD, India for Institute Fellowship and Prime Minister’s Research Fellowship
(PMRF). The authors thank Heliotis Helicam technical assistance, especially
Istvan Biro, for his help in camera synchronization. K.S. acknowledges the
contribution of Aditya Malusare and Parth Jatakia during the initial
experimental setup. The authors thank Dr. Siddharth Tallur for allowing the
usage of SR860 Lockin amplifier for single-photodiode experiments and also
thank Prof. Pradeep Sarin, Prof. Kantimay Dasgupta and Bikas C.Barik for
access and help in wire bonding the micro-fabricated samples. The authors note
that the work has been provisionally filed under the Indian Patent Act with
application number:202121010532.

## Author contributions statement

M.P, S.B, and K.S conceived the idea. M.P and K.S designed the experimental
setup. M.P constructed the experimental setup, wrote custom software for
experiment control and data acquisition and performed all primary experiments
and data analysis. A.B designed and performed micro-fabrication of the
microwire and the microcoil sample. A.B simulated magnetic field profiles of
the samples. D.S., A.B and A.G assisted data collection, designed and
characterized microwave loop PCB. D.S, A.B and S.B contributed key ideas to
experiments and data analysis. M.P and K.S. wrote the manuscript in discussion
with S.B . All authors reviewed and approved of the manuscript. K.S supervised
all aspects of the work.

## Competing Interests

The authors declare no competing interests.

##  S1 Supplementary information

###  S1.1 Supplementary notes

Normalization of amplitude spectral density: Amplitude spectral density (ASD)
of magnetic field traces of individual pixels is defined as the square root of
one-sided power spectral density (PSD). One-sided PSD $S(f)$ of a pixel time
series X(t) is normalized such that area under the PSD curve integrated on
one-side from 0 to $\frac{f_{s}}{2}$ equals the variance $\sigma_{X}^{2}$ of
the mean subtracted pixel time traces. $f_{s}$ denotes sampling frequency or
frames per second.

$\sigma_{X}^{2}=\int_{0}^{\frac{f_{s}}{2}}S(f)\differential{f}$ (6)

The above normalization was implemented with MATLAB in-built functions. For a
time series data vector $V$, the ASD vector is given by

    fourier_vector = fftshift(fft(V))
    ASD = sqrt(2) * abs(fourier_vector) / sqrt(length(fourier_vector))

The right half of the ASD vector represents amplitude spectral density from
frequency 0 to $f_{s}/2$.

Determination of single pixel spatial resolution and effective magnification:
In the experimental setup, the entire assembly of sample, diamond crystal and
microwave resonator was mounted on a motorized XYZ stage and the excitation
beam was kept fixed. The motorized stage coordinates are accurate to
$100\text{\,}\mathrm{nm}$ positioning. Magnetic field images of the microcoil
sample were acquired at slightly shifted ($\sim$
$20\text{\,}\mathrm{\SIUnitSymbolMicro m}$) locations in X and Y motor
coordinates. Corresponding to the change in motor coordinates, number of pixel
shifts were noted for a sharp feature in the magnetic field image of the
microcoil or the microwire sample. The measurements were repeated several
times and the per-pixel spatial resolution was evaluated to be
$1.33\text{\,}\mathrm{\SIUnitSymbolMicro m}$ per pixel during the microwire
measurements and $1.7\text{\,}\mathrm{\SIUnitSymbolMicro m}$ per pixel during
the microcoil measurements. As mentioned in the main text, the per-pixel
resolution during the two sets of sample measurements differ due to slight
change in positioning of a focusing plano-convex lens in the excitation-
fluorescence collection path of the widefield microscope. The lock-in camera
real pixel size is $40\text{\,}\mathrm{\SIUnitSymbolMicro m}$, which yields
effective magnification of $30\times$ for microwire measurements and
$23.5\times$ for microcoil measurements.

Per-pixel raw data processing: Additional details to measure raw-data, process
and analyze time-dependent magnetic field maps.

  1. 1.

Before dynamic magnetic field tracking, we acquire a widefield lock-in ODMR
spectrum of a single NV resonant feature at high microwave frequency step size
of $100\text{\,}\mathrm{kHz}$. The resonant feature is selected on the basis
of high signal response and linearity at the NV zero-crossing point i.e.the NV
resonant frequency. This selection determines the NV axis along which the
magnetic field sensing will be performed.

  2. 2.

The informative red light emitted from NV centers spans a limited area on the
CMOS array ($300\times 300$) pixels. Further, the NV ODMR signal of different
pixels differ due to Gaussian nature of optical illumination, spatial non-
uniformity of the applied microwave field and limited spot size of the
excitation beam. Therefore, it is important to select responding pixels. First
we create an average response template by taking mean of ODMR response of all
pixels, responding and non-responding pixels. Since a high number of pixels
are responsive in the ODMR data, the template carries an average ODMR feature.
The template is normalized to unit norm and the unit-norm responses of all
pixels are correlated to the template, via the dot product. Pixels with
projection values higher than a set threshold are selected for further
processing. This threshold was kept low at 1e-4 to only reject extremely low
SNR pixels. Additional selection of high response pixels occurs with
subsequent process of non-linear curve fitting.

  3. 3.

Non-linear curve fitting is performed to fit derivative sum of two Lorentzian
profiles separated by $3.05\text{\,}\mathrm{MHz}$ to each selected pixel
response in the previous step. The MATLAB fit function `lsqcurvefit` is used
to perform a Levenburg-Marquadt non-linear fitting for each pixel ODMR
response.

  4. 4.

Histogram of distribution of resonant frequencies of individual pixels is
analyzed. Pixels with artefacts or low ODMR response result in incorrect ODMR
curve fits and have widely different resonant frequencies, as much as in
gigahertz, from the median resonant frequency. On the contrary, all pixels
with sufficient SNR levels have resonant frequencies clustered in a small
’continuous’ band near the median resonant frequency. This resonant frequency
range is visually inspected and provides bounds to the color axis of the
resonant frequency maps. This simple bound removes pixels with wrong curve
fits, pixels with low ODMR response and adjust dynamic range of the color axis
of the 2D resonant frequency maps.

  5. 5.

The scaling of raw-data PL intensity data of the pixels to magnetic field time
traces was done as described in the main text.

  6. 6.

In temporal imaging datasets, pixels have an offset value ranging from 0 to
1024 (10-bit scale), but mostly centered in the range of 500-600. Also, when a
single resonant frequency is applied, heterogeneous pixels might show
different baseline PL value. A small baseline time window of about 250-500
$\text{\,}\mathrm{ms}$, where no voltage was applied to the sample, was
acquired and mean pixel value during the baseline window was subtracted from
entire time trace of the pixel. Therefore, all pixels were centered to 0 in
the beginning of temporal magnetic field tracking. Further, a ’detrend’ in-
built MATLAB function was applied over time traces of each pixel to remove
linear drifts in the magnetic field tracking data.

###  S1.2 Supplementary Videos

The links to videos of imaging datasets in the main text have been provided
below.

  1. 1.

Video1: Imaging video file of data shown in the main text Fig. 5. Scale bar
$27\text{\,}\mathrm{\SIUnitSymbolMicro m}$. Microwire imaging,
$1.26\text{\,}\mathrm{Hz}$, 78 fps NV acquisition. Video link.

  2. 2.

Video2: Imaging video file of data shown in the main text Fig. 6. Scale bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$. Microcoil imaging,
$17.9\text{\,}\mathrm{Hz}$, 78 fps NV acquisition. Video link.

  3. 3.

Video3: Imaging video file of data shown in the main text Fig. 7. Scale bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$. Arbitrary waveform dynamics. In
this video, each time frame was filtered with a MATLAB function ’filloutliers’
to primarily reduce noise in the low-SNR pixels at the edges of the FOV.
Outliers from image frames were removed on the criteria of 3 scaled median
absolute deviation away from the median. Outliers pixels were filled with
nearby local median value. Video link.

###  S1.3 Supplementary figures

Figure S1: Experimental noise spectrum of widefield imaging setup: (a) Noise
spectrum of a reference single photodiode (SP) magnetometry setup across
different diamond NV modulation frequency (which is same as lock-in amplifier
reference). This spectrum has been measured with all experimental conditions
identical to ODMR experiments except applied microwave excitation was off.
Low-pass filter time constant set to $100\text{\,}\mathrm{ms}$ during the
measurement. (b) Mean Noise measured for randomly chosen 15 pixels of the
lock-in camera measured across different modulation frequencies. Similar to
part A, experimental conditions were same as widefield ODMR experiments except
microwave excitation was off. Units reflect 1024 (10-bit) points scale of
camera output (c) Mean curve of standard deviation of randomly chosen 10000
pixels of the lock-in camera versus diamond NV modulation frequencies. Part
(b) and Part (c) data obtained from same set of data of camera lock-in
intensity frames ($n=20$) at different modulation frequencies ($n=20$ frames
collected at each modulation frequency). Units reflected 1024 (10-bit) points
scale of camera output. We note that the minimum camera lock-in frequency is
$2.2\text{\,}\mathrm{kHz}$ , and therefore high noise at lower frequencies are
not observed, unlike part (a) SP measurements. Figure S2: Reconstruction of
all three orthogonal axes B fields from single NV axis magnetic field image:
(a) Simulated magnetic field profiles of the microcoil sample at sample
standoff $14\text{\,}\mathrm{\SIUnitSymbolMicro m}$, current magnitude
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$. The simulated single NV axis
projection image has been is shown on the same NV axis about which the
widefield ODMR was acquired. Scale bar $40\text{\,}\mathrm{\SIUnitSymbolMicro
m}$. (b) Experimentally obtained static magnetic field image of the microcoil
current flow acquired about a single NV resonance peak with relatively higher
magnetic field sensitivity. Orthogonal components of the magnetic field images
reconstructed from the single NV axis magnetic image, assuming source free
sensor plane and fourier inversion techniques. Scale bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$ Figure S3: Temporal imaging of
$18.9\text{\,}\mathrm{Hz}$ magnetic field variation at 208 frames per second
of the microcoil sample: (a) Magnetic field frames at single time-points
(averaged $n=15$ iterations) showing alternating field image contrast with
reversal in current direction. No voltage applied for a baseline time of
$0.25\text{\,}\mathrm{s}$, first frame selected from baseline window. A
periodic square wave voltage waveform of alternating polarity was applied
after the baseline time, at $18.9\text{\,}\mathrm{Hz}$ periodicity and peak
current $500\text{\,}\mathrm{\SIUnitSymbolMicro A}$. Exact magnetic field
frame time-points have been shown on top of each image. Scale bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$ (b) Full temporal time traces of
example pixels showing magnetic field tracking in time. Location of example
pixels, labelled P1-P4 in the field of view have been shown in the magnetic
field images. For each pixel, magnetic field traces versus time show tracking
of applied the magnetic field, with faded gray lines as single iteration
traces and solid black lines showing mean ($n=15$) magnetic field traces for
the pixel. Amplitude spectral density of single-pixel field traces are shown
on the left, where pixel Fourier spectra are in blue and applied voltage
Fourier spectra has been shown in gray. Applied voltage spectral density is
scaled to a constant to compare spectral content with pixel Fourier spectra.
Since pixels track magnetic field, peaks in the pixel Fourier spectra matches
with peaks in the Fourier spectrum of the applied voltage, with peaks
occurring at magnetic field variation $18.9\text{\,}\mathrm{H}\mathrm{z}$ and
its odd harmonics.  Figure S4: Temporal imaging of $41.52\text{\,}\mathrm{Hz}$
magnetic field variation at 208 frames per second of the microcoil sample: (a)
Magnetic field frames at single time-points (averaged $n=15$ iterations)
showing alternating field image contrast with reversal in current direction.
No voltage applied for a baseline time of $0.25\text{\,}\mathrm{s}$, first
frame selected from baseline window. A periodic square wave voltage waveform
of alternating polarity was applied after the baseline time, at
$41.52\text{\,}\mathrm{Hz}$ periodicity and peak current
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$. Exact magnetic field frame time-
points have been shown on top of each image. Scale bar
$34\text{\,}\mathrm{\SIUnitSymbolMicro m}$ (b) Full temporal time traces of
example pixels showing magnetic field tracking in time. Location of example
pixels, labelled P1-P4 in the field of view have been shown in the magnetic
field images. For each pixel, magnetic field traces versus time show tracking
of applied the magnetic field, with faded gray lines as single iteration
traces and solid black lines showing mean ($n=15$) magnetic field traces for
the pixel. Amplitude spectral density of single-pixel field traces are shown
on the left, where pixel Fourier spectra are in blue and applied voltage
Fourier spectra has been shown in gray. Applied voltage spectral density is
scaled to a constant to compare spectral content with pixel Fourier spectra.
Since pixels track magnetic field, peaks in the pixel Fourier spectra matches
with peaks in the Fourier spectrum of the applied voltage, with the peak
occurring at magnetic field variation rate
$41.52\text{\,}\mathrm{H}\mathrm{z}$. Figure S5: Temporal imaging of
$16.3\text{\,}\mathrm{Hz}$ magnetic field variation at 78 frames per second of
the $90\text{\,}\mathrm{\SIUnitSymbolDegree}$ bend microwire sample: (a)
Magnetic field frames at single time-points (averaged $n=15$ iterations)
showing alternating field image contrast with reversal in current direction.
No voltage applied for a baseline time of $0.5\text{\,}\mathrm{s}$, first
frame selected from baseline window. A periodic square wave voltage waveform
of alternating polarity was applied after the baseline time, at
$16.3\text{\,}\mathrm{Hz}$ periodicity and peak current
$500\text{\,}\mathrm{\SIUnitSymbolMicro A}$. Exact magnetic field frame time-
points have been shown on top of each image. Scale bar
$27\text{\,}\mathrm{\SIUnitSymbolMicro m}$(b) Full temporal time traces of
example pixels showing magnetic field tracking in time. Location of example
pixels, labelled P1-P4 in the field of view have been shown in the magnetic
field images. For each pixel, magnetic field traces versus time show tracking
of applied the magnetic field, with faded gray lines as single iteration
traces and solid black lines showing mean ($n=15$) magnetic field traces for
the pixel. Amplitude spectral density of single-pixel field traces are shown
on the left, where pixel Fourier spectra are in blue and applied voltage
Fourier spectra has been shown in gray. Applied voltage spectral density is
scaled to a constant to compare spectral content with pixel Fourier spectra.
Since pixels track magnetic field, peaks in the pixel Fourier spectra matches
with peaks in the Fourier spectrum of the applied voltage, with each pixel
peak occurring at magnetic field variation $16.3\text{\,}\mathrm{Hz}$.