Noise and bias in optical coherence tomography intensity signal decorrelation

These authors contributed equally to this work and are listed in alphabetical order Abstract Functional optical coherence tomography (OCT) imaging based on the decorrelation of the intensity signal has been used extensively in angiography and is finding use in flowmetry and therapy monitoring. In this work, we present a rigorous analysis of the autocorrelation function, introduce the concepts of contrast bias, statistical bias and variability, and identify the optimal definition of the second-order autocorrelation function (ACF) g (2) to improve its estimation from limited data. We benchmark different averaging strategies in reducing statistical bias and variability. We also developed an analytical correction for the noise contributions to the decorrelation of the ACF in OCT that extends the signal-to-noise ratio range in which ACF analysis can be used. We demonstrate the use of all the tools developed in the experimental determination of the lateral speckle size depth dependence in a rotational endoscopic probe with low NA, and we show the ability to more accurately determine the rotational speed of an endoscopic probe to implement NURD detection. We finally present g (2) -based angiography of the finger nailbed, demonstrating the improved results from noise correction and the optimal bias mitigation strategies.


Introduction
The coherent nature of optical coherence tomography (OCT) [1,2] imparts specific statistical properties to the speckle signal obtained in OCT tomograms [3]. The temporal statistics of the OCT signal, which evolves in time following a random process, is dictated by the dynamics of scatterers inside the resolution volume [4]. The analysis of these temporal statistics is generally carried out using autocorrelation analysis, although many techniques define their own correlation metrics. The measured decorrelation can be related to either changes in the microscopic configuration of the scatterers (such as in diffusion) or to the relative motion between an ensemble of scatterers and the OCT system (such as in translational motion). For a system with stationary optics, the most direct application of speckle decorrelation contrast is highlighting blood flow in angiographic techniques [5][6][7][8][9] and quantitative blood flow -flowmetry- [10][11][12][13][14][15]. Decorrelation arising from dynamic microscopic configurations of scatterers, such as during protein denaturation due to thermal damage, has been used to monitor thermal therapy [16][17][18]. For a system with moving optics, such as an endoscopic catheter, the decorrelation can be used to determine the motion of the catheter with respect to the tissue. In a rotating catheter with a flexible driveshaft and a distal rotation mechanism, dynamic changes in friction cause non-uniform rotation of the scanning optics. In this case decorrelation can be used to determine the rotation speed of the catheter and correct for non-uniform rotation distortion (NURD) to provide an accurate representation of the imaged tissue [19,20].
In autocorrelation analysis, the OCT intensity or complex-amplitude signal autocorrelation function (ACF) is estimated at different time points to determine the local dynamics of scatterers [see Figs. 1(a)-(c)]. Implicit to the definition of the ACF is the concept of ensemble averaging: the magnitude of the correlation can only be estimated when there exists an ensemble of observations. With finite sampling there is no direct access to the actual ACF, but a mere estimation. Although the first-order ACF g (1) (that is, of the complex-valued electric field) is universally defined, there exist multiple definitions of the second-order ACF g (2) (that is, of the intensity). Several definitions have been used in OCT [12,14] and in dynamic light scattering (DLS) literature [21]. Bias is a known problem in the estimation of any statistical parameter, and the second-order ACF is known to be biased [22,23]. In Figs. 1(d)-(e) we show how statistical bias modifies the shape of the ACF, with shorter time series exhibiting stronger bias. Bias has been studied in the context of time series used in stellar interferometers and DLS experiments, but both are very different with respect to experiments in OCT in terms of number of samples, total sampling times and evaluated time lags; we thus expect bias to arise in regimes not yet identified in OCT applications. These experimental differences arise because, in general, the OCT signal is acquired at different lateral locations, each for a short period of time before scanning continues to enable the creation of cross-section functional images. Thus, time series usually contain just a few samples in angiography and ≲ 100 in flowmetry. However, to our knowledge, no systematic study has been carried out on the optimal approach for calculating the autocorrelation function in OCT: its optimal definition, its bias and approaches to reduce it.
Apart from bias, noise is known to affect the temporal statistics of the OCT speckle signal [see Figs. 1(a)-(c)]. Makita et al. [24] developed a noise-corrected version of the complexamplitude cross-correlation coefficient based on an additive noise model for the complex OCT signal. This model is straightforward to apply to the first-order ACF, however no analytical expression is known for any of the definitions of the second-order ACF. Uribe-Patarroyo et al. [14] developed an empirical, numerical correction scheme for g (2) . However, apart from requiring a cumbersome calibration procedure, its main drawback is the halving of the temporal resolution by dropping the first point in the autocorrelation function: this effectively halves the maximum decorrelation rate measurable with a given system. The new approach we present here does not suffer from any of these drawbacks.
In this work, we aim to study bias and the effect of noise in the second-order autocorrelation function, and to present strategies for correcting noise analytically and to prevent bias in the context of OCT. First, we introduce the model and identify the multiplicative nature of noise in the intensity signal. We then show an extension of the additive complex-amplitude noise model to calculate analytically the noise-corrected second-order ACF g (2) using three different commonly used definitions. We also introduce the concept of contrast bias and show the dependence of each definition on the contrast of a finite-sampled OCT speckle signal. Experimentally, we first validated the additive zero-mean complex circular Gaussian distribution model proposed by Makita et al. [24]. We then carried out a systematic study on the performance of the different definitions of g (2) and their statistical and contrast biases, and determined the best averaging strategy to reduce bias in g (2) . Critically, we found that the ensemble size and averaging used can strongly determine the decay of the correlation and thus account for differences between experimental g (2) values and models. Finally, we show the impact of these optimal strategies in two exemplary applications: NURD detection in a rotational endoscopic system and angiographic contrast in a benchtop system. In the former, we used our results to determine the depth-resolved speckle size in a rotational-scan endoscopic probe, for which, to our knowledge, no model currently exists. As opposed to previous assumptions based on the behavior of benchtop raster-scan OCT systems [14,25], we show that the speckle size in a rotational configuration with low numerical aperture (NA) is roughly constant in depth in angular units, or linearly increasing in linear units. We make use of this result to show strategies to improve the robustness of NURD detection in endoscopic systems based on an ACF approach. In the second exemplary application, we show the improvement in image quality from the bias mitigation and noise correction in a g (2) -based angiography metric in the finger nail vasculature of a healthy volunteer. For further information on the implementation of NURD correction -rather than just detection -and on the interpretation of angiographic contrast, we refer the reader to relevant publications in each corresponding section of this work. Together, these results will be valuable for the optimized implementation of many types of functional imaging which make use of the intensity fluctuations of the OCT signal, such as angiography, flowmetry and velocimetry.

