Direct-Sequence-CDMA in Highly Sensitive Indirect Time-of-Flight Distance Sensor

This work presents the application of Direct-Sequence Code-Division-Multiple-Access (DS-CDMA) to tackle the primary problem of simultaneous multi-access of a shared light channel in an indirect Time-of-Flight measurement system based on on-off-keyed (OOK) lasers and highly sensitive single-photon avalanche diodes (SPADs). A theoretical model of the generalized sensor system, possibly suffering from multi-path propagation, is devised for the general application of DS-CDMA. The particular choice of Gold codes is argued to not only enable multi-access but even allow for multi-path resolution down to the sampling time of the utilized digital correlator. It also increases the unambiguously detectable range by three orders of magnitude in comparison to trivial continuous square-wave modulation. Simulations and successive experimental data reveal the proposed improvements compared to trivial square-wave modulation, whilst showing an expected degradation in precision. However, still a precision below 1.5 mm is reached. A novel interleaving procedure of the codes is postulated and verified to recover the precision originally experienced upon trivial modulation.


I. INTRODUCTION
M ODERN ranging and localization applications are very often well suited for the application of optical time-offlight sensors.Their robust and yet simple operation principle has the potential for solving countless ranging problems in many different application areas, such as vehicular-ranging [1] or for fast and precise indoor localization in industrial applications [2].The general concept behind time-of-flight measurements is to infer the distance to a reflective object by measuring the time it takes photons to propagate a path from a dedicated source to the distant object and back to an associated detector.This measurement can be done directly by a dedicated time measurement or indirect.In this paper, we are focusing on the latter one.Hereby, the indirect operation principle makes use of a distinct modulation scheme for the light sources, which is utilized upon correlation successive to reception of the reflected photon stream.The time-of-flight t ToF is estimated based on the indirect observation of the associated phase delay Δφ(t ToF ) of the known modulation signal after a correlation process.Given the phase delay and assuming a single but direct light path in a linear, homogeneous and isotropic medium, allows deriving the path length l as where the propagation speed c is the vacuum light speed c 0 divided by the refractive index n, i.e. c = c 0 /n, and T 0 is the period of the signal.This relation is unambiguous as long as t ToF < T 0 .More specifically, T 0 imposes an upper bound on the unambiguity that is proportional to the smallest periodic repetition in the correlation signal.Please note that in lightranging scenarios typically the distance is referred to as d = l/2 instead of the total path length l, which is motivated by the light travelling the same path twice, from the source to the object and vice versa.Such briefly discussed single sensor measurements may scale up to multi-sensor systems, where the light channel represents a shared medium.The simultaneous access of multiple sources or detectors could be intended to enable multi-view or multipixel measurements of a scenery as discussed in [3].Otherwise, the shared access is unintended and thus the undesired sensors introduce interfering light signals from the perspective of an individual desired sensor on top of the ever existing background light.Of course, it is desirable in both cases that each sensor is able to operate simultaneously such that true multi-access on the shared channel is possible.Also inherent in the application of optical ranging is multi-path propagation, which a sensor should be able to resolve.Summarizing, the objectives aimed for such systems include r Enabling simultaneous channel access r Resolving multi-path propagation r Maximizing unambiguously detectable range These targets are of course subject to minimizing the distance estimation-error, which is related to optimizing the precision apart from systematic errors.

