A non-transitory computer-readable storage medium storing a program to be executed by a device, the program including instructions for:
- generating, by a multi-phase locked loop of the device, a plurality of clock signals each having an identical clock period and a different phase;
- selecting, by a multiplexer of the device and in response to a first phase selection signal, a first clock signal from the plurality of clock signals, the first clock signal having zero phase;
- selecting, by the multiplexer and in response to a second phase selection signal, a second clock signal from the plurality of clock signals, the second clock signal having a first delay relative to the first clock signal, the first delay comprising a fraction of the clock period;
- generating, by a time generation circuit of the device, a first timing signal and a second timing signal for an optical emitter of the device based on the first clock signal and the second clock signal, respectively, wherein the second timing signal is delayed relative to the first timing signal by the first delay;
- emitting, by the optical emitter and in response to the first timing signal, a periodic optical pulse having an optical period for a first plurality of optical periods, wherein the optical period comprises a plurality of clock periods, and wherein each optical pulse in the first plurality of optical periods coincides in time with a triggering edge of the first clock signal;
- emitting, by the optical emitter and in response to the second timing signal, the periodic optical pulse having the optical period for a second plurality of optical periods, wherein each optical pulse in the second plurality of optical periods coincides in time with a triggering edge of the second clock signal;
- generating, by a sensor array of the device and in response to reception of a reflection from an object of the periodic optical pulse for the first plurality of optical periods, a respective plurality of first sensor signals for each of the first plurality of optical periods;
- generating, by a processor of the device, a respective non-overlapping portion of a first histogram indicative of a distance between the object and the optical emitter based on the respective plurality of first sensor signals, the first histogram having a first time granularity;
- generating, by the sensor array and in response to reception of a reflection from the object of the periodic optical pulse for the second plurality of optical periods, a respective plurality of second sensor signals for each of the second plurality of optical periods;
- generating, by the processor, a respective non-overlapping portion of a second histogram indicative of the distance between the object and the optical emitter based on the respective plurality of second sensor signals, the second histogram having the first time granularity;
- and
- generating, by the processor, a final histogram having a second time granularity finer than the first time granularity based on the first histogram and the second histogram.