Mathematical model
We first describe some generalities of the models that will be used in this work and then we present the noise-corrected versions of g (1) and the different definitions of g (2) in the following subsections. The detailed derivations for each case are presented in Appendix A.
In what follows, we defined a coordinate system (z, x, y), where z represents depth along an A-line, x denotes the in-plane lateral coordinate (within a B-scan) and y denotes the out-ofplane lateral coordinate; s represents any one or more of the spatial coordinates; t represents time and τ a time lag.
2.1. Noise model 2.1.1. Noise in the complex OCT signal-We define the noisy complex-valued OCT signal F as the addition of the noiseless signal S and the noise N, which follows a zero-mean complex circular Gaussian distribution [24] F = S + N . (1) Note that S is also given by a zero-mean complex circular Gaussian distribution due to the speckle nature of the OCT signal [4,26], but in general has different distribution parameters from that of N and different temporal dynamics. By definition, two random variables X and Y are uncorrelated if and only if 〈XY〉 = 〈X〉〈Y〉, where 〈⋯〉 denotes an ensemble average.
In terms of Eq. (1), we assume that noise and signal are uncorrelated and therefore 〈SN〉 = 〈S〉〈N〉 . (2) Note that uncorrelation does not imply a zero-valued expected value of the cross-product above -the covariance is zero, but it is defined differently: 〈(S − 〈S〉)(N − 〈N〉)〉. A discussion on temporal (〈⋯〉 t ) and spatial (〈⋯〉 s ) ensemble averaging is in order. Autocorrelation functions are defined in terms of ensembles of realizations of the signal. In practice, this corresponds to spatial averaging, where the signal from different scatterers undergoing the same dynamics are grouped into an ensemble. In an ergodic system, scatterers are not restricted in their configuration, and given enough time, a single group of scatterers will traverse the whole phase space and spatial averaging can be replaced by temporal averaging. In our model, we assume that the OCT signal represents that of an ergodic system. We also assume that N corresponds to white noise: it has a flat power spectrum, and therefore N is completely decorrelated across time and space. From the flat power spectrum of N and its zero-mean complex circular Gaussian distribution, it follows that 〈N〉 s = 〈N〉 t = 0 for sufficiently large ensemble sizes. We assume, to an excellent approximation, that all ensemble sizes used in practice are large enough to satisfy these equalities.
In terms of the signal S, 〈S〉 s = 〈S〉 t = 0 by definition for sufficiently large ensembles as well.
In this case the power spectrum is not flat, and thus the critical figure is not the number of samples within an ensemble, but the number of independent speckle. The speckle size is defined: in the axial dimension, by the zero-padding on the OCT fringe data; in the lateral coordinates, by the lateral sampling and its relation to the diffraction-limited resolution; and in the time dimension, by the dynamics of the signal. For these reasons, ensembles sizes for which 〈N〉 s = 〈N〉 t = 0 holds do not guarantee the same for S. This is clear in applications such as angiography: static structures, such as non-perfused tissue, presents a nearly constant value of S and thus 〈S〉 t ≠ 0. Similarly, in flowmetry areas with slow flow will evolve only partially over the temporal extent of the ensemble and in general 〈S〉 t ≠ 0. For these reasons, we do not make any assumptions on the statistics of the signal, in particular about the value of 〈S〉 s or 〈S〉 t in our model. Our model is thus general and it is not limited to specific applications. This aspect of the model also highlights an alternative point of view for the interpretation of autocorrelation analysis in OCT: in essence, the goal is to determine the speckle size in the time dimension at different locations in the sample, either considering complex-valued speckle with g (1) or its squared magnitude with g (2) . (2) , we now define the following intensities

Noise in the intensity OCT signal-Moving to g
importantly, the noisy tomogram intensity is given by I = T + Q + 2Re S * N = T + Q + 2 S N cosφ, (4) where φ is the relative phase between S and N. Given the zero-mean complex circular Gaussian statistics of N, Q -the additive component of the noise-is described by an exponential distribution with a given average value 〈Q〉, which is customarily defined as the "noise floor" in OCT. The signal-to-noise ratio (SNR) is traditionally calculated experimentally as R = 〈I〉 〈Q〉 , although we will use the more rigorous definition R = 〈T 〉 〈Q〉 throughout this work. Given the nature of N, it is clear that the last term in Eq. (4) -the multiplicative component of the noise-is a rapidly oscillating term driven by the relative phase between noise and signal. Therefore, a given noiseless signal with intensity T will be corrupted across different realizations of the noise by: the offset given by Q and a rapidly fluctuating multiplicative term of magnitude 4|S||N|. This implies that although the average contrast (ratio) of a signal with respect to the noise floor (noise in absence of signal) is indeed given by R, the noise of the signal itself (its fluctuations in time as a result of different realizations of the noise) is of magnitude 4|S||N|, which is a more important metric when analyzing the temporal fluctuations of I rather than the contrast of a static image. This noise scales with the square root of the signal, and we quantify it by means of the relative standard deviation (RSD) of the signal ρ = σ I /〈I〉 t , where σ I ≡ 〈I 2 〉 t − 〈I 2 〉 t is the standard deviation in a time series. We note that given that σ cosφ = 2/2 when φ is uniformly distributed, the model predicts Apart from the expectation that the RSD scales with the inverse square root of I, the fact that this component of the intensity noise is multiplicative makes it particularly deleterious to the calculation of the autocorrelation function of the signal and difficult to mitigate. We emphasize that we have not made any assumptions about the noise in the intensity signal, but rather propagated into the intensity the properties of the complex circular Gaussian noise N defined in the complex-amplitude signal.
With the definition of the noise model considered above, we now move onto the development of analytical corrections to the different ACFs definitions to account for noiseinduced decorrelation. We first consider that all ACFs compare the value of a function K at different time points K(t) and K(t + τ). We define the correlation window size n ω as the number of time points contained in the time series without regard to the extent of the spatial ensemble; that is, the number of available time differences τ to calculate an ACF. We now clarify an important concept for which there are common misconceptions: although generally uniform time sampling is used when calculating ACFs, nothing in the definition of the different ACFs imposes this restriction. Non-uniform sampling is compatible with autocorrelation analysis as long as care is taken to select the correct sample pairs that share the same time difference τ before ensemble averaging. In uniform sampling, the number of members for temporal ensemble averaging 〈〉 t for a given time difference τ is given by n t (n ω , τ) = n ω − τ, which implies a decreasing ensemble size (and thus a less accurate estimation) with increasing τ. Non-uniform time sampling will have a different function n t (n ω , τ), which could be tailored to improve the ensemble averaging at the range of τ of interest while enabling, for instance, the parallelization of the lateral sampling, which has been demonstrated in custom decorrelation metrics [27]. Here we highlight the fact that such nonuniform acquisition approaches can also work in the context of traditional ACFs.
In a stationary process, the temporal statistics of K are assumed to be constant, and therefore the autocorrelation does not depend on the specific time t but only on the time difference τ; in a dynamic process, the statistics evolve in time and the autocorrelation depends on both t and τ. In what follows, we define for simplicity all ACFs as those of a stationary process; extension to a dynamic process is straightforward. We also simplify the notation by using subscripts 1 and 2 to represent (t) and (t + τ), respectively. We also denote all ACFs of the noisy signal with a tilde accent ~.
In certain cases, the signal S may also include a static component S S in addition to the dynamic scattering component S D of interest, S = S S + S D . This is the case, for example, when imaging blood flow partially overlapping the vessel wall. As we do not make assumptions about S, all models and analysis still apply regardless of the constituents of S. If there is interest in separating different components from S, the reader is encouraged to read publications in which this is the subject matter [10,28].

First-order autocorrelation function
The first-order ACF of the noiseless and the noisy complex-amplitude signals are given by respectively. g (1) is defined classically in the range [0, 1], with 1 indicating perfectly correlated signals and 0 completely decorrelate signals. Following Makita et al. [24] and Appendix A, it is possible to write , is the SNR. As clarified above, we define the SNR as the ratio between the noiseless signal and the noise, which is related to the ratio between the noisy signal and the noise as R j = 〈 F j 2 〉 〈 N j 2 〉 = R j + 1.

Second-order autocorrelation functions
We will discuss three different definitions of g (2) . First, the definition mostly used in the DLS literature [21], g DLS (2) . Second, a definition with symmetric normalization used in photon correlation experiments, in particular in intensity interferometers such as the stellar interferometer devised by Hanbury Brown and Twiss [22,23,29,30], g HBT (2) ; and finally, the Pearson correlation coefficient g P (2) , which in rigorous terms is a normalized autocovariance, but has been used previously in the context of OCT [12,14,20].