A. Related Work
Albeit a continuous square-wave modulation has shown superior performance of an iToF-sensor based on a Single-Photon Avalanche Diode (SPAD) in Geiger-counting mode regarding sensor precision under low light conditions in [4], the trivial modulation would have failed to enable multi-access.A neat solution is to encode every source signal and establish Direct-Sequence Code-Division-Multiple-Access (DS-CDMA).That indeed Pseudo-Noise-sequences (PN-sequences) are viable candidates for indirect time-of-flight sensors has already been proposed in [5].Their possible multi-access abilities have been later emphasized in [6].Since then, the PN CDMA approach, has been successfully deployed, e.g. more recently in [7] for multi-view ranging in a space application.The work in [8] goes conceptually one step further by utilizing a true-random sequences generator based on online recording of photonic noise.It comes at the additional occupation of a dedicated SPAD for noise detection.Depending on the correlators architecture, the unipolar nature of the involved photons could demand special consideration, when operated in CDMA schemes.In [9], [10], [11], this problem is tackled by using Optical-Orthogonal-Codes (OOCs) that represent a special class of unipolar codes.Nevertheless, dealing with unipolar issues may come at the cost of less interference suppression due to sub-optimal cross-and auto-correlation properties of the concerned codes in comparison to the in that sense classical ones used when bipolar signalization is possible.Therefore, it is often desirable to have the freedom of choice beyond unipolar codes.The work in [12] gives evidence that Gold codes, which have been very successfully implemented in GPS for multi-access and thus solving a very similar problem, can be also used in iToF-sensors.However, the question remains open whether such modulation schemes are applicable for highly sensitive detectors based on SPADs operated in Geiger-counting mode to utilize time-correlated single-photon counting (TCSPC) similarly implemented on the hardware described in [4].

B. Contribution
This work discovers the abilities of Gold codes allowing for true multi-access and their impact on the superior sensor precision on similar detector hardware as used in [4], [13].Undeniably of special interest is to prove whether the codes' autocorrelation properties increase the unambiguously detectable range and to what extent multipath resolution is achievable.A generally applicable interleaving procedure for arbitrary codes is presented to recover superior sensor precision.

C. Paper Organization
For this purpose, a detailed system description covering the most important aspects is given in order to motivate the choice of suitable codes in Section II.It is followed by the discussion of conducted simulations and experiments in Section III.Section IV summarizes the most important results and concludes this work.The Appendices support the system model with two short proofs.

II. THE PROPOSED DS-CDMA INDIRECT TOF SYSTEM
The system under consideration consists of M laser light sources and N highly sensitive detectors, each based on a SPAD in Geiger-counting mode, ideally detecting every single incident photon.For the upcoming representation we use m ∈ {1, . . ., M} and n ∈ {1, . . ., N} to address a laser and a detector, respectively, as illustrated in Fig. 1.

