In some embodiments, each ultrasonic transducer or group of ultrasonic transducers may be controlled using a determined optimum ToF, where the measurement window is shifted in time according to the optimum ToF. The width of the measurement window may be adapted to the received signal and the variation in the ToF over the selected transducers. The larger the number of transducers that are combined, the higher the possibility that there is a variation of the ToF, and therefore the wider/longer the size of the integration window. A distribution of the optimum ToF values may be determined, and the applied setting may be chosen to comprise a predefined portion or percentage of the distribution. In one embodiment, only a single measurement window size is used, and the ToF investigation is used to determine what the variation in ToF across the sensor surface is, and then the window size is adapted accordingly to capture the desired signal or depending on the ToF distribution.