Dynamic light scattering-
In this definition, the second-order ACF of the noiseless and the noisy intensity signals are respectively. Note that g DLS  only obtained for sufficiently large ensembles, and in practice it fluctuates -strongly for typical OCT ensemble sizes-following a log-normal distribution [31]. Therefore, comparing the autocorrelation of ensembles of different contrast will introduce a bias, which we call contrast bias, as opposed to the statistical bias discussed above. It is important to remark that this is not only contrast variability but a bias: due to the nature of the log-normal distribution, the average (and median) contrast for a given ensemble size is dependent on the ensemble size [31]. The smaller the ensemble size, the lower the contrast is, on average. In order to account for this bias and to be able to compare the autocorrelation function between ensembles with different speckle contrast, we propose two approaches. First, we define a contrast-normalized function where C∞ = 1 is the ideal contrast in large ensembles. This normalization considers that the signal is composed of pure speckle and that all fluctuations should be treated as such.
Although rigorous, this type of normalization have unintended effects: mostly static tissue will present very small fluctuations in its signal, which are amplified to match that from moving scatterers. For this reason we also define a global-normalized function (τ) = g DLS (2) (τ) g DLS (2) (τ = 0) C ∞ 2 + 1 , (10) which adjusts globally the range of the autocorrelation function to match that of a speckle signal of unity contrast. This normalization, defined empirically, does not amplify small fluctuations in mostly static tissue.
For τ = 0 we write Eq. (46) as which using the same approximation becomes
It is common in wavelength-swept OCT systems to have polarization-diverse detection and therefore two polarization channels with noisy intensities I p1 and I p2 . In most clinical systems, only access to the sum of the intensities I T = I p1 + I p2 is available to the user. It is still possible to find a relation between g HBT (2) and g HBT (2) defined on I T , but the expression is more involved. This special case is considered in Appendix B.

Pearson-The
Pearson correlation coefficient of the noiseless and the noisy intensity signals are given by respectively. From Eq. (54) in Appendix A, it is possible to relate g P (2) with g P (2) as The Pearson correlation coefficient is g P ( τ = 0) = 1 by definition, and therefore its maximum value is not affected by the contrast of the signal. Uncorrelated signals have a Pearson correlation of 0. However, we now show that a τ-dependent contrast bias deforms its shape. First, notice from the definition of C given before we have which for τ = 0 reduces to g P ( τ = 0) = 1. Therefore, the Pearson correlation coefficient is a modified HBT autocorrelation function with an strong contrast bias in the form of This contrast bias is not constant because the ensemble size on which C 1 and C 2 are calculated depend on τ, which due to the ensemble-size bias of the contrast discussed above, implies that C j = C j (τ). Despite this, an important property of g P (2) is that it is intrinsically normalized to lie between [0, 1] -reaching a value of −1 for anticorrelation which does not apply in this case-and thus does not require any of the aforementioned normalization approaches.

Averaging strategies and statistical bias
Statistical bias occurs when the average value of an estimator of a parameter differs from the true value. This is different from the variability of an estimator, which is a measure of the spread of the distribution of the estimator. In most cases, statistical bias is a consequence of finite sampling and, in general, it decreases asymptotically as the number of samples increases.
Estimation of the ACF in OCT present great variability due to the limited sampling because, as mentioned above, generally at most ~ 100 samples per ACF are used in living tissue (larger acquisitions are possible in phantoms, such the use of 1000-5000 time samples by Weiss et al. [32]), and as few as 2-5 for angiographic techniques. Almost all applications of decorrelation metrics in OCT make use of spatial averaging in order to reduce the statistical noise that is associated with such limited sampling, and averaging has been performed after individual ACFs have been calculated on the ACFs themselves [10,13,33] or on the decorrelation rate [11,14]. Here we will discuss three such strategies (illustrated in Fig. 2) and its implications with respect to statistical bias and noise correction. In the experimental results, a systematic study on each approach will be discussed.
In the following discussion, we assume the constrain of keeping the acquisition time constant, consequently, we consider different averaging strategies that do not increase the total acquisition time. We show in Fig. 2(a) an example of the calculation of the ACF for a time series at a spatial location x 1 and for a given τ such that there are three members in the temporal ensemble average; we then illustrate in Figs. 2(b)-(d) the operation of the averaging strategies using additional temporal or spatial information. The first approach, which we denote temporal-ensemble averaging (t-EA), is the straightforward increase of the number of time samples n ω -this comes at the expense of reducing the number of lateral locations to keep the total acquisition time constant. t-EA is depicted in Fig. 2(b) where a longer time series is required compared to Fig. 2(a). Increasing n ω to n ω + Δn ω , the number of members of the temporal ensemble increases linearly in τ, n t (n ω , τ) − n t (n ω + Δn ω , τ) = Δn ω τ, thus the relative improvement is significantly more pronounced when the time lag approaches n ω n t (n ω + Δn ω , τ) n t (n ω , τ) = Δn ω τ n t (n ω , τ) .
The second approach, which we call spatial-ensemble averaging (s-EA), consist of averaging spatial information by including in the ensemble average the samples within a local spatial window that is assumed to present similar dynamics. For instance, in Fig. 2(c) there are two time series for two spatial locations x 1 and x 2 with the same temporal extent of that in Fig.  2(a). In s-EA the window can be defined along any of the spatial dimensions w s (x, y, z) with size N z + 1, N x + 1 and N y + 1 in z, x and y, respectively, which we denote by N w s = {N z , N x , N y } for simplicity. Assuming w s (x, y, z) is defined in such way that the maximum value is equal to 1, the effective number of elements in the spatial window is defined as n s = ∑ x,y,z w x (x, y, z) -which accounts for non-binary windows-and in this case the relative improvement in the number of members of the ensemble is n t (n ω , τ, w s ) n t (n ω , τ) = n s , (24) and therefore is independent of τ.
In the final approach, which we call autocorrelation compounding (ACC) [illustrated in Fig.  2(d)], the ACFs after calculation are spatially averaged with a spatial window w s (x, y, z). ACC is used extensively in the literature [10,13,33]. Note that for a given τ, total number of elements in the calculation, combining temporal and spatial averaging, is n ts = n t (n ω , τ)n s . Our experimental results will show that there is a fundamental difference between s-EA and ACC in terms of tackling statistical bias. We note that in this case the noise correction can be performed on each individual ACF before or after compounding (averaging). There are advantages and disadvantages to each approach. Applying the noise correction before compounding permits the mixing of ACFs with dissimilar SNRs, but requires that each individual ACF has sufficiently large ensembles for an accurate estimation of the SNR (and associated R values). Applying the noise correction after compounding precludes mixing SNRs, but averaging the individually calculated R values should improve the SNR estimation and make the noise correction more robust. The specific numerical implementation of the averaging strategies described in this section are explained in Sec. 3.2.1 where they are put in the context of the scanning configurations used with our OCT system.

