Introduction

Nearly all current quantum technology applications rely on a two-level quantum system (qubit) that is subject to environmental noise. In the pure dephasing limit this environmental noise causes fluctuations in the frequency of the qubit that lead to decoherence. Spectral characterization of such environments is the most crucial step in successfully controlling and suppressing decoherence. Indeed, characterizing the noise spectrum allows for a filter-design approach that suppresses the noise and improves the coherence of the qubit1,2,3,4. Therefore, developing methods that can recover the noise spectrum of qubit environments has been one of the most active fields of research over the past two decades5,6,7,8. Among these efforts, dynamical decoupling noise spectroscopy (DDNS)9,10,11,12 has been one of the most successful approaches. In this method, applying a sequence of π-pulses turns the qubit into a noise probe (approximated as a frequency comb) that isolates contributions from particular frequencies of the noise spectrum. The dynamical decoupling framework has been studied extensively theoretically and implemented experimentally in various platforms such as superconducting circuits13,14, ultracold atoms15, quantum dots16,17,18, and nitrogen-vacancy (NV) centers in diamonds19,20. A DDNS protocol based on the Carr-Purcell-Meiboom-Gill (CPMG) sequence21,22 was proposed by Álvarez and Suter9 which would ideally yield a system of equations and unknowns from the measured values of the qubit coherence \(C(t)=| \left\langle {\rho }_{01}(t)\right\rangle | /| \left\langle {\rho }_{01}(0)\right\rangle |\), and specific frequencies of the spectrum. However, this method offers reasonable performance only when the number of π-pulses in each sequence is large. Beyond a pulse economy standpoint, other difficulties, such as deviations from the ideal frequency comb approximation23, have recently inspired utilizing neural networks as ‘universal function approximators’ to reconstruct the noise spectrum from the coherence function of the qubit24. The success of this deep learning method suggests the existence of a one-to-one mapping between the two quantities.

Here, we present a simple and inexpensive method that uniquely maps the measured coherence function of a qubit to its noise power spectrum, removing the need for long sequences of π-pulses at the heart of DDNS or turning to neural networks. In fact, we show that the map obtained using neural networks in ref. 24 can be found explicitly and analytically and then translated to a simple and effective noise spectroscopy method. This approach only requires free induction decay or spin echo measurements of the qubit and employs a simple Fourier transform to accurately reconstruct the noise spectrum of the system. While Fourier spectroscopy has been implemented in Nuclear Magnetic Resonance and on different types of quantum processors7,25,26, it has not been utilized in the context of pure dephasing with the filter function formalism. Here, we combine the Fourier transform technique with the filter function formalism to introduce an approach we call Fourier transform noise spectroscopy (FTNS) that significantly enhances one’s ability to reconstruct the power spectrum while dramatically reducing the required experimental overhead. We show that FTNS enables the reconstruction of the noise spectrum over a frequency range that is otherwise inaccessible through DDNS — information that is critical for effective noise mitigation. We then extend the FTNS method to directly extract the noise spectrum from a spin echo signal, which becomes necessary when the system of interest is dominated by strong low-frequency noise. While this FTNS method requires taking two time derivatives of the signal and is therefore sensitive to measurement errors in the time domain, we show that simple signal processing steps can mitigate the effect of such errors and yield accurate results.

Results and discussions

Theoretical description

We begin by laying out the theoretical basis for the filter function formalism in a pure dephasing setup1,6,10,27. In this case, the qubit relaxation process (quantified by T1) takes much longer than phase randomization (quantified by \({T}_{2}^{\star }\)), implying that the decoherence time \({T}_{2}^{-1}={(2{T}_{1})}^{-1}+{T}_{2}^{\star -1}\approx {T}_{2}^{\star -1}\) becomes a measure of how fast the phase information is lost due to environmental fluctuations. Frequency fluctuations of a qubit subject to a stationary, Gaussian noise, \(\hat{\beta }(t)\), can be described by the Hamiltonian \(\hat{H}=\frac{1}{2}[\Omega +\hat{\beta }(t)]{\hat{\sigma }}_{z}\), where Ω is the natural frequency of the qubit. Here, the coherence function is C(t) = eχ(t), where the attenuation function χ(t) is given by the overlap of the noise spectrum and a filter function that incorporates the effect of the pulses on the system:

