A method for configuring a device to correct the effect of a medium on a light signal having propagated through said medium, said device comprising at least one optical element a plurality of optical elements whose spatial phase profile is individually adjustable, said method comprising the following steps:
- propagating a first light signal through said medium, said propagating step providing a disordered signal;
- propagating said disordered signal through said device the optical elements;
- propagating a second light signal, called reference signal, through said device the optical elements in a propagation direction opposite to a propagation direction of the disordered signal, said reference signal being identical to said first signal to generate an interference signal between said disordered signal and said reference signal;
- optimizing interference between said disordered signal and said reference signal, said optimizing step comprising the interference signal by repeating at least one iteration of the following steps for at least one optical element:
- measuring at least one interference parameter between said disordered signal and said reference signal of the interference signal;
- and
- modifying the phase profile of at least one optical element depending on said interference parameter.