Speckle size in OCT
The axial speckle size in OCT tomograms is given by the degree of zero-padding and the shape of the windowing function prior to Fourier transformation of the fringes [3]. In some cases the axial speckle size can depend on other parameters, such as when strong sample dispersion or absorption is present [34], which we do not consider here. In a benchtop configuration -using galvanometer mirrors to perform raster scans-the lateral speckle size is determined by the diffraction-limited resolution of the imaging optics. When determining the size in terms of pixels, the lateral sampling has to be considered. When considering the raster scan is sampling the speckle signal of a rigid sample moving at the constant speed of the galvo scan, this dependence has been shown to be the case even when the sample is out of focus [15,25,35] and in a single or multiple scattering regime [36], and are the same in the in-plane and out-of-plane axes. This fact will be used in the experiments below, by means of a raster-scan benchtop configuration scanning a solid scattering sample at a fixed scanning speed, which should yield the same speckle size regardless of location.
To the best of our knowledge, there are no published models for the case of an endoscopic system with rotational scanning. Focusing on the in-plane coordinate only, this configuration cannot be approximated by the raster scan configuration: even considering a small sample volume and slow rotation of the probe, the illumination and detection modes defined by the catheter optics not only move laterally during the scan, but the angle of incidence onto the sample volume changes due to the rotation. The magnitude of the change in angle is different throughout the depth, as scatterers close to the rotation axis are illuminated by a wider range of angles while scatterers away from the rotation axis are asymptotically illuminated by a single angle. However, we can make use of the numerical results by Marks et al. [37] on the topic of digital refocusing in rotationally scanned OCT probes. They studied the recoverable lateral resolution in a rotational endoscopic probe in several configurations, see Fig. 4 in Ref. [37]. Given their model and processing methods enable the recovery of the diffraction-limited resolution throughout the sample, we can consider Fig. 4 as depicting the diffraction-limited resolution as a function of depth. Subplots (d) depict the lowest NA probes considered by the authors, which in terms of a system with a 1.3 μm central wavelength would have a 8 μm beam waist and a maximum working distance of 42 μm from the rotation axis. The diffraction-limited resolution is mostly linear with depth (numerically evaluated up to a depth of 52 μm). From the behavior of the other configurations, it is possible to predict that the diffraction-limited resolution in linear units μm should increase roughly linearly with depth, although some curves tend to show a slight decrease in curvature at depths away from the focal plane. In terms of angular units, this corresponds to a mostly constant speckle size, which has been observed in the past [38]. The out-of-plane axis, when implemented as a pullback, should behave in the same way as the raster scan described before. Knowledge of the expected speckle size as a function of depth in endoscopic systems is critical for the implementation of NURD detection and correction techniques based on speckle decorrelation for applications in which the tissue cannot be kept in place at a predictable depth -the case of previous works [20] where a balloon catheter plays this role-such as in intravascular and pulmonary imaging.

OCT systems
We used two OCT systems. For the benchtop experiments, we used a frequency-domain OCT system with a VCSEL wavelength-swept laser at a repetition rate of 100 kHz, with 10-dB bandwidth of 100 nm centered at 1310 nm. Data was acquired using a k-clock signal For the endoscopic experiments, we used a frequency-domain OCT system with a polygonbased wavelength-swept laser and a frequency shifter as described by Yun et al. [39]. The laser had a repetition rate of 102 KHz, a 134 nm sweep range, centered at 1285 nm. The signal was digitized at 180 MS/s with a Signatec PX14400A (DynamicSignals LLC, Lockport, IL USA) digitizer, recording 1600 samples per sweep. The acquired fringes were zero-padded and Fourier transformed to reconstruct tomograms with a final A-line size of 1024 samples in the axial direction and an axial pixel size of 5.9 μm in air. The system had a polarization-diverse receiver and the signal from each channel was processed independently.
The system used a custom rotary junction and endoscopic probes, which provided a e −1 beam diameter of the lateral point spread function (PSF) of approximately 30-36 μm in water (22-26 μm after the confocal effect). Considering that the system acquired each A-line for a given azimuthal angle, the raw B-scan data was in polar coordinates; this implies that the decay of the ACF represents the size of the speckle in angular units.
For both systems, the noise floor Q was determined by blocking the sample arm light in front of the collimator of the sample arm and acquiring a B-scan (512 A-lines for the VCSEL system, 2048 A-lines for the endoscopic system). Such a B-scan would ideally have zero intensity; instead, its non-zero intensity reflects the cumulative noise contributions from digitizer, detector, reference arm shot and excess photon noise due to imperfect balancing.
We averaged the intensity of all A-lines in this B-scan to obtain a depth-dependent noise floor Q(z). We ignored contributions to the noise floor due to sample arm power.

ACF computation and averaging-
For the computation of ensemble averages, denoted as 〈⋯〉, we define two scanning configurations for an OCT system: temporal or spatial scanning modes. In temporal mode, the system acquires M-mode data containing N t A-lines at the same location of the sample, at different lateral locations and with N f repetition frames, also known as hybrid M-mode-B-scan. This is the most general mode, in which lateral scanning is decoupled from time sampling. Before calculating the ACF, it is also possible to split each M-mode (with a sampling interval of length N t ) into n Ω = {0, 1, …, n Ω − 1} smaller correlation windows -which we call realizationsof size n ω = N t /N Ω , in order to calculate an ACF in each and perform a temporal ACC, similar to the Bartlett's methods in time series analysis [40]. We also consider the possibility of acquiring multiple M-mode-Bscans at the same location, which we identify by the frame index. Therefore, in this mode the OCT intensity signal I = I(z, x, t, n f , p) is a function of depth z, in-plane lateral coordinate x, time t, frame n f and polarization channel p = {1, 2} of the polarization-diverse receiver. Dependency on out-of-plane coordinate y is omitted for simplicity. We now define the operator t 〈⋯〉 n ω t, t + τ for temporal ensemble averaging of the cross-product of a function K evaluated at t and t + τ for a given time-delay τ and correlation window size n ω as where we remark that τ is an integer time-difference index, n t (n ω , τ) = n ω − τ for uniform sampling as discussed above, and t is an integer index that goes from 1 to n ω − τ, the maximum available time difference in the ensemble. Similarly, we define the operator t 〈⋯〉 n ω,τ for temporal ensemble averaging of a single term of a function K as t 〈K(z, x, t, n f , p)〉 n ω , τ = 1 n ω − τ t = 1 n ω − τ K(z, x, t, n f , p) . (26) Based on the above, computation of the first-and second-order ACFs given above is straightforward. For instance, g HBT (2) is computed as g HBT (2) (τ) = t 〈I(z, x, n Ω n ω + t, n f , p)〉 n ω t, t + τ t 〈I(z, x, n Ω n ω + t, n f , p)〉 n ω , τ t 〈I(z, x, n Ω n ω + t + τ, n f , p)〉 n ω , τ .
For noise correction, the signal and noise floor are averaged in the same way, e.g. the SNR used to correct for noise in the above ACF is calculated, assuming Q = Q(z, p) only, as R = t 〈I(z, x, n Ω n ω + t, n f , p)〉n ω , 0 Q(z, p) − 1 .
The temporal scanning mode allows to study the sample dynamics at different fixed positions and is used, for example, in flowmetry and angiography. However, in certain examples, particularly in some experiments that we detail below, there is an interest in studying the spatial evolution of an relatively static sample, dominated in principle by speckle decorrelation, using a spatial scanning mode, in which the system acquires B-scans capturing A-lines while scanning through lateral coordinate x. In such case, assuming that the beam is scanned at a constant speed, time t and in-plane coordinate x are equivalent in terms of ensemble averaging as in an ergodic scatterer system, thus in practical terms one can omit x and only consider t as the dimension used to calculate the ensembles.
Consequently, we define the operator s 〈⋯〉 N w s w s for spatial ensemble averaging of a single term of a function K within a normalized window w s (x, z) of depth and lateral size N w s = N z 2 w s (n x , n z )K(z + n z , x + n x , t, n f , p), which considers spatial-ensemble averaging along depth and lateral dimensions, although this can be extended similarly to out-of-plane lateral coordinate, and where the normalized window w s (x, x) is w s (x, y) = w s (x, y) n z , n x w s (n z , n x ) . (29) Using this operator, computation of g HBT (2) ( τ ) via s-EA is performed as g HBT (2) (τ) = t s 〈I(z, x, n Ω n ω + t, n f , p)〉 N w s w s n w t, t + τ t s 〈I(z, x, n Ω n ω + t, n f , p)〉 N w s w s n ω , τ t s 〈I(z, x, n Ω n ω + t + τ , n f , p)〉 N w s w s n ω , τ .
For this case, assuming Q = Q(z, p) only, the SNR used to correct for noise is calculated as R = t s 〈I(z, x, n Ω n ω + t, n f , p)〉 N w s w s n ω , 0 On the other hand, computation of g HBT (2) ( τ ) using ACC is done as g HBT (2) (τ) = s t 〈I(z, x, n Ω n ω + t, n f , p)〉 n ω t, t + τ t 〈I(z, x, n Ω n ω + t, n f , p)〉 n ω , τ t 〈I(z, x, n Ω n ω + t + τ, n f , p)〉 n ω , τ N w s w s .
For the noise correction in ACC, the correction can be applied to each ACF before compounding using the SNR from Eq. (28), or after compounding using the calculated from Eq. (30).

