1. A method comprising: (a) during a time period, using a light source to illuminate a scene; (b) during the time period, using a light sensor to capture data about light that scatters from the scene; (c) during the time period, for each respective pixel in a set of pixels in the light sensor, applying a set of electrical reference signals to subregions of the respective pixel, such that (i) each respective reference signal in the set of electrical reference signals is applied to a respective subregion of the respective pixel to modify gain of the respective subregion, and (ii) the respective reference signals in the set of reference of electrical reference signals differ from each other in phase; and (d) using one or more processors to calculate a full cross-correlation function for each respective pixel out of the set of pixels, by fitting light intensity measurements to a curve, the light intensity measurements being taken, respectively, by respective subregions of the respective pixel; in which method (i) the light source emits a superposition of multiple modulation frequencies during at least a portion of the time period, or (ii) the light source emits (A) a first modulation frequency, but not a second modulation frequency, during a first portion of the time period, and (B) the second modulation frequency, but not the first modulation frequency, during a second portion of the time period.