A. Modulation and Coding Scheme
Each of the M lasers is encoded by a single codeword that is drawn from a specific code-set C containing words of equal lengths L. Binary codewords are here considered to be general vectors over the finite prime-field of characteristic 2, denoted by F 2 , whose entries shall be called chips.All codes in use can thus be conveniently collected in a codebook ( The single bits of these codewords are mapped to consecutive rectangular pulses (rect) with pulse period T c and normalized amplitude forming the codeword pulse These codeword-pulses are periodically repeated during ongoing measurements to establish continuous On-Off-Keying of the light sources forming the effective modulation signal The laser operation is controlled such that a constant, average optical light power P opt is emitted.Defining w m = L i=1 c m,i as the code-weight of the m-th source, concludes the average rate during the i-th pulse as as photons carry energy related to their wavelength λ scaled by Planck's constant h and the vacuum light speed c 0 .The actual rate of emitted photon pulses during the entirety of the associated codeword-pulse is then randomly fluctuating as an Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.independently and identically distributed (i.i.d.) random process Φ m,i ∼ P{Φ m } according to [14], where coherent light sources are assumed.Incident photons are indistinguishably from the detectors perspective except their incident time.Therefore, photon streams emitted by the lasers are expressed as superposed, time-shifted Dirac impulses of normalized amplitude where T m are the sets of random photon emission times distributed according to the proposed rate.Fig. 2(a) visualizes an exemplary modulation.

B. Linear Multipath MIMO-Channel
Photons are supposed to be propagating with constant speed c on straight-lines ( rays) through space -primarily from the source to an object and back to the associated detector.In this optimal scenario, the measured time-of-flight can be uniquely associated to the distance of interest via c.The generalization to a Multi-Input-Multi-Output channel comes with allowing any path between any laser and any detector.Additionally, the propagation delay may fluctuate randomly, which resembles a multi-path environment.Therefore, the time-of-flight for each path may be modeled as a random process Path losses on each individual link m → n manifest macroscopically as attenuations α mn and relate the average rate of photons reaching the detector to the average emission rate.Hence we introduce a mn (t) ∈ {0, 1} stating whether the channel allows a possibly emitted photon at time instance t to propagate from source m to detector n.More specifically, a mn (t) is the component of a random vector process a m (t) that is independently and identically distributed (i.i.d.) according to the probability mass function Thus the probability that the photon is absorbed by the channel (a m (t) = 0) is captured by α 0 .On the other hand, the emitted photon may be propagating from source m to detector n, such that the realization of a m is differing from the 0-vector only by a single one-entry at position n, captured above by the Kronecker-delta δ m,n .Additionally, each detector is exposed to background light that represents a noise contribution n n (t) with a corresponding rate that is assumed to obey also a Poissonian distribution.Hence, the final input signal for the n-th detector is

C. Correlation Based on Digital Counting
A digital counter is counting the detected photons and discriminating between an increment and a decrement based on the original binary reference signal p m (t) ∈ {0, 1}.The counting polarity is therefore the bipolar, transformed original codeword pulse: The counting operation ultimately facilitates a periodic correlation of the detected photon stream.More specifically, the counter is reset periodically after a time of LT c , and the counting operation is repeated with equidistantly lagged copies of the reference signal.The associated sampling time is chosen as a power-2-fraction of the chip-period (T s := 2 −ζ T c ).The sampled correlation thus reads where m denotes, which codeword is considered as reference for correlation at the detector.In the absence of noise, the counting result can be related to the periodic correlation of the original codeword pulses with the reference codeword pulse yielding (12) These superposed correlations ought to be related themselves to the discrete, periodic code-correlation θ between the used codewords in order to use well established results for the autoand cross-correlation properties available in literature [15], [16].Given the code correlation (13) the realized correlation through counting can be alternatively expressed by choosing the sampling time to T s = T c : Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
where the usual floor-operation x := arg max z∈Z {z ≤ x} has been used.So the above expression contains an offset depending on the code weight.However, if every code was perfectly balanced, i.e. w m != L/2, this offset would obviously vanish.Note also, that the aforementioned discrete code correlation is relying on bipolar signaled codewords instead of unipolar ones like OOCs.From that perspective, the polarity modulation in the counting process broadens the choice of codewords beyond unipolar ones.

D. Phase Estimation Algorithm
As mentioned in the beginning, the estimation of the timeof-flight is related to the estimation of the phase-delay of the correlation result giving rise to the indirect principle.Note that from this point on, perfect synchronicity of transmitter (modulated light source) and receiver (counter) is assumed.We employ a two-stage algorithm where the first step essentially resembles a simple peak detector coarsely determining the time-of-flight to the sub-sampled chip period T s = 2 −ζ T c .Given the coarse peak location we narrow our estimate by calculating the phase of the fundamental wave of the characteristic decorrelation triangle around the peak value using a Fast-Fourier-Transform (FFT): The chosen window size is directly defined by the sub-sampling time and thus also the phase resolution is determined.A successive combination of the two stages delivers the overall, estimated time-of-flight

E. Codes Selected for CDMA
The choice of suitable CDMA-sets is based on optimizing the quality of our estimated time-of-flight, requiring its deeper analysis.Firstly, the noisy part in the received signal may be split off as Making practical assumptions about the noise leads to the demand of approximately balanced codes minimizing systematic drift.Assuming this balancedness and neglecting noise from now on leverages (14), such that Therefore, our foremost goal is to construct a set of approximately balanced codes that share low mutual cross-correlation values, i.e.
in order to optimize the Signal-to-Interference-Ratio (SIR).Furthermore, a resolution of multipath propagation is sought, which can be equivalently formulated as the ability of discriminating between lagged arrivals of desired signals discussed in [17].This requires suppression of the side-lobes in the auto-correlation as much as possible, i.e.
is desired.Such a suppression in favor of high temporal concentration of the auto-correlation is also referred to as the pulsecompression property; the resulting auto-correlation exhibits a pulse-like shape.Additionally, candidates of (21) prove to be maximally a-periodic in the sense that the auto-correlation's smallest period happens to be exactly the length of the code.Then the unambiguously detectable range T 0 is solely determined by l max = cLT c .On top of the two presented objectives, a high cardinality of the code-set is desired to maximize the number of sensors being able to simultaneously access the channel.Fortunately, this task has been pursued for many times in the past, especially in the successful implementation of spread spectrum systems in telecommunications.A well suited code-set for above purposes represents Gold codes [18].Not only do they try to optimize the demanded correlation properties [15], they can easily be constructed on demand by Linear-Feedback-Shift-Registers (LFSRs).On top of that, nearly half of the Gold codes of equal length are off balance only by half a bit as they are of odd length L = 2 N − 1 in general [19].Now the question may arise whether maximum length LFSR sequences (m-sequences) sufficiently achieve the aforementioned objectives as do Gold codes for a specific length.Note however, that even though m-sequences exhibit optimal auto-correlation properties leading to optimal precision in the single access case, only few of them qualify in terms of their cross-correlation properties [18], [19].Gold codes on the other hand are not sparse in their existence per construction.Therefore, supporting a substantially high number of simultaneously working sensors clearly favors the decision Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
for Gold codes.So instead of modulating the lasers with trivial square waves, i.e. trivial (0, 1) codes of length L triv = 2, the choice fell on 11-bit Gold codes with L = 2 11 − 1, thus improving the detectable range by three orders of magnitude.Even further extension of detectable ranges then relies on applying longer Gold codes.

F. Interleaved Sequences
The previous goals aimed for during optimization have not yet been concerned with the precision of the fine estimation stage.There, the precision is greatly influenced by the power in the fundamental wave.Therefore, the amplitude of the decorrelation triangle, given by [1], is sought to be maximized.
This goal will be pursued by interleaving the codewords from the very same sets that optimize the aforementioned objectives, which will be referred to as the original codewords.Let where we call ν ∈ N the interleaving depth and we used c for binary negation of c.The first beneficial property is that the codes are balanced by construction, i.e. ∀ν ∈ N : To investigate further properties of such interleaved codes, a relation to the correlation of the original codewords can be found.Let ξ k := k/2 ν and η k := k mod 2 ν as well as η k := 2 ν − η k .Then the code correlation between two codes sharing the same interleaving depths can indeed be written in terms of the original codeword: The proof is given in Appendix B. This decomposition shows that the interleaving procedure did not change our optimization problem as the stated auto-and cross-correlation properties are conserved.Hence the selection of suitable CDMA-sets leads to the same conclusions as in the non-interleaved case.Under the assumption of a successful code-set search, such that the original codewords show low auto-correlation side-lobes, the interleaved codes show an increasing amplitude in the decorrelation triangle with increasing depth. (25) Note that we normalized the correlation to gain comparable results to those of the original codewords.So interleaved codes are finally supposed to increase the quality of our fine estimation stage without complicating the optimization criteria.The normalized decorrelation amplitude even converges to the one observed when the sources were trivially square-wave modulated.At this point it is noteworthy to say that the presented interleaving procedure can be equivalently described as a Binary-Phase-Shift-Keying (BPSK) modulation with a square-wave carrier at twice the chip frequency.However, an elaboration  in the code domain may better support the argumentation of optimality regarding feasible code sets.It shall be additionaly emphasized here, that the interleaving procedure is not targeting better multipath resolution, but it primarily improves precision through better phase estimation.

III. SIMULATIONS AND EXPERIMENTAL RESULTS
The aforementioned, detailed system description has been fully reflected in simulations that have been parameterized by the values shown in Table I.The simulated results serve a comparable basis for the outcomes of the related experiments.

A. Simulated Non-Idealities
The laser's power control ensuring fast transients from on-to off-states demands non-zero photon-generation rates during offstates.We capture this behaviour by introducing the extinction ratio ER relating the rate when turned on Φ 1 to the one when turned off Φ 0 by the modulation signal, i.e., ER := Φ 1 /Φ 0 .For the SPAD operation detection-, after-pulsing probability as well as detection jitter, delay, and quenching dead-time are considered similarly, statistically treated in [20].The impairments of the digital counter are subsumed by simulating non-ideal timing effects of the polarity modulation.Both for the measurements and the experiments a chip period of T c = 8 ns has been chosen sub-sampled by 2 ζ = 8 phase steps during the correlation.

B. Measurement Setup
The used measurement setup in Fig. 4 has been chosen to investigate both single-sensor and also multi-view scenarios.The lasers operate at visible wavelengths that differ quantitatively Fig. 4. Block diagram of the experimental setup.The dual-view channel is resembled by combining the light from two sources into one fiber-cable feeding the primary detector hardware (SPAD and correlator [4]).After calibration, the channel attenuation α 1 could be adjusted dynamically whereas the other ones stayed constant thus allowing indirect measurement of the optical power incident on the surface of the SPAD.For that purpose, the optical light power is directly measured by an external power meter where it is calibrated by a dedicated power meter in the dark box prior measurement.but represent arguably equal photon sources from a detection perspective with respect to the specifically used SPAD.The indoor lab environment is not suitable for time-of-flight measurements in the range of several kilometers achievable by long enough codes.Nevertheless, the corresponding time-of-flight can be emulated by individually feeding the laser controllers and the discussed polarity modulation input with differently delayed versions of the modulation signal.Then the shared channel is simplified to the extent of a short fiber where the sources are coupled into.The impairment of channel losses can be realized by additional post-attenuation of the sources, which is primarily targeted at varying the optical input power of the source onto the channel and successively for the SPAD.In order to achieve synchronicity, the binary modulation signals are generated in the very same LabVIEW-FPGA module (NI PXIe-7962R).The FPGA is embedded in a National Instruments PXIe-1062Q chassis, which is controlled by an NI PXIe-8133 controller where also the coarse peak-and fine FFT-phase-detector is implemented that operates on the sampled counter values.

C. Single-Sensor Precision
First and foremost of interest is to verify whether the precision achieved with the advanced Gold code modulation does not degrade substantially compared to the trivial square-wave modulation.Both measurements and simulations conducted for a single-sensor-scenario agree on an approximated degradation of 3.24 dB as shown in Fig. 5.This is due to the fact that Δ and hence proves the proposed major dependency of precision on the amplitude in the decorrelation triangle.However, still distance precision in the range of a few millimetres is achievable for a short integration time of ≈ 104.8 μs per phase step.As will be shown later in Fig. 8, by increasing the integration time to 1 ms the distance precision can be improved almost down to 1 mm.
If the Gold codes were now interleaved, the degraded precision compared to rectangular modulation can even be overcome as simulations in Fig. 6 illustrate.
A substantial improvement in precision is observed when going from non-interleaved codes to interleaved ones (ν = 1)   whereas further increases of the interleaving depth (ν > 1) do not significantly contribute to a better performance.This justifies the fast convergence proposed in (25).The simulated results also align with experimental data as a detailed view of the decorralation triangle in Fig. 7 shows, up to a constant gain factor.The immediate effect of the advanced coding scheme in increasing the decorrelation triangle's amplitude is evident and thus formerly lost precision can be recovered.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

D. Multiview
Adding the light from a second laser, which is either modulated with a trivial square-wave or with a Gold code drawn from the same set as a defined Source-of-No-Interest (SoNI) compared to the one of a Source-of-Interest (SoI) proves the multi-view capabilities.The achieved precision through fine phase estimation is added compared to the case without a second laser in Fig. 8 for a comparison to the single-sensor baseline.The small degradation in precision can be explained by the aforementioned distortion due to cross-correlation components.Additionally, the interferer adds noise similar to the noise contribution by background light.The measured correlation result is depicted in Fig. 9 where the same optical power has been set up for both sources.Albeit a distortion due to cross-correlation components is introduced by the active interferer, it quantitatively resides in the range of the side-lobs of the original auto-correlation part of the SoI-signal.Hence, the peak value could be confidently detected at a unique delay from a coarse estimation perspective.

E. Multipath Resolution
Another advantage of using DS-CDMA showcases a dualpath scenario emulated by both sources being simultaneously modulated with the same code.If the input powers are limited in such a way that the optical detector is not saturated, the correlation result represents indeed a superposition of timeshifted auto-correlation functions as recorded in the measured results in Fig. 10.What has been observed in detail is the  pulse-compression property of the codes enabling a discrimination of paths only hardly separated.Delays even as low as 1.5 T c , illustrated in Fig. 11, can be safely discriminated.In the particular case of having T c = 8 ns, this results in an absolute multi-path resolution of Δd ≈ 1.2 m whilst having an unambiguously detectable range of d max = LT c ≈ 2.45 km.

IV. CONCLUSION
The rich applicability of Gold codes has been proven for an indirect time-of-flight sensor with a highly sensitive SPAD detector.A further redesign of the modulation and coding scheme in terms of interleaving has been proposed to reach the superior values of precision under low optical light powers that were already achieved with trivial square wave modulation.At the same time, the unambiguously detectable range could be systematically increased by three orders of magnitude when using 11-bit Gold codes.The multi-access capabilities have been demonstrated with a dual-view scenario and a successful discrimination of multi-path propagation.Let u (ν) , v (ν) be some arbitrary, binary ν-fold interleaved codewords stemming from the original codewords u, v ∈ F L 2 .Then the discrete correlation yields where we quietly assumed proper operation for the concerned indices which shall be implicitly done from here on.As η k + η k = 2 ν is given per definition, the inner sum may be separated accordingly as

Fig. 1 .
Fig. 1.Block diagram of the iToF measurement system with M sources (lasers) and N sinks (detectors) accessing the very same channel.

Fig. 3 .
Fig. 3. Discrete correlation results for original gold-and interleaved-code of length L = 2047.The right hand side shows a zoomed version to illustrate the different amplitudes in the decorrelation triangles.

Fig. 5 .
Fig. 5. Measured and simulated results of the standard deviation derived from 100 samples at different optical input power levels for the considered modulation schemes.The total correlation time per phase step was T corr = 104.8μs.

Fig. 6 .
Fig. 6.Simulated results of the standard deviation at different optical input power levels for different interleaving depths where the total correlation time was T corr = 209.608μs per phase step.

Fig. 7 .
Fig. 7. Simulated correlation results for interleaved Gold code with depths ν ∈ {0, 1, 2} used in a single-sensor scenario (left) as well as the corresponding experimental results (right).Integration time per phase step was T corr = 1.04 ms.

Fig. 8 .
Fig. 8.Comparison of multi-view and multi-path measurements (two sources) with a measurement with only one active source.Total correlation time per phase step was T corr = 1.04 ms.

Fig. 9 .
Fig. 9. Measured correlation results in a dual-view scenario with varying timeof-flights of the source-of-interest.The second interfering source is delayed and has been modulated by a different Gold code stemming from the same set.Average taken over 100 samples at correlation time T corr = 1.04 ms.

Fig. 10 .
Fig. 10.Measured correlation results of a dual-path scenario at varying timeof-flights/distances of the primary path.Average taken over 100 samples at correlation time T corr = 1.04 ms.

Fig. 11 .
Fig. 11.Average correlation results for distinct multipath-delays measured in phase steps Δk relative to the intersection point where Δk = 0.The granularity in the time-of-flight related to each phase step is of course Δt ToF = ΔkT s .An average has been taken from 100 samples at T corr = 1.04 ms.

χχχ
APPENDIX ALet c m , c m ∈ F L 2 be some arbitrary binary codeword pair of length L. This codewords are used upon modulation to produce the single codeword-pulses p m (t), p m (t) resulting in Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.their periodically continued modulation signals s m (t), s m (t) respectively.The introduced discrete code-correlation θ c m ,c m [i] may be then related to the continuous correlation as θ c m ,c m [k] = L i=0 χ (c m ,i ) χ c m,(k+i) mod L (p m (τ )) χ (s m (kT c +τ )) dτ (p m (τ )) (2s m (kT c +τ ) − 1) (p m (τ )) s m (kT c +τ )dτ − 2w m + L.