Decorrelation rate calculation-
In the experiments in which a decorrelation rate is reported, we defined a decorrelation threshold g c , and calculated the time lag τ c for which the ACF dropped below the threshold after linear interpolation. The decorrelation time in A-lines was converted into ms by using the A-line rate of the laser used. We also used a correction factor to account for the specific threshold used to express the decorrelation time as the equivalent decorrelation time when the ACF function reaches exp (−1). We inverted this corrected τ c to calculate the decorrelation rate expressed as (2) -based angiography experiment, motion artifacts due to cardiac motion produced very high decorrelation values for some B-scans. In order to correct artificially high τ −1 due to motion, we developed a motion correction procedure analogous to that used in Doppler OCT for bulk motion correction [41]. We calculated the averaged decorrelation rate for each B-scan τ −1 , using a mask to consider only regions with R ≥ 20 dB to guarantee a similar motion correction for all volumes with and without SNR correction. We then assumed that, in general, the motion will happen along a direction not parallel to the blood flow which gives rise to decorrelation inside vessel lumina. Based on intensity-based DLS-OCT [15], decorrelation contributions arising from different directions are added quadratically. We therefore subtracted the mean decorrelation τ −1 to each decorrelation rate in a frame to obtain the motion-corrected decorrelation

Motion correction in angiographic contrast-In the g
where Re{·} is the real part and the max function is used to make τ = 0 when the square root argument is negative.

Noise model validation
For the validation of the noise model, we used the benchtop system and a solid polymer phantom. We turned off the galvanometer scanners and acquired an M-mode (continuous Aline acquisition with no lateral scanning) of 2048 A-lines. We calculated, for each depth, the mean intensity and the RSD from the fluctuations of the tomogram intensity. In addition, we determined the noise floor of the system by blocking the sample arm as explained above, obtaining a depth-resolved noise floor intensity |N(z)| 2 , and used Eq. (5) to calculate the RSD predicted by the model based on the average signal and noise amplitudes. Figure 3 shows the results, where it can be noted that the RSD predicted with the model matches fairly well the experimentally determined RSD. We also include a dashed line with slope −0.5 -which corresponds to the RSD decreasing with the root square of the mean intensity signal-, but note that this relation only holds throughout a tomogram if the noise floor is not depth dependent. There are divergences between model and experiment at some specific data points, which we attribute to saturation artifacts: the noise magnitude determined by blocking the sample arm is lower than the noise magnitude during the experiment, which results in experimental RSD values higher than predicted. In summary, these results validate the noise model originally proposed by Makita et al. [24] on which all the noise corrections we developed for g (2) are based.

g (2) normalization, variability, contrast bias, and statistical bias
For the study of the statistical bias, the contrast bias, the noise correction and the performance of the different definitions of g (2) and normalizations, we used a solid Intralipid-agarose phantom, using 1% agarose gel and 5% Intralipid in volume. We used galvanometer mirrors, acquiring 4096 A-lines per B-scan and 4 B-scans per volume. In all the analyses we omitted the first 128 A-lines of each B-scan to avoid artifacts from the scanner flyback and settling time. The scan range was 2.56 mm in-plane and 0.125 mm outof-plane with the collimator-lens pair that provided 40 μm lateral resolution. The in-plane scan range corresponded to an in-plane sampling of 0.625 μm, or roughly 33× Nyquist sampling. This level of oversampling allowed us to study the ACF in a typical flowmetry regime, where the decay is expected to happen within ~ 100 A-lines. The out-of-plane scanning allowed us to have multiple speckle realizations of the same dynamics. This effectively gives us a very large data set to calculate the statistics related to bias and variability.
We start our analysis by comparing the performance of the two normalization approaches defined above for the DLS and HBT definitions. Figure 4 shows a comparison of the secondorder ACF for single depth with high SNR (28dB) to neglect effects of noise, calculated using g DLS,g (2) , g DLS,c (2) , g HBT,g (2) and g HBT,c (2) . For this comparison we divided the sampling interval into N Ω = 62 correlation windows of size n ω = 64 samples [ Fig. 4(a)] and N Ω = 15 with n ω = 256 samples [ Fig. 4(b)]. For all cases, ACF within each correlation window was calculated and averaged to obtain a single ACF per definition. Given the expected decay of ~ 30 A-lines, these two regimes were chosen in order to have a correlation window nearly 2× the decay and 8× the decay in size. Given that our goal was to determine the best approach to accurately estimate the decorrelation of the signal with the fewest number of samples possible, we used the case with n ω = 64 as a benchmark and the case with n ω = 256 as a reference. Although using larger n ω is in principle possible, large-scale inhomogeneities in the signal back-scattered from the sample -due to irregular surface or sample heterogeneity -can start to affect the calculation of the ACF and thus we avoided it in the benchtop experiments. Apart from the ACF average, for the case of n ω = 64 samples we also calculated their standard deviation; Figs. 4(c)-(d) show the average ACFs and their ± standard deviation in the shaded area.
Before discussing the effect of the two normalization approaches, we want to point out the form in which statistical bias manifests in the estimated ACF. In Fig. 4(a), the use of the small correlation window n ω = 64 makes the average ACFs calculated more susceptible to bias than those in Fig. 4(b) with n ω = 256. Statistical bias is seen in two main ways: 1) the initial decay of the ACF is different -we have generally seen bias producing a stronger initial decay; and 2) there is an increase in the value of the ACF at some τ. In some cases, rather than an increase in correlation with τ, the ACF starts to decrease with τ more slowly and fails to decay to 1 at time lags where there is no correlation. From Fig. 4(b) the ACF for this experiment should reach a value of 1 around τ = 25-30 A-lines. In what follows, any departure from this behavior is a sign of statistical bias.
With respect to the normalization approaches, Fig. 4(a) reveals a lower bias for global normalization than for contrast normalization for small correlation window sizes. This lower bias happens both at low values of τ (the correlation drops more rapidly with contrast bias compared to the references with n ω = 256), as well as at high values of τ, where both g DLS,c (2) and g HBT,c have values consistently below 1 and then increase sharply towards τ = 30. This bias is reduced as n ω is increased resulting in a similar performance, although global normalization still delivers a correlation value closer to 1 for large τ, while contrast normalization produces values consistently below 1. The variability seen in Fig. 4(c)-(d) also benefits global normalization, especially for DLS. Given these results, we will limit ourselves to the use of global normalization for the rest of this work, and we only use g DLS,g (2) and g HBT,g (2) to calculate the ACF.
We now move onto comparing the performance among the different definitions of g (2) . Figure 5 shows a comparison of the three definitions of the ACF at two different depths corresponding to 28 dB and 38 dB SNRs. Averages and variabilities were calculated in the same way as those in Fig. 4, i.e. n Ω = 62 with n ω = 64 in Fig. 5(a) and n Ω = 15 with n ω = 256 in Fig. 5(b). The ACFs for both depths should be ideally identical; we show two depths to give an idea of how the variability shows up in individual ACF estimations. In terms of variability they are, indeed, very similar for g HBT,g (2) and g P (2) , however, g DLS,g presents a larger deviation among depths when using a small n ω [ Fig. 5(a)]; this deviation is reduced when using larger n ω [ Fig. 5(b)], in which case the three definitions perform similarly. In Fig. 5(c), it is evident that the variability using N Ω = 62 with n ω = 64 is significantly higher in agreement with Fig. 4. Variability for g HBT,g is lightly lower than for g P (2) . It is important to note that g DLS,g (2) presents an increasing variability with τ, whereas variability for g HBT,g (2) and g P (2) tends to remain constant after the main decay.
The observations regarding variability can be explained by the fact that the DLS definition in Eq. (8) uses only half of the members of the ensemble for the denominator compared to the HBT definition. When the members of the ensemble become smaller as τ increases, the ACF estimation worsens more rapidly than HBT. This is also seen in Figs. 4(a) and 5(a) as statistical bias: the reduced size of the ensemble in the denominator makes the statistical bias stronger, seen in the more apparent increase -compared to HBT-in correlation towards τ = 30 A-lines. Pearson also exhibits a significant bias in Fig. 5(a), which we attribute to the contrast bias discussed in Sec. 2.3.3. The implication of this is that the decay in Pearson is significantly different for different correlation window sizes.
Given the lower variability and lower bias, and its non-dependency on contrast, we conclude that the g HBT,g (2) definition is the best estimator of the second-order ACF for OCT applications. For the reminder of the experiments we will focus on the HBT definition given its clear superiority.