$$\chi (t)=-\,{{\mbox{ln}}}\,[C(t)]=\frac{1}{4\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,S(\omega )F(\omega t).$$
(1)

The noise spectrum, \(S(\omega )=\int\nolimits_{-\infty }^{\infty }dt\,{{{{\rm{e}}}}}^{{{{\rm{i}}}}\omega t}S(t)\), is the Fourier transform of the equilibrium time correlation function of the environmental noise, \(S(t)=\langle \{\hat{\beta }(t),\hat{\beta }(0)\}\rangle /2\), where {A, B} = AB + BA is the anticommutator. The filter function, F(ωt), encodes the sign switching (±1) of the environmental fluctuations upon application of each π pulse in the sequence1.

The use of the absolute value in the definition of \(C(t)\propto | \left\langle {\rho }_{01}(t)\right\rangle |\) merits further comment. Without the absolute value, \(\tilde{C}(t)=\left\langle {\rho }_{01}(t)\right\rangle\) contains both a real and an imaginary component, which is the output of the full coherence measurement, i.e., 〈σx(t)〉 + i〈σy(t)〉. Here, 〈σx(t)〉 refers to the Ramsey measurement of the real part that involves the sequence RY(π/2) − t − RY( − π/2), giving access to Re[ρ01(t)], whereas 〈σy(t)〉 refers to the Ramsey measurement of the imaginary part that involves the sequence RY(π/2) − t − RX(π/2), giving access to Im[ρ01(t)]14. For quantum noise sources that obey Gaussian statistics, this measurement can be written as \(\tilde{C}(t) \sim {{{{\rm{e}}}}}^{-\chi (t)+{{{\rm{i}}}}\Phi (t)}\)28,29,30,31. We consider the absolute value of this measurement, which leads to \(C(t)=| \tilde{C}(t)| \sim {{{{\rm{e}}}}}^{-\chi (t)}\). While removing the dependence on Φ(t) may appear to cause information loss, it is not so as Φ(t) contains the same information about the noise spectrum as χ(t). Indeed, Φ(t) is related to χ(t) via detailed balance, with:

$$\Phi (t)=\int\nolimits_{-\infty }^{\infty }d\omega \,S(\omega )\coth \left(\frac{\omega }{2{k}_{{{{\rm{B}}}}}T}\right)G(\omega t),$$
(2)

where G(ωt) encodes the effect of the DD sequence on the imaginary-part Ramsey procedure, T denotes temperature, and kB the Boltzmann constant. Hence, knowledge of either χ(t) or Φ(t) implies knowledge of the other. Other noise spectroscopy works have distinguished between classical and quantum noise sources, with classical noise leading to a signal where C(t)~eχ(t). However, such a measurement would indicate the breakdown of detailed balance. Instead, we articulate the problem in terms of \(C(t)=| \tilde{C}(t)|\) and emphasize that such a measurement does not imply that the source of noise is classical. We also note that previous work has shown that Φ(t) appears in the case of biased coupling29 or in the M2 model28, when the interaction of the qubit with the bath has the form \(\frac{1}{2}\lambda ({\hat{\sigma }}_{{{{\rm{z}}}}}+\eta \hat{{\mathbb{I}}})\otimes \hat{V}\), where \(\hat{V}\) is a bath operator and η ≠ 0. This case is particularly relevant for qubits based on the m = 0, ±1 levels of the NV center in diamond.

To demonstrate the advantages of our proposed FTNS, we first consider what is arguably the state-of-the-art approach to noise spectroscopy: the Álvarez-Suter protocol. The main insight of the Álvarez-Suter method is that when the number of pulses is sufficiently large, the filter function reaches the spectroscopic limit. In this limit, one can approximate the filter function by a δ-function (frequency comb) with various harmonics: \(\chi (t)\approx t\mathop{\sum }\nolimits_{k = 1}^{{k}_{{{{\rm{c}}}}}}{\left\vert {A}_{k{\omega }_{0}}\right\vert }^{2}S\left(k{\omega }_{0}\right)\), where \({A}_{k{\omega }_{0}}\) are the Fourier coefficients for a given pulse sequence, truncated at kc (for the CPMG sequence, \({A}_{k{\omega }_{0}}=0\) for even k). Applying many π-pulses is necessary for each peak to better resemble a δ-function. The extreme case of kc = 1 approximates the filter function as a single δ function, discarding many details of the noise spectrum. This is referred to as the single δ-function approximation or the first harmonic approximation. Often, one can still account for a limited number of harmonics (set by the cut-off kc), which attenuates the loss of spectral information6,24. In the latter case, by appropriately varying the delay time between pulses and the total time of the sequence, one can form a linear system of equations consisting of coherence values at selected times and a matrix of contributing Fourier coefficients. Inverting this system of equations yields the noise spectrum at the probed frequencies, which are bounded by \(\pi /{\tau }_{\max }\le | {\omega }^{{{{\rm{DDNS}}}}}| \le \pi /{\tau }_{\min }\). Here, τmax(min) is the maximum (minimum) delay between consecutive π-pulses required to minimize the overlap between subsequent pulses and validate the instantaneous pulse assumption. Furthermore, since A(k=0) = 0 for balanced pulse sequences like CPMG, the zero-frequency part of the spectrum cannot be accessed directly. Thus, going beyond the \(\pi /{\tau }_{\max }\le | {\omega }^{{{{\rm{DDNS}}}}}| \le \pi /{\tau }_{\min }\) limit and extracting S(ω = 0) requires imbalanced sequences such as concatenated dynamical decoupling (CDD)11. Hence, the experimental overhead, frequency restrictions, and accuracy dependence on harmonic inclusions of Álvarez-Suter23 motivate the development of a more accessible scheme.

FTNS directly maps FID coherence to the noise spectrum

We introduce a radically more straightforward approach by inverting Eq. (1) directly to obtain the noise power spectrum. We first demonstrate this in the context of free induction decay, noting that \({F}_{{{\mbox{FID}}}}(\omega t)=(4/{\omega }^{2}){\sin }^{2}(\omega t/2)\)1. Substituting FFID(ωt) in Eq. (1), and differentiating twice with respect to time, we obtain

$${\ddot{\chi }}_{{{{\rm{FID}}}}}(t)=\frac{1}{2\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,S(\omega )\cos (\omega t).$$
(3)

We Fourier transform both sides to find

$$S(\omega )=\sqrt{2\pi }\,{{{\mathcal{F}}}}\left[{\ddot{\chi }}_{{{{\rm{FID}}}}}(t)\right],$$
(4)

noting that S(−ω) = S(ω). This straightforward derivation demonstrates that there is a simple and invertible one-to-one map between the noise power spectrum S(ω) and the second time derivative of the logarithm of the experimentally measured coherence function.

To illustrate this method for an analytically solvable case, we adopt a Gaussian-shaped noise power spectrum \(S(\omega )=A{{{{\rm{e}}}}}^{-{(\omega /\sigma )}^{2}}\). The coherence function of this noise profile can be obtained analytically:

$$C(t)=\exp \left\{-\frac{A}{\sigma }\left[\frac{t\sigma }{2}\,{{\mbox{Erf}}}\,\left(\frac{t\sigma }{2}\right)+\frac{{{{{\rm{e}}}}}^{-\frac{{t}^{2}{\sigma }^{2}}{4}}-1}{\sqrt{\pi }}\right]\right\},$$
(5)

where \(\,{{\mbox{Erf}}}\,(z)=2{\pi }^{-1/2}\int\nolimits_{0}^{z}{{{{\rm{e}}}}}^{-{x}^{2}}\,dx\) is the Error function. The second derivative of the attenuation function takes the expected Gaussian form,

$${\ddot{\chi }}_{{{{\rm{FID}}}}}(t)=\frac{A}{\sqrt{2\pi }}{e}^{-\frac{{t}^{2}{\sigma }^{2}}{4}},$$
(6)

as does its Fourier transform,

$${{{\mathcal{F}}}}\left[\frac{A}{\sqrt{2\pi }}{{{{\rm{e}}}}}^{-\frac{{t}^{2}{\sigma }^{2}}{4}}\right]=\frac{A}{\sqrt{2\pi }}{{{{\rm{e}}}}}^{-{(\omega /\sigma )}^{2}},$$
(7)

suggesting \({S}_{{{\mbox{rec}}}}(\omega )=A{{{{\rm{e}}}}}^{-{(\omega /\sigma )}^{2}}\). This simple example illustrates that the FTNS method retrieves the original noise spectrum.

Eq. (3) has important implications for the asymptotic behavior (i.e., \(\lim t\to \infty\)) of \({\ddot{\chi }}_{{{{\rm{FID}}}}}(t)\). Specifically, we may invoke the Riemann-Lebesgue lemma32 for integrable noise spectra — a physically reasonable assumption. This behavior ensures that \(\mathop{\lim }\nolimits_{t\to \infty }\ddot{\chi }(t)\to 0\) and, therefore, that the long-time limit of the attenuation function must grow linearly with time, \(\mathop{\lim }\nolimits_{t\to \infty }\chi (t)\propto t\). This linear t scaling of \(\mathop{\lim }\nolimits_{t\to \infty }\chi (t)\) has important implications that we exploit below to provide a theoretically justified and practical approach to inverting experimentally measured coherences, C(t), to well-behaved power spectra, S(ω).

Translating the above insights into a noise spectroscopy procedure is straightforward. First, one measures the coherence function C(t) from free induction decay by performing Ramsey measurements at various times, yielding an array of coherence values in [0, Tmax] with a sampling interval, or resolution, δt. One then takes a logarithm of the data and numerically performs a double derivative on the sampled χFID(t) values. A Fourier transform of the resulting data yields the noise spectrum S(ω). For this, one can employ a discrete Fourier transform or numerical quadrature to obtain equivalent results.

Advantages of FTNS

To illustrate the power of the FTNS approach, we assess its ability to reconstruct single-,

$$S(\omega )=\frac{{s}_{0}}{1+{\left(8\omega /{\omega }_{{{{\rm{c}}}}}\right)}^{2}},$$
(8)

and double-Lorentzian spectra,

$$\begin{array}{l}S(\omega )\,=\,\frac{{s}_{0}}{1\,+\,{\left(8\omega /{\omega }_{{{{\rm{c}}}},1}\right)}^{2}}\,+\,\frac{{s}_{1}}{1\,+\,8{(8[\omega -d]/{\omega }_{{{{\rm{c}}}},2})}^{2}}\\\qquad\qquad+\,\frac{{s}_{1}}{1\,+\,8{(8[\omega\,+\,d]/{\omega }_{{{{\rm{c}}}},2})}^{2}},\end{array}$$
(9)

that are relevant to bulk19 and near-surface20 NV centers, respectively. Here s0 and s1 represent the average coupling strength of the bath to the qubit, and 1/ωc is the correlation time of the bath.

Figure 1(a) shows a single Lorentzian peak (gray, shaded) and its spectrum reconstruction using the Álvarez-Suter method with a CPMG sequence with 32 π-pulses total henceforth referred to as the 32-pulse Álvarez-Suter (red circles), the single δ-function approximation of the 32-pulse Álvarez-Suter (light blue crosses), and FTNS (dark blue line and squares), respectively, in units of 1/T2. We assume ideal π pulses with perfect fidelity and infinitely short duration throughout the article. In this figure, we aim to show the advantages that each method offers in principle. For this reason, we use a large number of coherence measurements and a long final measurement time. In subsequent figures, we introduce practical considerations to demonstrate how each method can be expected to perform in an experimental setting. The absolute error of the reconstructed spectrum compared to the true spectrum is computed as Δ(ω) = S(ω) − Srec(ω). As Fig. 1 demonstrates, FTNS outperforms the 32-pulse Álvarez-Suter method at low-frequencies while only requiring free induction decay measurements.

Fig. 1: Comparison of a simple noise spectrum reconstruction between the FTNS and DDNS methods.
figure 1

a A Lorentzian spectrum and its reconstruction using 32-pulse Álvarez-Suter (AS), the 32-pulse single δ-function approximation (kc = 1), and FTNS. Álvarez-Suter method: 3662 frequencies have been reconstructed but only selected points have been marked for clarity and only a subset of these fall within the frequency range shown as most fall in the high-frequency regime. FTNS: only frequencies corresponding to the marked Álvarez-Suter ones are shown. b The absolute error compared to the true spectrum. The spectrum parameters are given in the “Methods” section A. The coherence function contains 1930 points with a resolution of δt/T2 = 0.00314 and a final measurement time of \({T}_{\max }/{T}_{2}=6.06\) for the FTNS method and 3662 points with a minimum measurement time of \({T}_{\min }/{T}_{2}=0.101\) and a final measurement time of \({T}_{\max }/{T}_{2}=368.1\) for the AS and δ-function methods. While DDNS requires many pulses to achieve comparable accuracy and a much longer maximum measurement time for comparable resolution, FTNS outperforms DDNS and uses only free induction decay measurements.

We note that for Figs. 14, T2 is defined as the inverse of the slope of χ(t) at sufficiently long times when χ(t) scales linearly in time. This definition ensures that the T2 time measures the time constant associated with exponential decay, which can only be expected to arise at sufficiently long times. For Figs. 5 and 6, the forms of the spectra make it hard to apply the same definition. In these cases, we employ an alternative definition of \({T}_{2}^{* }\) as the time when the coherence crosses the value e−1≈0.3678 for the first time, under a spin echo pulse sequence.

Noting the difficulties of the DDNS approach in accessing the noise spectrum in both \(\pi /{\tau }_{\max }\le | {\omega }^{{{{\rm{DDNS}}}}}| \le \pi /{\tau }_{\min }\) and S(ω→0) limits, it is worth considering if and how similar limitations may hinder the FTNS approach. Since our protocol for FTNS relies on the discrete Fourier transform, two quantities determine the highest accessible frequency (\({\omega }_{\max }^{{{{\rm{FTNS}}}}}\)) and its spectral resolution (δωFTNS), which in turn determines the lowest accessible frequency (\({\omega }_{\min }^{{{{\rm{FTNS}}}}}\)): the sampling interval, δt, of the coherence function measurement, and the total measurement time, Tmax. Specifically, \(| {\omega }_{\max }^{{{{\rm{FTNS}}}}}| =\pi /\delta t\) and \(| {\omega }_{\min }^{{{{\rm{FTNS}}}}}| =\delta \omega =1/{T}_{{{\mbox{max}}}}\). While δt is determined by limitations of state-of-the-art measuring devices, Tmax depends on the physical problem. Yet, for many cases of physical interest, \(\ddot{\chi }(t)\to 0\) at times earlier than Tmax (“Methods” section C). This allows one to zero-pad \(\ddot{\chi }(t\ge {T}_{{{\mbox{max}}}})\) to a new effective \({\tilde{T}}_{{{\mbox{max}}}}\gg {T}_{{{\mbox{max}}}}\), offering sufficient spectral resolution to access S(ω→0).

Given the importance of δt in allowing FTNS to access high frequencies and the analogous role that the minimum delay time, \({\tau }_{\min }\), plays in DDNS, we now consider their connection in greater detail. \({\tau }_{\min }\) determines the earliest time (after t = 0) where one can measure the coherence function, i.e., \(C({\tau }_{\min })\). Since the discrete Fourier transform requires measurements of C(t) at regular intervals, one might be tempted to assume that \(\delta t={\tau }_{\min }\). This need not be the case. After all, for \(t\ge {\tau }_{\min }\), the measurement interval δt is not determined by \({\tau }_{\min }\) and can be set such that \(\delta t < {\tau }_{\min }\). While the resolution of the coherence function measurements at later times can be made as fine-grained as desired, one still needs to perform measurements in \([0,{\tau }_{\min }]\) to achieve a consistent δt through [0, Tmax]. To achieve this, we suggest employing the limit ωt 1, which reveals that the attenuation function behaves as χ(t)≈αt2 + βt4 + γt6, to fit C(t) at early times (“Methods” section B). This guarantees that FTNS can be implemented even when constrained to the same minimum delay time of dynamical decoupling pulse sequences.

We are now in a position to illustrate the ability of FTNS to capture a spectrum composed of a sum of Gaussians (Fig. 2(a)), and a double-Lorentzian spectrum (Fig. 2(b)), each compared to a reconstruction using a 32-pulse and a 16-pulse Álvarez-Suter subject to the same \({\tau }_{\min }\) and \({T}_{\max }\) constraint: \(C(t\le {T}_{\max })\ge 0.005\) (“Methods” section B). To compare our FTNS results to the best possible Álvarez-Suter output, the results shown in Fig. 2 are a combination of results from a 32 (16)-pulse Álvarez-Suter procedure, and additional iterations of the 32 (16)-pulse single-δ function approximation procedure at frequency values between those evaluated by the Álvarez-Suter method. We have done this to artificially increase the frequency resolution of the reconstructed Álvarez-Suter spectra, although, to our knowledge, this adds a significant experimental expense. Without this, the spectrum reconstruction obtained from the Álvarez-Suter procedure would have a much poorer frequency resolution. We also employ this approach to compare against the best possible Álvarez-Suter results in Figs. 5, 6.

Fig. 2: Comparison of structured noise spectra reconstructions between the FTNS and DDNS methods.
figure 2

Examples of two structured noise spectra reconstructed using FTNS (solid dark blue line), a 32-pulse Álvarez-Suter (AS) method (red dashed line), and a 16-pulse AS method (light blue dots). The parameters for each spectrum and early-time fitting parameters are given in the “Methods” section A. The coherence function used to implement our FTNS protocol in (a) contains 596 points with a resolution of δt/T2 = 0.006291. Only select points have been marked for the 16-pulse AS results, for clarity. For the spectrum in (b) our FTNS coherence function contains 599 points with a resolution of δt/T2 = 0.005156. The red and light blue vertical lines indicate the frequency limits up to which the 32-pulse and 16-pulse Álvarez-Suter methods (respectively) can reconstruct the spectrum for the given minimum delay time: \(| {\omega }_{\,{{\mbox{min}}}\,}^{{{{\rm{DDNS}}}}}| \ge \pi /{\tau }_{\max }\). Our free induction decay-based FTNS accurately reconstructs the noise spectrum, even in the low-frequency regions containing the main features of the spectra that the AS methods cannot capture.

Even in this optimal (but experimentally expensive) Álvarez-Suter implementation, both panels of Fig. 2 show that the Álvarez-Suter spectra (red dashed line, light blue dots) cannot access their respective \(| \omega | \,<\, {\omega }_{\min }^{{{{\rm{DDNS}}}}}\). To go beyond these limits in DDNS, one can employ complex CDD sequences or relax the constraint on the \({T}_{\max }\) imposed. In contrast, FTNS only has difficulty resolving the feature at ω~ ± 1.27 [1/T2] in Fig. 2(a) which is another consequence of the \({T}_{\max }\) restriction. Going beyond this maximum measurement time is required to recover this feature using the FTNS method. Further, while reducing the number of pulses used in the Álvarez-Suter method allows lower frequencies to be probed, there is a limit to how much the pulse number can be reduced, as at a sufficiently low pulse number, the assumptions underlying the Álvarez-Suter method fail to hold. Thus, FTNS uses a simple free induction decay measurement that successfully reconstructs the spectrum in the frequency range that is inaccessible to the DDNS method, giving access to information that would be otherwise lost.

Since smaller δt gives access to higher \({\omega }_{\max }^{{{{\rm{FTNS}}}}}\) but raises the cost of the experimental procedure, we turn to the trade-off in FTNS accuracy and the sampling interval δt. Figure 3 depicts FTNS spectrum reconstructions using sets of coherence measurements for a fixed measurement time Tmax with varying δt. Clearly, increasing the resolution of coherence measurements (i.e., decreasing δt) improves the accuracy of the FTNS reconstruction, especially at higher frequencies. As expected, even low sampling rates accurately reconstruct the low-frequency part of the spectrum while the high-frequency part can be systematically improved with finer δt. The ability of FTNS to capture the low-frequency component even at low sampling rates is particularly advantageous for decoherence mitigation purposes as low-frequency noise often dominates decoherence33,34. Thus, even when measurement resolution is limited, FTNS can be expected to perform well at low-frequencies and one can systematically assess its accuracy by monitoring convergence with finer δt.

Fig. 3: Systematic improvement of the noise spectrum reconstructions using FTNS as the sampling interval is decreased.
figure 3

FTNS reconstructions of the multi-Gaussian spectrum in Fig. 2a for different values of the sampling interval, δt, for a fixed Tmax/T2 = 6.291 (other parameters are the same as Fig. 2a). The legend shows the values of δt/T2 used to obtain the FTNS results shown.

Robustness against errors

Since FTNS requires performing two numerical derivatives, it is sensitive to errors that occur during the initialization and measurement phase (e.g., state preparation and measurement (SPAM) errors, and statistical uncertainty due to finite measurement repetition) of the protocol. There are multiple sources of errors that can compromise the measured value of the coherence function at a given time. These include background and shot noises, and imperfect fidelity of the applied pulses35,36. In optical setups, photon losses can also reduce the number of effective measurements. Nevertheless, various methods to perform controlled numerical derivatives of noisy data are available37,38. As an example, here we utilize a simple denoising method that mitigates the effect of noise and preserves all the advantages of FTNS even on structured noise spectra. Figure 4 shows examples of FTNS spectra reconstructed from artificially noisy data corresponding to an effective fixed measurement error of 0.1% of the range (difference between maximum and minimum) of the coherence function (for examples of the same reconstruction with higher error rates, see Fig. 7). This Gaussian-distributed statistical noise is meant to mimic all uncorrelated errors in coherence measurements, including readout errors, which can be grouped with the shot noise. By increasing the number, N, of repetitions (i.e., individual measurements of the spin coherence function via ensemble readout at each control condition), the statistical variation of the signal diminishes as \(1/\sqrt{N}\). We perform linear fitting of χ(t) at long times (consistent with the asymptotic behavior of \(\ddot{\chi }(t)\) established using the Riemann-Lebesgue lemma in the section on the Theoretical Description) and apply low-pass filters to recover the approximate noise spectrum, which shows good agreement with the true spectrum, revealing its essential features (see “Methods” section C for details). Hence, our simple free induction decay-based noise spectroscopy approach can semi-quantitatively recover the frequency and the height of the peaks of the noise spectrum, which constitute the minimum required spectral information to design effective filter functions to mitigate decoherence from a dynamical decoupling perspective.

Fig. 4 : Noise spectrum reconstructions using the FTNS method under simulated measurement error.
figure 4

Spectrum reconstruction using FTNS assuming 0.1% measurement error in the coherence measurements for the same spectra shown in Figs. 1a and 2b in (a) and (b), respectively (with the same parameters). Even subject to SPAM errors, utilizing simple denoising techniques allows FTNS to quantitatively capture the height and frequency of the peaks near ω = 0 and qualitatively obtain the peaks at higher frequencies, in the spectrum.

While our analysis thus far accounts for the theoretical constraints of the discrete Fourier transform, the experimental feasibility of FTNS is sensitive to δt and the minimum delay time \({\tau }_{\min }\). Controlling these parameters requires flexibility in pulse design, which varies depending on the platform. For instance, solid-state spins can be controlled either optically with pulses that range from a few ps up to 1 ns39,40,41,42 or via microwave pulses as short as 12 ns43. Such pulses allow for ns-scale minimum delay times, \({\tau }_{\min }\), between pulses. Furthermore, tuning the sampling interval δt to ps-order precision is also achievable. For example, from an implementation perspective, two microwave pulses with a controllable delay can be generated with an arbitrary waveform generator and the delay between two optical pulses can be easily controlled by varying the length of an arm in the Michelson interferometer. To illustrate how these timescales satisfy our FTNS requirements, consider the δt required to reconstruct the double-Lorentzian spectrum shown in Fig. 2b in the NV center parameter regime19,44,45,46 with T2 = 1.32 μs. To obtain the accurate reconstruction shown in Fig. 2b, one would need to measure 599 points with δt≈7 ns. Thus, sufficiently high-resolution measurements that faithfully reconstruct various noise spectra can be comfortably performed with experimentally available technology.

Since the feasibility of FTNS also relies on the ability to sufficiently reduce statistical noise (~0.1%) within a reasonable time, we now consider what current technology can afford. Each point on the coherence curve arises from a Ramsey measurement at a given time, repeated multiple times to construct the single-qubit ensemble average. To minimize statistical noise associated with finite sampling, the repetition rate of such experiments needs to be sufficiently high. To estimate the time required for the FTNS experiment, we multiply the time it takes to perform a single-shot experiment on a single data point along the coherence curve by the number of independent measurements required to bring the statistical noise level to the desired threshold, under the assumption that independent random Gaussian fluctuations can satisfactorily model the combined effects of the sources of statistical noise. We apply this protocol to find the time required on available experimental setups to bring the statistical error to the 0.1% value assumed in Fig. 4 in the measured coherence of NV centers with T2~few μs19,44,45, with access to nanosecond microwave pulses. This 0.1% error requires that each point along the coherence curve be measured ~106 times. A single measurement takes ~10 μs (including the initialization and readout). Thus, requiring ~100 data points along C(t) takes ~2.8 h (assuming a modest photon collection rate of ~10%). Importantly, these numbers represent a conservative estimate and can be expected to improve significantly with better photon collection rates or through non-uniform sampling techniques47,48,49,50,51. Further, by requiring only two π/2 pulses, free induction decay-based FTNS avoids measurement error arising from imperfect pulses, which accrues significantly in large dynamical decoupling pulse sequences with many π pulses.

Spin echo FTNS

The FTNS protocol that we have discussed so far employs free induction decay coherence measurements that decay sufficiently slowly so as to allow enough measurements of the coherence curve to support a well-behaved Fourier transform. A fast decaying behavior can arise from a sharply peaked low-frequency noise component at ω = 0. In such scenarios, it is customary to utilize a single π-pulse spin echo (SE) sequence to remove the effect of the low-frequency component of S(ω) to prolong the T2 time. It would therefore be beneficial to provide a one-to-one map and a noise spectroscopy protocol to perform FTNS based on the spin echo sequence. Below we derive this one-to-one map and offer a practical protocol for spin echo-based FTNS. We further show that while spin echo-based FTNS tends to be less accurate at low-frequencies, it can outperform the free induction decay-based method at higher frequencies, especially in the presence of strong low-frequency noise. In addition, the spin echo-based method enables the reconstruction of 1/f-type spectra which is not possible using the free induction decay-based method.

The filter function of the spin echo sequence is \({F}_{{{\mbox{SE}}}}(\omega ,t)=(16/{\omega }^{2})\,{\sin }^{4}(\omega t/4)\). Following similar steps to those used for free induction decay, we take a double derivative of the spin echo attenuation function to find,

$${\ddot{\chi }}_{{{{\rm{SE}}}}}(t)=\frac{1}{2\pi }\int\nolimits_{-\infty }^{\infty }d\omega S(\omega )[\cos (\omega t/2)-\cos (\omega t)],$$
(10)

and therefore,

$$\sqrt{2\pi }{{{\mathcal{F}}}}[{\ddot{\chi }}_{{{{\rm{SE}}}}}(t)]=2M(2\omega ),$$
(11)

where M(ω) ≡ S(ω) − S(ω/2)/2. M(ω) corresponds to an array of measurements that can be performed at regular values of \({\omega }_{n}\in [0,\delta \omega ,2\delta \omega ,...,{n}_{\max }\delta \omega ]\), where \(n\in {\mathbb{N}}\), separated by an interval δω that are accessible via the Fourier transform of the second derivative of the spin echo coherence function. Hence, we write M(ωn) = M(n × δω).

While the map in Eq. (11) provides the spectral function S(ω), it also contains an unwanted part, S(2ω), which we need to isolate and remove. We introduce a simple recursive method that allows us to extract the spectral function S(ω) from our spin echo-based FTNS results:

$$S(2n\delta \omega )=M(2n\delta \omega )+\frac{1}{2}S(n\delta \omega ),$$
(12)
$$\begin{array}{l}S((2n+1)\delta \omega )\,=\,M((2n+1)\delta \omega )\\\qquad\qquad\qquad\qquad+\,\frac{1}{4}(S((n+1)\delta \omega )+S(n\delta \omega )).\end{array}$$
(13)

To arrive at this result, we first exploit the fact that S(0) = 2M(0). While the Fourier transform does not give access to M(ω = 0), it can be interpolated. We then approximate S(nδω/2) for odd n as the arithmetic average of two adjacent points, S(nδω/2) ≈ (1/2)(S((n − 1)δω/2) + S((n + 1)δω/2)), allowing us to find S(δω) = (4/3)(M(δω) − S(0)/4).

To see the performance of the spin echo version of the FTNS, we apply this protocol to an experimentally inspired, highly peaked low-frequency double-Lorentzian spectrum given by

$$\begin{array}{ll}S(\omega )\,=\,\frac{{s}_{0}}{1\,+\,{\left(\frac{8\omega }{{\omega }_{{{{\rm{c}}}},0}}\right)}^{2}}\\ \qquad+\,\mathop{\sum }\limits_{i=1}^{3}\frac{{s}_{i}}{1\,+\,8{\left(\frac{8[\omega -{d}_{i}]}{{\omega }_{{{{\rm{c}}}},i}}\right)}^{2}}+\,\frac{{s}_{i}}{1\,+\,8{\left(\frac{8[\omega +\,{d}_{i}]}{{\omega }_{{{{\rm{c}}}},i}}\right)}^{2}},\end{array}$$
(14)

with parameter values as given in “Methods” section A. For this spectrum, the maximum measurement time (obtained by imposing the condition that C(t) > 0.005 at all times) under the spin echo sequence is about 5.5 times longer than that under free induction decay, corresponding to a moderate scenario in which we envision the spin echo-based FTNS offering an advantage. Figure 5 shows that the spin echo-based FTNS entirely misses the presence of the narrow low-frequency peak but faithfully captures the tri-peak structure of the mid-frequency feature in the 1 − 5 MHz range. Instead, the free induction decay-based FTNS identifies a peak at low-frequency but is unable to capture any structure for the mid-frequency peak. The inability of the spin echo method to capture the sharp feature at ω≈0 is likely because the application of the single π-pulse removes the inhomogeneous (ω→0) contribution in the power spectrum. In contrast, the inability of the free induction decay method to capture the mid-frequency features likely arises from the fast decay of the signal and the stringent limit on the measurement time. What is most remarkable is that in such systems with a dominant inhomogeneous contribution, the spin echo-based method can resolve the finer structure in the higher frequency peaks compared to the free induction decay method. This illustrates a distinct benefit arising from an increased coherence time on the performance of the FTNS method. In contrast to FTNS, 16-pulse DDNS is again unable to capture many of the prominent features of the spectrum. What is more, one needs to resort to a 16-pulse sequence instead of a 32-pulse sequence to at least partially reconstruct the prominent feature of the spectrum for both Figs. 5 and 6. Thus, both free induction decay and spin echo FTNS methods perform better than DDNS, capturing an informative description of both the central peak and the higher frequency components.

Fig. 5: Comparison of structured noise spectrum reconstruction between the SE FTNS, FID FTNS, and DDNS methods.
figure 5

Performance of spin echo (SE) FTNS, free induction decay (FID) FTNS, and 16-pulse AS for a sharply peaked low-frequency double-Lorentzian spectrum, with \({T}_{2}^{* }=1.646\) (as defined in the main text). Only every other point in the AS reconstruction has been plotted for clarity. The FTNS methods identify some of the low-frequency and high-frequency components of the spectrum. In particular, while the FID FTNS identifies the presence of peaks at ω~0 and at ω~2, it cannot capture their details accurately. On the other hand, SE FTNS is blind to the sharp peak at zero-frequency but resolves the finer structure in the higher frequency peaks in the spectrum. In contrast, the DDNS method again fails to reconstruct the relevant low-frequency regions of the spectrum due to the restrictions imposed by \({\tau }_{\max }\).

Another important advantage of spin echo FTNS is that it enables one to reconstruct spectra that scale as 1/ωn at low-frequencies (termed 1/f spectra), which are observed in many relevant systems24,52. The one-to-one correspondence between the S(ω) and χSE(t) through the spin echo FTNS in Eq. (11) provides a unique pathway to analytically derive an expression for the attenuation function of a 1/f-type spectrum. Namely, for \({S}_{{{{\rm{1/f}}}}}(\omega )={{{\mathcal{A}}}}/{\omega }^{n}\), we find

$${\chi }_{{{{\rm{SE}}}},1/f}(t)={{{{\mathcal{Y}}}}}_{n}{t}^{n+1},$$
(15)

where n is a positive value less than 3, Γ(  ) is the gamma function (see “Methods” section E), and the coefficient function \({{{{\mathcal{Y}}}}}_{n}\) is given by

$$\left\{\begin{array}{ll}{{{\mathcal{A}}}}\log (2)/4\pi \quad &n=1,\\ {{{\mathcal{A}}}}/24,\quad &n=2,\\ -{{{\mathcal{A}}}}{\pi }^{-1}\left(1-{2}^{1-n}\right)\sin \left(\frac{\pi n}{2}\right)\Gamma (-n-1),\quad &{{{\rm{otherwise}}}}.\end{array}\right.$$
(16)

The focus on n < 3 is motivated by experiments in spin qubits53. These solutions reveal that χSE(t) due to a 1/f spectrum is proportional to tn+1. In fact, the same asymptotic time dependence for the 1/f spectrum has been approximately obtained for various pulse sequences, including CPMG1, and used to analyze the output of noisy dynamical decoupling data53. Thus, 1/f noise spectra stand in contrast to integrable counterparts that remain finite over the entire frequency range (e.g., Gaussian and Lorentzian peaks), for which we used the Riemann-Lebesgue lemma to demonstrate that \(\mathop{\lim }\nolimits_{t\to \infty }\ddot{\chi }(t)\to 0\), implying that χ(t) is proportional to t at long times (see “Methods” section C). These distinctly different behaviors of finite versus 1/f-type spectra enable one to distinguish the two, even at the level of the asymptotic scaling of the response function, χ(t). Specifically, by performing a polynomial fit of the t dependence of the measured χ(t), one can obtain the parameters that characterize the 1/f response needed to fully reconstruct S(ω) (see “Methods” section E). Finally, we note that for n ≥ 3, the integral expression for χ(t) under spin echo, as given by Eq. (1), diverges. This suggests that pulse sequences with higher numbers of pulses (and therefore higher orders of \(\sin (\omega t)\) in the filter function for CPMG, for example) need to be applied to probe such noise spectra. In principle, the procedure to arrive at the spin echo FTNS can be repeated for such alternate pulse sequences for the ability to probe 1/f noise spectra beyond n = 3. Furthermore, previous work has shown that multi-pulse CPMG sequences with an even number of pulses have a filter function that scales as F(ωt) ω4 at low-frequencies1,53, implying that χ(t) is finite for n < 5. When the number of pulses is odd, the filter function scales as F(ωt) ω2 at low-frequencies1,53, implying that χ(t) is finite for n < 3.

While this analysis shows that it is possible to distinguish the presence and ω-scaling of diverging contributions to the power spectra, we now demonstrate that our spin echo-based FTNS also enables us to quantitatively reconstruct both diverging and well-behaved contributions to the power spectrum. Specifically, in Fig. 6, we interrogate the ability of this procedure to disentangle and reconstruct a complex noise spectrum consisting of 1/f-type and always-finite (Lorentzian) contributions. For the spin echo FTNS, we process the coherence data as outlined in “Methods” section E. The 1/f parameters that we extract, even under the experimentally motivated constraint of setting \(C({t}_{\max }) \,>\, 0.005\), agree well with the true spectrum parameters while the 16-pulse DDNS method is again able to retrieve only part of the Lorentzian contributions to the spectrum. What is more, the total reconstructed spectrum obtained simply through a spin echo measurement faithfully captures both the positions and widths of the high-frequency peaks and the low-frequency 1/ω behavior. Importantly, as a consequence of the Riemann-Lebesgue lemma, this protocol for 1/f noise spectroscopy can be used to disentangle spectra consisting of combinations of 1/f form and any other form f(ω), as long as \(\int\nolimits_{-\infty }^{\infty }| f(\omega )| d\omega \,<\, \infty\). Hence, the combination of free induction decay- and spin echo-based FTNS allows one to address complex spectra consisting of combinations of the most commonly encountered functional forms in physical systems.

Fig. 6: Comparison of 1/f-type noise spectrum reconstruction between the SE FTNS and DDNS methods.
figure 6

Performance of the spin echo FTNS and AS methods in reconstructing 1/f-type noise (as given in Eq. (47)), with \({T}_{2}^{* }=2.524\). The same coherence measurement constraints of \({t}_{\min }=0.01\) and \({t}_{\max }=4\) are imposed on both methods, leading to a 300-point reconstruction for the spin echo FTNS method and a 330-point reconstruction for the AS method. The AS method is again unable to reconstruct relevant low-frequency characteristics of the spectrum due to the limitations in maximum coherence measurement time, and the majority of the reconstructed points lie in the higher frequency regions, for which zeros are evaluated. In contrast, the spin echo FTNS method accurately reconstructs both the low-frequency 1/f behavior and the positions and widths of the finite peaks located at high frequencies, with high resolution.

Summary and outlook

We conclude the comparison of both versions of FTNS and state-of-the-art DDNS with a few general remarks regarding their applicability. First, the information about low-frequency components in S(ω) is encoded in the long-time behavior of the coherence function C(t). However, since one cannot measure arbitrarily small values of the coherence function C(t) at long times, we set a measurement cut-off of C(t) > 0.005 for all methods considered, i.e., Álvarez-Suter DDNS and free induction decay- and spin echo-based FTNS (see “Methods” section D). This limits the number of points that can be reconstructed via DDNS and can also lead to the numerical instability of the Fourier transform. While this can lead to poor resolution of the reconstructed spectrum for the DDNS method, we have shown that FTNS can recover the prominent features of the noise spectrum, albeit at the cost of sometimes introducing unphysical oscillations that can be tamed with more extensive measurements. Second, one can invert higher-order dynamical decoupling sequences via the FTNS method and extract the noise power spectrum from the resulting Fourier transform via a similar iterative approach as that outlined for our spin echo-based FTNS. We show that in systems where the coherence time is greatly improved through the application of a spin echo sequence, our spin echo-based FTNS can outperform the free induction decay-based method in reconstructing high-frequency spectral features, at the cost of discarding information about the zero-frequency spectral features. Thus, while the accuracy of DDNS requires a large number of pulses, simple free induction decay, and spin echo measurements suffice for our FTNS procedures. As we have shown, our spin echo FTNS even enables one to disentangle and accurately reconstruct spectra containing mixtures of 1/f-type and always-finite contributions. In cases where the spectrum consists of only always-finite contributions, simple free induction decay measurements provide the same spectral information. Hence, even for systems whose free induction decay coherence decays rapidly, FTNS offers significant advantages over DDNS in terms of resolution and simplicity of implementation.

In summary, we have introduced a noise spectroscopy method that significantly outperforms current DDNS methods and is significantly easier to implement from both experimental and theoretical perspectives. Our work demonstrates the existence of a direct one-to-one invertible map between the pure dephasing coherence function within the filter function formalism and the noise power spectrum. Noting that current technology allows one to minimize measurement and statistical errors, it is clear that FTNS provides a promising route to accurately and inexpensively measure noise power spectra. Our FTNS performs efficiently when free induction decay occurs sufficiently slowly, as in trapped-ion systems54,55. We have further developed a spin echo FTNS protocol that enables the characterization of fast decaying systems exhibiting 1/f-type noise, allowing us to reconstruct even spectra dominated by strong inhomogeneous contributions, as in most NV centers19,20. Therefore, our FTNS protocol should be applicable to a wide range of quantum platforms and can be utilized as a powerful tool to deduce information about the environmental interactions that lead to the decoherence of qubits or quantum sensors.

Methods

Figure parameters

Here, we list the spectrum parameters for each figure.

For Fig. 1, the Lorentzian spectrum is given by Eq. (8) with s0 = 2.000/T2 and ωc = 10.186/T2.

For Fig. 2(a), we employed a combination of four Gaussians,

$$S(\omega )=\mathop{\sum}\limits_{i}{A}_{i}{e}^{-{(\omega -{\mu }_{i})}^{2}/{\sigma }_{i}^{2}},$$
(17)

where Ai {1.998, 0.3995, 0.7990, 0.9988}/T2, σi {0.9537, 0.1272, 0.9537, 0.9537}/T2, and μi {0.000, 1.272, 4.769, 2.543}/T2. The parameters we obtained from the early-time fitting are {κ(0), κ(1), κ(2)} = {0.7667, −0.5827, 0.3903}. For Fig. 2b, we used a double-Lorentzian given by Eq. (9) with parameters s0 = 1.939/T2, ωc,1 = ωc,2 = 19.39/T2, d = 12.12/T2, and s1 = 6.093/T2. We obtained the following early-time parameters {κ(0), κ(1), κ(2)} = {3.777, −117.1, 59380}.

For Fig. 5, the spectrum is given by Eq. (14), with parameter values si {150π, 2π, π, 2}, ωc,i {0.02, 6, 2, 1}, and di {15/8, 20/8, 10/8}.

For Fig. 6, S(ω) is given by

$$S(\omega )=\frac{{{{\mathcal{A}}}}}{{\omega }^{n}}+\frac{B}{1+{\left(\frac{\omega -d}{{\omega }_{{{{\rm{c}}}}}}\right)}^{2}}+\frac{B}{1+{\left(\frac{\omega +d}{{\omega }_{{{{\rm{c}}}}}}\right)}^{2}},$$
(18)

with parameter values \({{{\mathcal{A}}}}=1,\,\,B=1,\,\,n=2.5,\,\,{\omega }_{{{{\rm{c}}}}}=1.5,\,\,d=12.5\).

Early-time measurement fitting

Here we report the parameters we have used for the figures in the main text. However, before turning to each figure, we first detail the fitting procedure we employ to access the short-time values of the coherence function, C(t), when the measurement resolution is smaller than the minimum delay time of the π/2 pulses, i.e., δt < τ.

As discussed in the main text, since our sampling interval δt is smaller than the minimum delay time τ, we obtain effective coherence function measurements at early times [0, τ] by employing the small ωt limit of the free induction decay attenuation function, χFID(t). For early times (i.e., when ωt 1), one can expand χFID(t) as

$$\begin{array}{ll}{\chi }_{{{{\rm{FID}}}}}(t)\,=\,\frac{1}{\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,\frac{1}{{\omega }^{2}}S(\omega ){\sin }^{2}\left(\frac{\omega t}{2}\right)\\\qquad\qquad\approx\,\frac{1}{\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,\frac{1}{{\omega }^{2}}S(\omega )\left[\frac{{(\omega t)}^{2}}{{2}^{2}}-\frac{{(\omega t)}^{4}}{{2}^{4}\,\cdot\, 3}+\frac{2{(\omega t)}^{6}}{{2}^{6}\,\cdot\, 45}\right]\\\qquad\qquad\equiv \,{\kappa }^{(0)}{t}^{2}+{\kappa }^{(1)}{t}^{4}+{\kappa }^{(2)}{t}^{6},\end{array}$$
(19)

where

$${\kappa }^{(0)}=\frac{1}{{2}^{2}\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,S(\omega ),$$
(20)
$${\kappa }^{(1)}=\frac{1}{{2}^{4}\cdot 3\pi }\int\nolimits_{-\infty }^{\infty }d\omega\,{\omega}^{2}S(\omega ),$$
(21)
$${\kappa }^{(2)}=\frac{1}{{2}^{5}\cdot 45\pi }\int\nolimits_{-\infty }^{\infty }d\omega\,{\omega }^{4}S(\omega ),$$
(22)

correspond to the integral over the power spectrum and its first two moments. Since one does not have access to {κ(0), κ(1), κ(2)} a priori, we employ a polynomial fitting procedure subject to the functional form in Eq. (19) to obtain values for the attenuation function, χFID(t), over the interval [0, τ]. To ensure physically correct behavior for the interpolated χFID(t) in the short-time region, we employ two additional fitting constraints: C(t→0) = 1 and in the region at and beyond τ, the fitting procedure must align with the first few measured values. Thus, we perform the polynomial fitting in the interval [0, τ + ϵ] where ϵ contains the first few points accessible via direct measurement of the coherence curve. This ensures that the inferred values of these constants are correctly reconstructing the expected coherence curve well into the ϵ interval that one can directly measure. We expect that, depending on the structure of the noise and the resulting coherence function, one might need to keep more terms in the expansion above to be able to infer the points in the [0, τ + ϵ] interval in future applications.

We apply similar expansion to the spin echo sequence to reconstruct the early-time behavior of the corresponding attenuation function. In this case,

$$\begin{array}{ll}{\chi }_{{{{\rm{SE}}}}}(t)\,=\,\frac{4}{\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,\frac{1}{{\omega }^{2}}S(\omega ){\sin }^{4}\left(\frac{\omega t}{2}\right)\\\qquad\quad\approx\,\frac{4}{\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,\frac{1}{{\omega }^{2}}S(\omega )\left[\frac{{(\omega t)}^{4}}{{2}^{4}}-\frac{{(\omega t)}^{6}}{{2}^{6}\,\cdot\, \frac{3}{2}}+\frac{{(\omega t)}^{8}}{{2}^{8}\,\cdot\, 5}\right]\\\quad\qquad\equiv\,{\kappa }^{(0)}{t}^{4}+{\kappa }^{(1)}{t}^{6}+{\kappa }^{(2)}{t}^{8}.\end{array}$$
(23)

Here, one can find the parameters via the same fitting procedure as described above. This early-time reconstruction of the spin echo sequence both enables the implementation of the FTNS protocol and allows the spin echo DDNS to go beyond the spectral limit set by the minimum delay time. This can be seen in Figs. 5 and 6 where we remove the frequency limitation of the DDNS reconstruction set by the minimum delay time.

Furthermore, depending on the quality of the obtained fit, it may be necessary to modulate the transition between the fitted data and the measurement data if the resulting first and second numerical derivatives show large fluctuations at the boundary. This can be done by multiplying the measured data by a shifted Error function which has a transition length of about 5δt and a transition point at about \(5\delta t+{\tau }_{\min }\), and also multiplying the fitted data by the negative of the same Error function. These two sets of data can now be added to give a modulated time series data with a suppressed effect of any discontinuities arising in the transition from the fitted data to the measured data. We employed this procedure in the early-time reconstruction implemented in Fig. 2.

In all examples shown in this paper except for Fig. 1, we have restricted the total measurement time such that the coherence value does not become less than C(t) = 0.005. This ensures that the measured values remain within the reasonable experimentally accessible range.

Linear behavior of χ(t) at long times

Here, we demonstrate that \({\ddot{\chi }}_{{{{\rm{FID}}}}}(t)\to 0\) at tfor any spectrum whose integral over all frequencies remains finite. To do this, we recall the Riemann-Lebesgue lemma, which states that the Fourier transform of a function f(ω) vanishes as t, as long as

$$\int\nolimits_{-\infty }^{\infty }| f(\omega )| \,d\omega \,<\, \infty .$$
(24)

In FTNS, \({\ddot{\chi }}_{{{{\rm{FID}}}}}(t)\) is equal to the inverse Fourier transform of \(S(\omega )/\sqrt{2\pi }\). Thus, \({\ddot{\chi }}_{{{{\rm{FID}}}}}(t\to \infty )\to 0\) is simply a consequence of the Riemann-Lebesgue lemma so long as the noise spectrum S(ω) is of a functional form whose area under the curve is finite, which is a condition many physical noise spectra are expected to obey. This result guarantees that under such conditions, χFID(t) can only grow at most linearly in t at t. This ensures that fitting χFID(t) to a linear function at long t is a valid method for mitigating the effects of measurement error for many physical systems.

For concreteness, we now explicitly show that χFID(t) behaves linearly at t for the Lorentzian and the Gaussian spectra, which are two commonly encountered spectral shapes. To do this, we consider a generic form for S(ω) and obtain an expression for χFID(t). The t behavior of this χFID(t) reveals the expected linear behavior. We reiterate that these are specific examples of a general result that holds for any realistic noise spectrum whose integral over all frequencies remains finite.

We first consider a Lorentzian spectrum:

$$S(\omega )=A\left(\frac{1}{1+{\left(\frac{\omega -d}{{\omega }_{{{{\rm{c}}}}}}\right)}^{2}}+\frac{1}{1+{\left(\frac{\omega +d}{{\omega }_{{{{\rm{c}}}}}}\right)}^{2}}\right).$$
(25)

This form ensures that it is symmetric. Taking the inverse Fourier transform of \(S(\omega )/\sqrt{2\pi }\), we obtain,

$${\ddot{\chi }}_{{{{\rm{FID}}}}}(t)=A{\omega }_{{{{\rm{c}}}}}{{{{\rm{e}}}}}^{-t{\omega }_{{{{\rm{c}}}}}}\cos (dt).$$
(26)

Clearly, this is a function that decays exponentially to zero at long times. From this we can obtain \({\dot{\chi }}_{{{{\rm{FID}}}}}(t)\) and χFID(t):

$${\dot{\chi }}_{{{{\rm{FID}}}}}(t)=\frac{A{\omega }_{{{{\rm{c}}}}}{{{{\rm{e}}}}}^{-t{\omega }_{{{{\rm{c}}}}}}(d\sin (dt)-{\omega }_{{{{\rm{c}}}}}\cos (dt))}{{d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}}+{C}_{1},$$
(27)
$${\chi }_{{{{\rm{FID}}}}}(t)=\frac{A{\omega }_{{{{\rm{c}}}}}{{{{\rm{e}}}}}^{-t{\omega }_{{{{\rm{c}}}}}}\left(\left({\omega }_{{{{\rm{c}}}}}^{2}-{d}^{2}\right)\cos (dt)-2d{\omega }_{{{{\rm{c}}}}}\sin (dt)\right)}{{\left({d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}\right)}^{2}}+{C}_{1}t+{C}_{2},$$
(28)

where C1 and C2 are integration constants, which we can find by enforcing the appropriate boundary conditions. The coherence should start at 1 at t = 0, so we expect χFID(t = 0) = 0. We can also examine the boundary condition for \({\dot{\chi }}_{{{{\rm{FID}}}}}(t)\):

$$\begin{array}{l}{\dot{\chi }}_{{{{\rm{FID}}}}}(t)\,=\,\frac{1}{\pi }\int\nolimits_{-\infty }^{\infty }d\omega \,\frac{S(\omega )}{\omega }\sin \left(\frac{\omega t}{2}\right)\cos \left(\frac{\omega t}{2}\right),\end{array}$$
(29)

which implies that \(\dot{\chi }(t=0)=0\). We impose these by evaluating \(\dot{\chi }(0)\) and χ(0):

$${\dot{\chi }}_{{{{\rm{FID}}}}}(0)=-\frac{A{\omega }_{{{{\rm{c}}}}}^{2}}{{d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}}+{C}_{1}=0,$$
(30)
$${\chi }_{{{{\rm{FID}}}}}(0)=\frac{A{\omega }_{{{{\rm{c}}}}}\left({\omega }_{{{{\rm{c}}}}}^{2}-{d}^{2}\right)}{{\left({d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}\right)}^{2}}+{C}_{2}=0.$$
(31)

Hence,

$${\chi }_{{{{\rm{FID}}}}}(t)=\frac{A{\omega }_{{{{\rm{c}}}}}{{{{\rm{e}}}}}^{-t{\omega }_{{{{\rm{c}}}}}}\left(\left({\omega }_{{{{\rm{c}}}}}^{2}-{d}^{2}\right)\cos \left(dt\right)-2d{\omega }_{{{{\rm{c}}}}}\sin (dt)\right)}{{\left({d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}\right)}^{2}}+\frac{A{\omega }_{{{{\rm{c}}}}}^{2}}{{d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}}t-\frac{A{\omega }_{{{{\rm{c}}}}}\left({\omega }_{{{{\rm{c}}}}}^{2}-{d}^{2}\right)}{{\left({d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}\right)}^{2}}.$$
(32)

Thus, the long-time limit of the attenuation function is a linear function in t,

$$\mathop{\lim }\limits_{t\to \infty }{\chi }_{{{{\rm{FID}}}}}(t)=\frac{A{\omega }_{{{{\rm{c}}}}}^{2}}{{d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}}t-\frac{A{\omega }_{{{{\rm{c}}}}}\left({\omega }_{{{{\rm{c}}}}}^{2}-{d}^{2}\right)}{{\left({d}^{2}+{\omega }_{{{{\rm{c}}}}}^{2}\right)}^{2}}.$$
(33)

One can perform a similar analysis for a Gaussian spectrum,

$$S(\omega )=A\exp \left\{-{\left(\frac{\omega -d}{\sigma }\right)}^{2}\right\}+A\exp \left\{-{\left(\frac{\omega +d}{\sigma }\right)}^{2}\right\}.$$
(34)

We can again take the inverse Fourier transform of \(S(\omega )/\sqrt{2\pi }\) to obtain,

$${\ddot{\chi }}_{{{{\rm{FID}}}}}(t)=\frac{A}{2\sqrt{\pi }}| \sigma | \exp \left\{-\frac{1}{4}t(4{{{\rm{i}}}}d+t{\sigma }^{2})\right\}\left(1+{{{{\rm{e}}}}}^{2{{{\rm{i}}}}dt}\right),$$
(35)

which goes to zero at long times. We then integrate Eq. (35) to obtain expressions for \(\dot{\chi }(t)\) and χ(t) subject to their constraints at t→0, i.e., χ(0) = 0 and \(\dot{\chi }(0)=0\):

$${\dot{\chi }}_{{{{\rm{FID}}}}}(t)=A{{{{\rm{e}}}}}^{-\frac{{d}^{2}}{{\sigma }^{2}}}{\rm{Re}} \left(\,{{\mbox{Erf}}}\,\left(\frac{{{{\rm{i}}}}d}{\sigma }+\frac{\sigma t}{2}\right)\right),$$
(36)
$$\begin{array}{ll}{\chi }_{{{{\rm{FID}}}}}(t)\,=\,-\frac{2A\left(\sigma +{{{\rm{i}}}}{{{{\rm{e}}}}}^{-\frac{{d}^{2}}{{\sigma }^{2}}}\sqrt{\pi }d\,\,{{\mbox{Erf}}}\,\left(\frac{{{{\rm{i}}}}d}{\sigma }\right)\right)}{\sqrt{\pi }{\sigma }^{2}}\\\qquad\qquad\quad+\,{\rm{Re}} \left(\frac{A{{{{\rm{e}}}}}^{-\frac{{d}^{2}}{{\sigma }^{2}}}\left(2\sigma {{{{\rm{e}}}}}^{{\left(\frac{d}{\sigma }\,+\,\frac{{{{\rm{i}}}}\sigma t}{2}\right)}^{2}}\,+\,{{{\rm{i}}}}\sqrt{\pi }\left(2d\,+\,{{{\rm{i}}}}{\sigma }^{2}t\right)\,\,{{\mbox{Erf}}}\,\left(\frac{{{{\rm{i}}}}d}{\sigma }-\frac{\sigma t}{2}\right)\right)}{\sqrt{\pi }{\sigma }^{2}}\right),\end{array}$$
(37)

where (  ) denotes the real part, and Erf(  ) is the error function. Noting that \(\mathop{\lim }\nolimits_{t\to \infty }{{{\rm{Erf}}}}(t)\to 1\), it is clear that the long-time limit of the attenuation function becomes,

$$\mathop{\lim }\limits_{t\to \infty }{\chi }_{{{{\rm{FID}}}}}(t)=\frac{A}{{\sigma }^{2}}\left({{{{\rm{e}}}}}^{-\frac{{d}^{2}}{{\sigma }^{2}}}\left(-2{{{\rm{i}}}}d\,\,{{\mbox{Erf}}}\,\left(\frac{{{{\rm{i}}}}d}{\sigma }\right)+{\sigma }^{2}t\right)-\frac{2\sigma }{\sqrt{\pi }}\right).$$
(38)

Hence, the long-time behavior of χFID(t) for a Gaussian-shaped power spectrum is also linear in t, as expected from the Riemann-Lebesgue lemma.

Error mitigation protocol

Here we outline the details of our approach to mitigate measurement errors. In particular, we detail the protocol we developed and employed to generate Fig. 4 from noisy coherence measurements. As a demonstration, we have used Mathematica, but our protocol is general and can be implemented within other computational software. We emphasize that this is one example of a denoising protocol; other procedures may be more appropriate for different data and physical problems.

In Fig. 4, we model the noise in the coherence function as arising from a normal distribution with mean 0 and standard deviation 0.001 at each measurement point. The noise has been adjusted such that for early times, the acquired value for C(t) does not exceed unity, and at later times it does not fall below zero.

We now summarize our denoising protocol:

  1. 1.

    Mirror the coherence data around t = 0 to get an effective coherence profile from \(-{T}_{\max }\) to \({T}_{\max }\). This allows the numerical time derivative to obtain a better value of χ(t) at t = 0, which helps to improve the performance of the Fourier transform near ω = 0.

  2. 2.

    Process the noisy coherence data through a low-pass filter, with the cut-off frequency set to half of the sampling rate. All instances of the low-pass filter are implemented using the Mathematica built-in LowpassFilter.

  3. 3.

    Take the logarithm of the smoothed coherence to get effective χ(t) values.

  4. 4.

    Plot the resulting data to visually discern whether the late-time behavior appears linear and within what range a linear fit appears suitable. In this case, we determined that linear fits from t/Tmax = 0.577 to t/Tmax = 0.990 for Fig. 4a and the 0.5% and 0.1% effective error panels for the Gaussian spectrum in Fig. 7, and from t/Tmax = 0.539 to t/Tmax = 0.987 for Fig. 4b and the 0.5% and 0.1% effective error panels for the Lorentzian spectrum in Fig. 7, were appropriate. The justification for this linear fitting at long times is given in Sec. II of this SM. For the linear fitting in the 1.0% effective error panels, we used \(t/{T}_{\max }\) ranges [0.577, 0.825] for the Gaussian spectrum and [0.359, 0.718] for the Lorentzian spectrum.

  5. 5.

    Perform a linear fit on the ranges selected. We employed the Fit function in Mathematica.

  6. 6.

    Replace the data within the selected range with the linear fit. This leads to a modified χ(t), which we denote by \(\tilde{\chi }(t)\).

  7. 7.

    Optional: After applying a linear fit, one can extend the \(\tilde{\chi }(t)\) data to arbitrarily long times, which results in a longer effective measurement time, which in turn provides improved resolution in frequency space of the FTNS approach. This step was not implemented in the generation of Fig. 4 in the main text and its implementation would only increase the frequency resolution of the spectrum.

  8. 8.

    Perform a numerical time derivative of \(\tilde{\chi }(t)\). To obtain the numerical time derivatives, we implemented first order forward and backward difference approximation on the first and last data points, and a second order centered-difference approximation on the rest of the points. This is the algorithm behind various differentiation packages, such as numpy.gradient, which we used for the simulations in Figs. 1, 2, and 3 in the main text.

  9. 9.

    If the linear fitting causes a discontinuity, we remove its effect on the derivative by setting the value of the first derivative at the discontinuity to the derivative of the linear fit.

  10. 10.

    Apply another low-pass filter at a cut-off frequency at 1/4 of the sampling rate. Note that this step was implemented for all Gaussian spectra in Figs. 4 and 7, but not for the Lorentzian spectra in Figs. 4 and 7.

  11. 11.

    We take a second numerical time derivative of the data.

  12. 12.

    We apply a Fourier transform on the data as discussed in the main text: one can, for example, use any FFT implementation available in numerical packages (e.g., numpy) or implement the Fourier transform manually by performing an integral of the quantity \(\ddot{\tilde{\chi }}(t){{{{\rm{e}}}}}^{{{{\rm{i}}}}\omega t}/\sqrt{2\pi }\) over time, where the integration is approximated by the trapezoidal rule without changing the result.

  13. 13.

    For the Fourier transform, we employed a frequency range from ± half of the sampling rate of the coherence, with \(\delta t/{T}_{\max }=0.002\) for Fig. 4a, b. Finally, this is divided by \(\sqrt{2\pi }\) to obtain the denoised spectra seen in Fig. 4.

We can study the performance of FTNS using this particular denoising protocol at various effective measurement error percentages. Figure 7 gives examples of this for the two spectra used Fig. 4 in the main text at effective noise values of 1.0%, 0.5%, and 0.1%. As expected, lower noise values give better agreement with the true spectrum. Yet, the agreement between FTNS and the true spectrum demonstrates that FTNS can robustly capture the major peaks in the spectrum in all cases. Strikingly, the artifacts of the Fourier transform of noisy data, which are most prominent in the examples with 1.0% noise levels, systematically decrease with increased sampling. Thus, to robustly identify features of the true spectrum in an experimental implementation of FTNS, it would be helpful to compare averages of smaller batches of measurements for common peaked features that appear consistently. Such comparisons can also be used to check the convergence of the reconstructed spectrum as a function of the extent of averaging done during the measurement process.

Fig. 7: Noise spectrum reconstructions using the FTNS method under different values of effective simulated measurement error.
figure 7

FTNS in the presence of various effective measurement errors, for the two examples demonstrated in Fig. 4. Specifically, the noise levels for the panels are 1.0% for (a, b), 0.5% for (c, d), and 0.1% for (e, f). While performance improves for lower effective noise, the peaked spectral features remain more or less robust under all three cases.

Noise spectroscopy protocol for 1/f-type spectra

Here, we show the long-time behavior of χSE(t) under both 1/f and integrable spectra and use these results to formulate a noise spectroscopy protocol for spectra consisting of both 1/f and finite peaked features.

First we show the long-time behavior of χSE(t) under 1/f noise. From Eq. (11),

$${{{\mathcal{F}}}}[{\ddot{\chi }}_{{{{\rm{SE}}}}}(t)]=\sqrt{\frac{2}{\pi }}M(2\omega )=\sqrt{\frac{2}{\pi }}\left(S(2\omega )-S(\omega )/2\right),$$

we can derive the analytic form of χSE(t) expected for 1/f-type spectra in the long-time limit, in a similar manner to what was shown in “Methods” section C.

For

$${S}_{{{{\rm{1/f}}}}}(\omega )={{{\mathcal{A}}}}/{\omega }^{n}$$
(39)

with the constraint that 0 < n < 3, we obtain for χ(t) using spin echo FTNS

$${\chi }_{{{{\rm{SE,1/f}}}}}(t)={{{{\mathcal{Y}}}}}_{n}{t}^{n+1},$$
(40)

where \({{{{\mathcal{Y}}}}}_{n}\) is given in Eq. (16). Note the characteristic tn+1 dependence which, under our assumption that n > 0, grows faster than linear in t.

These results allow us to perform noise spectroscopy on spectra consisting of a linear combination of such functions, and therefore on generic  1/ωn type spectra.

We now study the long-time behavior of χSE(t) under integrable noise spectra. For generic noise spectra which satisfy

$$\int\nolimits_{-\infty }^{\infty }| M(2\omega )| d\omega \,<\, \infty ,$$
(41)

the result

$${\ddot{\chi }}_{{{{\rm{SE}}}}}(t\to \infty )\to 0$$
(42)

holds as a consequence of the Riemann-Lebesgue lemma (see “Methods” section C). This means that χSE(t) t should hold as long as Eq. (41) is satisfied. Note that this condition is explicitly violated for a 1/f-type noise and so 1/f noise does not exhibit linear t dependence at t.

The above results indicate that if we assume the total noise spectrum to be a linear combination of instances of spectra satisfying either category, we may be able to isolate the 1/f contribution through a fit of the measured χ(t) to a function of the form

$${\chi }_{{{{\rm{fit}}}}}(t)=\alpha | t{| }^{\gamma }+\beta t+\delta .$$
(43)

Eq. (40) shows that the parameters α and γ fully characterize the 1/f component. Knowing these parameters, one can subtract off the contribution due to the 1/f component to obtain any residual structure in the noise spectrum. That is, if

$$\chi (t)={\chi }_{{{{\rm{1/f}}}}}(t)+{\chi }_{{{{\rm{residual}}}}}(t),$$
(44)

one can fit χ(t) to Eq. (43) to obtain values for α and γ, which can then be used to find the parameters characterizing the 1/f noise, \({{{\mathcal{A}}}}\) and n, like

$$n=\gamma -1,$$
(45)
$${{{\mathcal{A}}}}=-\frac{{2}^{\gamma }\pi \alpha \csc \left(\frac{1}{2}\pi (\gamma -1)\right)}{\left({2}^{\gamma }-4\right)\Gamma (-\gamma )},$$
(46)

from Eqs. (39) and (40). One can then use these parameters to reconstruct χ1/f at the time points corresponding to those obtained in the measurement χ(t). A pointwise difference between the measured χ(t) data and the reconstructed χ1/f(t) data yields an effective χresidual(t). After removing the 1/f component, the residual response should only have a linear dependence in time at long times. At this point, one can apply the iterative spin echo FTNS procedure outlined in the “Spin Echo FTNS” section in the main text to reveal any additional structure in the noise spectrum.

For the specific examples shown in Fig. 6, we employed the following procedure:

  1. 1.

    Extract χ(t) from the measured C(t) using Eq. (1). In our numerical example in Fig. 6, we used S(ω) given by

    $$S(\omega )=\frac{{{{\mathcal{A}}}}}{{\omega }^{n}}+\frac{B}{1+{\left(\frac{\omega -d}{{\omega }_{{{{\rm{c}}}}}}\right)}^{2}}+\frac{B}{1+{\left(\frac{\omega +d}{{\omega }_{{{{\rm{c}}}}}}\right)}^{2}},$$
    (47)

    with example parameter values \({{{\mathcal{A}}}}=1,\,\,B=1,\,\,n=2.5,\,\,{\omega }_{{{{\rm{c}}}}}=1.5,\,\,d=12.5\), and the spin echo filter function. In our demonstration, the experimentally motivated constraint that only measurements up to a final time such that all C(t) < 0.005 should be taken was implemented.

  2. 2.

    We then fit this measured χ(t) data to a function of the form given by Eq. (43). In our demonstration, we employed the FindFit function in Mathematica to obtain parameter values

    $$\begin{array}{rcl}&&\alpha =0.0385433,\,\,\beta =0.0223275,\\ &&\delta =0.0167974,\,\,\gamma =3.51096.\end{array}$$
  3. 3.

    We use the α and γ values obtained from the fit to construct the 1/f part of the spectrum via Eqs. (45) and (46). For our demonstration, we obtain

    $${S}_{1/f}(\omega )=0.974526/{\omega }^{2.51095}.$$
    (48)

    Note that the effective \({{{\mathcal{A}}}}\) and n values obtained from the fit are in reasonable agreement with their exact values, \({{{\mathcal{A}}}}=1\) and n = 2.5.

  4. 4.

    From the effective \({{{\mathcal{A}}}}\) and n values obtained from the previous step, we generate a time series data of χ1/f(t) at time points corresponding to the measurement times of the original data, via Eq. (40). We then subtract these values, pointwise, from the original measurement data χ(t) to obtain χresidual(t). χresidual(t) corresponds to the component of the attenuation function that is due to all except the 1/f component of the noise spectrum.

  5. 5.

    We then perform the spin echo FTNS protocol, as outlined in the main text, on χresidual(t). This provides an additional contribution to the total noise spectrum, Sresidual(ω).

  6. 6.

    Finally, we add the resulting S1/f(ω) and Sresidual(ω) to obtain the total reconstructed spectrum. We show in Fig. 6 of the main text that this noise spectroscopy protocol can sufficiently characterize the nature of the 1/f approach of the spectrum at ω→0, as well as identify the presence of any additional high-frequency peaks which may be present in the noise spectrum.