# Beam Formation and Vernier Steering Off of a Rough Surface
## 2 Refocusing Reflected Light from an Intermediate Surface
### Materials and Methods
The metric used to measure the efficacy of the wavefront shaping algorithm was termed enhancement, \(\eta\), and is defined in Equation (1) as  
\[\eta\equiv\frac{I_{opt}}{\left<I_{ref}\right>}, \tag{1}\]  
which is the ratio of the optimized beam intensity over the averaged background speckle intensity [2]. Enhancement measures the improvement in selected directivity of energy similar to directional gain in antennas. The maximum enhancement for inverse diffusion with an SLM is proportional to the number of SLM segments used [2; 12]. There is an additional effect based on the number of allowed phase levels. Allowing more phase levels allows for greater phase resolution of the SLM phase masks and increases maximum enhancement [12]. Three algorithms were adapted from the existing literature. These algorithms were the partitioning algorithm (PA), the continuous sequential algorithm (CSA), and a genetic algorithm (GA) [3; 8]. The process of feedback in these iterative feedback-based wavefront shaping algorithms is to set a test phase mask on the SLM and to make an intensity measurement on the detector to calculate the resultant enhancement. A modification of  
Figure 1: Simplified focal plane setup used in reflective inverse diffusion experiments. Polarized, collimated light is expanded and incident on the SLM at a slight angle. Light reflected from the SLM is focused by lens \(L_{1}\) onto the scattering sample and reflected to the CCD. In the lab, the incident angle of the beam onto the SLM, denoted \(\theta_{SLM}\), was \(3.98^{\circ}\pm 0.01^{\circ}\), while \(Z_{1}=54\pm 0.5\) cm, \(Z_{2}=40\pm 0.5\) cm, \(f=400\) mm. the SLM phase mask creates a change in the enhancement, which has either increased or decreased the optimization of the phase mask. Each iteration begins with a current best guess for the SLM phase mask that is optimized to maximize enhancement. The algorithms select a sub-set of the phase mask's segments and apply different phase levels to that subset in an attempt to find a phase mask with higher enhancement than the current best guess. If any of the tested phase masks create higher enhancement than the current best guess, the best guess is updated. The iterative feedback-based wavefront shaping algorithms begin with initial unoptimized phase masks and iteratively modulate the phase of selected SLM segments while measuring the enhancement to find the ideal phase levels for the selected phase masks. The continuous sequential algorithm (CSA) modulates single SLM segments sequentially through the discrete range of allowed phase levels. In this experiment, only 15 phase levels were allowed, and the number of segments over which the SLM optimized were limited to \(32\times 32\). Pre-optimization of the CSA is performed by first running the algorithm on larger super-segments, beginning with a portion of the SLM into \(2\times 2\) segments and then \(4\times 4\) and continuing to divide the partitions until until the SLM is subdivided into \(32\times 32\) segments. In a noiseless system, the CSA would eventually converge on the true solution, but as the proportion of pixels being modulated decreases, relative intensity noise (RIN) of the laser obscures the intensity modulation caused by the modulation of selected SLM segments, degrading the ability of the algorithm to determine the optimal phase level for the segments. In the experiment, the segment size used by the CSA was \(16\times 16\) SLM pixels and the detector channel size was accordingly \(8\times 8\) pixels. The partitioning algorithm (PA) operates similarly to the CSA, except that in each iteration, it chooses a random partition of the SLM's segments instead of following a sequence. It cycles through the 15 allowed phase levels for all segments in the chosen partition simultaneously. Variations in the PA involve a decrease in the partition size as enhancement increases so that smaller and smaller changes are made. As in the CSA, RIN limits the effectiveness of the PA when small partitions are chosen.