g (2) noise correction and averaging strategies
We used the same data acquired for the experiments discussed in Sec. 4.2, but now we focus on the analysis of the noise correction incorporating data from a large range of SNRs. Figure   6 shows g HBT,g [Eq. (15)] and g HBT,g [Eqs. (16) and (18)] for five depths corresponding to SNR values [32,24,16,8,4] dB. We calculated and averaged g HBT,g (2) for N Ω = 62 with n ω = 64 [ Fig. 6(a)] and N Ω = 15 with n ω = 256 [ Fig. 6(b)], but rather than using exclusively t-EA as in the previous sections, we used s-EA and ACC averaging approaches. The kernel was defined as a normalized window of size N w s = {14, 0, 0} (i.e. only depth averaging).
We first focus on the performance of the noise correction. The sharp drop between τ = 0 and τ = 1 A-line is the most evident effect of the noise and a confirmation of its white power spectrum. However, merely re-scaling the drop is not enough, due to the change in the shape of the curve as predicted in Eq. (49). It is evident that the correction is working as intended, recovering the true decay between τ = 0 and τ = 1 A-line that was strongly affected by the noise-induced sharp drop in correlation, in contrast to our previous work [14]. We are able to recover the same shape of the ACF for a very wide range of SNRs. Figure 6(c) shows the variability analysis. In general, variability increases as SNR decreases, and it is consistently smaller for s-EA than ACC, but not by a large margin.
With respect to the two averaging strategies, we observe that bias is stronger for ACC compared to s-EA for both small τ (the shapes are different between the two correlation sizes) and for large τ, where the ACF has a tendency to increase in value for the smaller window. This is coherent with the discussion on the origin of the statistical bias: averaging ACFs with bias due to the small correlation window size will only reduce the variability in the estimation, not the bias itself. In contrast, s-EA increases the size of the ensemble for all τ, reducing the bias and the variability at the same time.
Moving away from the statistical analysis of bias and variability, we show a practical example in Fig. 7 where only 2 correlation windows of size n ω = 64 were averaged after calculating g HBT,g (2) and g HBT,g (2) using the same s-EA and ACC averaging approaches described above. The intention is to show the behavior of the ACFs before and after noise correction representative of a practical application, where we assumed that the total number of samples N t available for the computation of the ACF is 128, typical of flowmetry. The initial decay due to noise decorrelation in uncorrected ACF is compensated after SNR correction, even for low SNR values that present evident fluctuations. Note that bias and variability are evident in this case because the low number of samples used. This result also suggests that approaches that fit the ACF to a function [10,13] may perform better after noise correction in low SNR regions in comparison to approaches that calculate a decorrelation time. It is expected that the fluctuations in the low-SNR ACFs will average out during the fitting procedure and a relatively correct decay rate obtained, compared to relying on the τ value after a correlation threshold is crossed [14,15,20].
So far, results have shown that bias is reduced when increasing n ω (t-EA), and when using spatial averaging with s-EA. We now focus on comparing the effectiveness of each approach in reducing bias in order to conclude whether is it more advantageous to increase n ω and sacrifice the temporal resolution of each ACF evaluation, or to increase the kernel size in s-EA and sacrifice spatial resolution in the ACF. To answer this, we show in Fig. 8 multiple combinations of spatial window sizes (n s ) with depth averaging N w s = {N z , 0,0} and correlation window sizes (n ω ), in such way that each combination results in an equal n ts (n ω , τ = 30 A-lines). We show average ACFs in all cases, thus focusing on bias and not variability. We consider three different total ensemble sizes of n ts = 95, 160 and 472 which only hold for τ = 30 A-lines; we also show a case with a large n ts in black as a reference with no bias. At τ = 30 A-lines bias is seen essentially as a deviation from g (2) = 1. Results show that, for a constant total ensemble size, increasing the correlation window (t-EA) is more effective at reducing the bias than increasing the spatial kernel size (s-EA). This means that g HBT,g (2) offers a more robust estimation when increasing the number of members in the temporal ensemble averaging (i.e. the correlation window size n ω ) than in the spatial ensemble averaging. However, s-EA seems to be as effective as t-EA at reducing the variability. We note that the blue curve in (b) and (e) has a N z = 160, which is extremely large and therefore includes pixels from many physical locations in the sample and a large range of SNRs. The behavior of this set of parameters in (b) and (e) highlights the risk of using too large of a spatial ensemble size: excessive spatial averaging can become detrimental to the accuracy of the calculated ACF.

