described embodiment requires a different number of diffracted beams to produce different gray codes this means that the power from one diffractive element 14 is distributed over several photo detectors 18 while another diffractive element may distribute the same power on only one photo detector this arrangement may lead to difficulties in setting proper detection thresholds in processing unit 20 for very high sampling rates gt 100 giga samples per second and high resolutions n gt 10 fig3 illustrates another embodiment of an apparatus in accordance with the present invention that avoids this potential problem in the embodiment of fig3 the number of photo detectors in set 18 has been doubled the upper 3 photo detectors detect the actually desired gray code while the lower 3 photo detectors detect its 2 complement 1 bits replaced by 0 bits and vice versa with this arrangement each diffractive element 14 will always produce 3 beams n beams in the general case when impinged by a deflected laser beam this will guarantee that each gray code is detected in the same way and reduce the probability of erroneous decoding of the photo detectors fig4 11 illustrate the behavior of the embodiment of fig3 for different analog input signal amplitudes these figures illustrate the beam bundles that are produced for all the possible 8 quantization levels it is noted that each diffractive element produces a 3 beam pattern as stated above it is.