A method for processing a histogram output from a photosensitive sensor, the method comprising: receiving, from a phase weighted filter, the histogram output as filtered histogram data comprising a plurality of histogram bin values indicative of a number of photodetection events, the filtered histogram data comprisng a pulse waveform with a defined width and histogram bin position; calculating a median point of the pulse waveform within the histogram, the pulse waveform having an even probability distribution over at least one quantisation step of the histogram around the median point; and determining from the filtered histogram data and based on the median point at least one object range associated with the pulse waveform, wherein the phase weighted filter is a three-part window comprising a first part (A), a second part (B), and a third part (C), and calculating the median point of the pulse waveform within the histogram comprises: generating a first difference value based on the sum of the first part, the second part and a negative third part; generating a second difference value based on the sum of the second part, the third part and a negative first part, wherein, for at least one histogram position, the first difference value and the second difference value are greater than zero, the determined median point is given by 0.5 + ((the third part value - the first part value) / (2 * (the second part value - a determined ambient value))). receiving, from a phase weighted filter, the histogram output as filtered histogram data comprising a plurality of histogram bin values indicative of a number of photodetection events, the filtered histogram data comprisng a pulse waveform with a defined width and histogram bin position; calculating a median point of the pulse waveform within the histogram, the pulse waveform having an even probability distribution over at least one quantisation step of the histogram around the median point; and determining from the filtered histogram data and based on the median point at least one object range associated with the pulse waveform, wherein the phase weighted filter is a three-part window comprising a first part (A), a second part (B), and a third part (C), and calculating the median point of the pulse waveform within the histogram comprises: generating a first difference value based on the sum of the first part, the second part and a negative third part; generating a second difference value based on the sum of the second part, the third part and a negative first part, wherein, for at least one histogram position, the first difference value and the second difference value are greater than zero, the determined median point is given by 0.5 + ((the third part value - the first part value) / (2 * (the second part value - a determined ambient value))). generating a first difference value based on the sum of the first part, the second part and a negative third part; generating a second difference value based on the sum of the second part, the third part and a negative first part, wherein, for at least one histogram position, the first difference value and the second difference value are greater than zero, the determined median point is given by 0.5 + ((the third part value - the first part value) / (2 * (the second part value - a determined ambient value))). <EOS>