Determination of speckle size in a rotational endoscopic probe and improved NURD detection
For the evaluation of speckle decorrelation rate as a function of depth in an endoscopic system we used a phantom fabricated with Intralipid-20%, diluted with water to a volume fraction of 0.1 and mixed with agarose (3 g/100 mL). We used agarose to create a solid phantom, to avoid movement due to Brownian motion and to ensure that the catheter would not move inside the phantom during the scan. only depth averaging). Given that we punctured the phantom with the catheter for imaging, there are virtually no surface inhomogeneities in this case, the reason for which we were able to increase n ω up to 2048. We used a correlation threshold g c = exp(−1) to calculate the decorrelation rate τ −1 according to Eq. (31). Figure 9(a)-(b) shows the decorrelation rate determined at each rotational speed for n ω = 256 samples using g HBT,g (2) [ Fig. 9(a)] and g HBT,g (2) [ Fig. 9(b)]. Before noise correction, there is a clear increase in τ −1 when the depth approaches 1 mm. However, g HBT,g (2) reveals that τ −1 is nearly constant with depth, with just a slight increase [ Fig. 9(b)]. In Fig. 9(c), the decorrelation rate as a function of rotational speed for multiple correlation window sizes shows the presence of bias, especially for small sizes. Since there was no pullback during imaging, we essentially imaged the same speckle pattern several times (dependent on the rotational speed) with only different realizations of the noise. The linear fit shown corresponds to n ω = 32 assuming a zero intercept. The speckle pattern became decorrelated between A-lines at 75.0 RPS, which we believe is the reason for the strong fluctuations at 66.7 RPS, given very small fluctuations in the strong decay in the ACF between τ = 0 and τ = 1 A-line produce large fluctuations after inversion to calculate the decorrelation rate.
For the demonstration of the improved NURD detection, we performed measurements with the same catheter probe inside raw chicken breast. To obtain a registration mark to allow us to easily visualize the effect of NURD during imaging, we imaged from within a glass capillary with 1.6 mm diameter inserted in the tissue. This allowed us to reproduce the imaging configuration in e.g. intravascular imaging, where the vessel lumen is a few mm in diameter and the catheter can be imaging from an off-center location. This produces large differences in tissue depth within a single B-scan, which requires knowledge of the expected behavior of speckle size with depth to correctly interpret the obtained ACF to calculate an accurate rotation speed. The nominal rotation speed was set at 50 RPS; we induced NURD during imaging by pinching the catheter sheath at the proximal end. The correlation window size was n ω = 24 and kernel size for s-EA was N w s = {41, 21, 0} (i.e. depth and in-plane averaging) with a Gaussian kernel with e −2 diameters of [20,10,0] in (z, x, y), which provided us with 85 estimations of the ACF in the lateral dimension for each B-scan. We used the linear fit from Fig. 9(c) to convert the measured decorrelation rates into rotation speeds. Figure 10 shows the improved NURD detection after SNR correction in an endoscopic system. In Figs. 10(a) and 10(b) we show a decorrelation rate overlay: the intensity of the tomogram provides the luminance, and the rotation speed (in RPS) is encoded in the hue using a nearly-perceptually-isoluminant colormap based on the isolum colormap [42], which we made perceptually uniform [43] and for which we then increased the chroma to improve the contrast. Fluctuations in the rotational speed of the catheter within a B-scan during imaging induces NURD in the tomogram. A correction for NURD can be applied if the speed of the catheter rotation is known. Assuming, to an excellent approximation, that movement of the tissue during imaging is much slower than the scanning speed, the decorrelation is only the result of the catheter rotation speed. Given the results from Fig. 9, the decorrelation rate is expected to differ across azimuthal positions inside a B-scan, but expected to be the same with depth. Figure 10(c) shows that the estimated rotation speed before SNR correction increases with depth, whereas after SNR correction it is fairly stable with depth. In addition, the standard deviation over the mean of the decorrelation rate per correlation window decreases significantly after SNR correction, Fig. 10(d). Averaging the rotation speed in depth provides an estimation of the rotation speed as a function of A-line inside the B-scan, Fig. 10(e). After SNR correction, we obtain a value that fluctuates around the nominal rotation speed, in contrast to the value obtained without SNR correction that exhibits a positive skewness due to the artifactual high decorrelation rates estimated in deep depths, where SNR is lower. This implies that the SNR correction will result in a more accurate determination of the decorrelation rate and, thereby, the rotation speed of the catheter. In turn, this could result in a more accurate NURD correction with existing algorithms [20], however, we consider this further step out of the scope of the present work.

Improved intensity-based angiographic contrast
For the comparison between s-EA and ACC and the demonstration of the noise correction in angiography, we configured the benchtop system to scan a field of view of 1 mm×1 mm with the collimator-lens pair that provided 9 μm lateral resolution. We sampled at 384 in-plane lateral locations and 256 out-of-plane locations with 4 B-scan repetitions at each out-ofplane location. Kernel size for s-EA and ACC was N z = 21, N x = 9, N y = 9 (i.e. depth, inplane and out-of-plane averaging) with a Gaussian kernel with e −2 diameters of [10,4,4] in (z, x, y). We note that given the revisiting time of 3.84 ms and the lateral resolution of 9 μm, full decorrelation is expected at flow speeds between above 1.17 mm/s in a single scattering regime. We expect that the signal from most vessels of small diameter will not be fully decorrelated and therefore the decorrelation rate is representative of flow rate. The noise correction for ACC was performed after spatial averaging, because the SNR estimation for each ACF was so poor -due to the very limited ensemble size n ω = 4-that the estimated SNR was negative for many ACFs which produced erroneous noise-corrected ACFs. Figure 11 shows overlays of decorrelation rate (angiographic contrast) with the structural image of the finger nail vasculature of a healthy volunteer, before and after SNR correction. corresponds to the depth marked with the white dashed line in the B-scan view, a region with low SNR. It is clear that the decorrelation rate of static tissue is greatly affected by the noise, and therefore the contrast of the vasculature is low. SNR correction provides much higher contrast. The contrast of the vasculature is also greater with s-EA compared to ACC, highlighting the benefits of the lower statistical bias of the former. Note that projection tail artifacts below vasculature remain after SNR correction, given that they are intrinsic to the signal as a consequence of decorrelation due to strong forward multiple scattering of red blood cells coupled with scattering events arising from both moving and static tissue; these artifacts are not present in tissue bulk motion even in a multiple scattering regime [36] such as the bulk rotational motion in Fig. 10. Algorithms have been devised to suppress projection tail artifacts, and these may benefit from the SNR correction [44].
For a more detailed comparison, Fig. 11 also contains plots of g (2) at locations A-F marked in Fig. 11(a) within vessels with full (A and D), partial (B and E) decorrelation and static tissue (C and F). A-C are at a depths with high SNR and g (2) before and after SNR correction are almost identical for both s-EA and ACC, although bias is evidently stronger for ACC. SNR correction becomes important at depths with low SNR (D-F) and partial decorrelation (E-F), particularly for static tissue (F), where artifactual high decorrelation rates are measured without SNR correction. We note that the SNR compensation in our previous work [14] would have failed in E because, due to the dropping of the value at τ = 0, the ACF would have been estimated to be almost flat and thus exhibiting little decorrelation.

Discussion
We have carried out an exhaustive study of the performance of the different definitions of the second-order ACF of the OCT signal and its averaging strategies. From the analytical analysis and the experimental results, we concluded that the symmetric form of the ACF, g HBT (2) , is superior to all other definitions in the context of OCT. We also concluded that the empirical global normalization approach has the best performance to compensate for contrast-bias in HBT. In terms of averaging strategies, temporal ensemble averaging (t-EA) is the most efficient way to reduce the statistical bias in g (2) , however its reliance on increasing the size of the correlation window size n ω implies a penalty in terms of acquisition time. Spatial ensemble averaging (s-EA) is second in terms of efficiency, and it is the most attractive choice when processing ACFs in time-constrained applications such as angiography. Finally, ACF compounding (ACC), the most used approach in the literature, only tackles variability but does not reduce the bias of the ACF. We note that we have limited ourselves to the second-order ACF, and that the statistical bias strength and the optimal strategies may vary in the case of the first-order ACF; however the latter are out of the scope of this work.
The statistical bias present in time series with typical sizes makes its mitigation of prime importance. Very importantly, discrepancies between model and experiments can be significant if bias is not reduced [45]. We believe that the current (intensity-based) DLS-OCT models should not be blindly applied without carefully considering statistical bias; a calibration carried out with the exact correlation window and ensemble averaging should ideally be made. We also expect that with the knowledge of the expected shape of the ACF, in future works it could be possible to derive an analytical compensation for statistical bias. This could reduce bias in applications with small correlation window sizes; however, addressing the ACF variability via s-EA will still be necessary.
We also developed an analytical correction to compensate for noise in the OCT signal, extending the SNR range in which autocorrelation analysis can be used. This correction allowed us to accurately determine experimentally the lateral speckle size depth dependence in a rotational endoscopic probe with low NA. We demonstrated the expected, almost constant speckle size with depth in animal tissue ex vivo and showed the ability to more accurately determine the rotational speed of an endoscopic probe to implement NURD detection and potential correction.
Lastly, we presented g (2) -based angiography of the finger nailbed, where the superior performance of s-EA over the commonly used ACC is evident, with better blood flow contrast and suppression of noise decorrelation artifacts.

Conclusion
Functional OCT imaging based on the decorrelation of the intensity signal has been used extensively in angiography and is finding use in flowmetry and therapy monitoring. However, despite the apparent simplicity of implementing the autocorrelation analysis, there are many subtleties and compromises imposed by the acquisition time constraints of clinical imaging and the minimization of motion artifacts while imaging in vivo. We presented a rigorous analysis of many aspects of the estimation of the autocorrelation function and presented experimental evidence for the best use of the acquired data to obtain the optimal decorrelation metrics for most OCT applications.

Appendix B
Now we consider the two polarization channels p = {p 1 , p 2 } corresponding to the channels of the polarization-diverse receiver. In such case, we define the noiseless signals S p1 and S p2 and the total noiseless signal S T = S p1 + S p2 , the noises N p1 , N p2 and total noise N T = N p1 + N p2 . We therefore can define the intensities T p j = |S p j | 2 , Q p j = |N p j | 2 and I p j = |S p j + Q p j | 2 , and the total intensities T = |S p1 | 2 + |S p2 | 2 , Q = Q p1 + Q p2 and I T = I p1 + I p2 First, we note that noise is different in each polarization channel (i.e. N p1 ≠ N p2 ), but signal is the same except for scaling factors α, β, thus S p1 = αS and S p2 = βS, and therefore where we used the property |α| 2 + |β| 2 = 1. In this derivation, we will only consider the HBT definition for the second-order autocorrelation of the noiseless T = T p1 + T p2 = |S| 2 and the noisy total intensity signals given by where we recall subscripts 1 and 2 represent (t) and (t + τ), respectively, whereas p 1 and p 2 represent the polarization channels. Assuming that the noise in any channel and the signal are not correlated, i.e. 〈SN p j 〉 = 〈S〉〈N p j 〉, also 〈N p j 〉 = 0, several terms in Eq. (57)  Autocorrelation analysis in OCT is used to determine local dynamics of scatterers, which adds functional contrast such as blood flowmetry. The evolution of the complex-amplitude OCT signal reveals presence of moving scatterers [upper blue curve in (a)], which can be quantified using the first-order ACF g (1) [blue curve in (b)]. When analyzing the OCT intensity signal [lower blue curve in (a)], the second-order ACF g (2) is used for quantification [blue curve in (c)]. In both cases, the decay of the ACF can be related to the scatterer dynamics -including diffusive and translational motion, indicated generically as v in the figure. Noise in the OCT signal [green curves in (a)] is known to affect g (1) and g (2) [green curves in (b) and (c)], most commonly seen as a sharp initial drop in the ACF. Furthermore, g (1) (τ = 0) = 1 by definition, but g (2) (τ = 0) value is dependent on the contrast of the OCT intensity signal time series. Statistical bias manifests as a different estimated ACF decay for the same process when using time series with different lengths [ACFs in (d) and (e)]. Illustration of the operation of averaging strategies to obtain a more robust estimation of the ACF of the times series in (a) where three temporal members are used for the temporal ensemble average. For the averaging strategies, we consider the goal of having six members of the ensemble in total: in (b) the number of time samples is higher (t-EA averaging), and in (c) and (d) there are time series for two spatial locations x 1 and x 2 to calculate the ACF using (c) s-EA and (d) ACC. As we are considering only the numerator of g (2) for illustration purposes, Π(τ) represents the product of the elements in the intersection of the time series with and without time-lag τ: six elements for (b) and three elements for (a), (c) and (d). Experimentally determined RSD in an M-mode acquisition of a static sample and comparison with the model prediction. The good match validates our noise model on which the rest of our results rely on. The dashed line corresponds to the expected behavior for a system with depth-independent noise floor, which our benchtop system follows closely. Average ACFs using global and contrast normalization of g DLS (2) and g HBT (2) for a signal with 28 dB SNR using a correlation window size n ω of (a) 64 and (b) 256 samples. Variability of g DLS (2) and g HBT Average ACFs for the three definitions of g (2) at two depths corresponding to two 28 dB and 38 dB SNR (see colorbar) using a correlation window size n ω of (a) 64 and (b) 256 samples. Variability each definition for (c) 28 dB and (d) 38 dB using n ω = 64. Shaded area encloses the mean value ± standard deviation. To allow a direct comparison, we plot g P (2) + 2 to match the range of the other ACFs. Average ACFs before [g HBT,g , left sides] and after noise correction [g HBT,g , right sides] calculated using s-EA and ACC with N z = 8 for five depths with corresponding SNR values coded in color (see colorbar) with a correlation window size n ω of (a Exemplary autocorrelation analysis mimicking a flowmetry application; before [g HBT,g , (a), left sides] and after [g HBT,g , (b), right sides] noise correction for depths with different SNR values (see colorbar), using s-EA (top) and ACC (bottom) averaging with N z = 8. We reproduced a typical flowmetry with a total of 128 time samples using N Ω = 2 and n ω = 64. Average ACFs g HBT,g (2) calculated using combinations of tand s-EA averaging for a single depth with 28 dB SNR with different total ensemble sizes n ts of 95 (a), 160 (b) and 472 (c) at τ = 30 A-lines. The corresponding variabilities are in (d), (e) and (f); therein the shaded area encloses the mean value ± standard deviation. Each specific average has a combinations of n ω (for t-EA) and N z (for s-EA) indicated in the legend in the form n ω ;N z . The black curve used as a reference ACF with no bias was calculated using n ω = 512 and N z = 80 and is the same for all cases. Lateral speckle size analysis in a rotational endoscopic probe using the decorrelation rate determined from the depth-resolved ACFs and g HBT,g (2) . Decorrelation rate as a function of depth for g HBT,g (2) [before noise correction, (a)]; noise-corrected decorrelation rate for g HBT,g Improvement of NURD detection in a tomogram of chicken breast obtained with an endoscopic system. A tomogram is presented with overlays of the decorrelation rates calculated before (a) and after (b) noise correction (the luminance is given by the tomogram intensity and the hue of the nearly-perceptually-isoluminant colormap by the decorrelation rate). After noise correction, the decorrelation rate as a function of depth varies much less with depth, as shown here for (c) a region with high rotation speed (violet squares in tomograms). The standard deviation (σ) over the mean (μ) of the decorrelation rate (τ −1 ) decreases due to the noise correction, as visible in the histogram over all the correlation windows (d). Depth-averaging of rotation speed as a function of A-line (e). Without noise correction, rotation speed is positively skewed with respect to the nominal value; after noise correction rotation speed exhibits the expected fluctuation around the nominal 50 RPS value. Example of g (2) -based angiography with and without SNR correction, using s-EA and ACC averaging strategies. All views correspond to overlays where the luminance is given by the tomogram intensity and the hue of the nearly-perceptually-isoluminant colormap by the decorrelation rate. vessels near the center of the tissue. Low-SNR tissue regions exhibit some degree of decorrelation presumably due to noise, which became significantly lower after SNR correction; visually, the s-EA approach is more robust. Plots at bottom show g (2) at the four locations A-F marked in (a) with high (A-C) and low (D-F) SNR; full decorrelation (A, D), partial decorrelation (D, E), and static tissue (C, F).