## 4 Experimental Results  
To verify the correctness of the improved particle swarm optimization results, the optimized cubic phase mask is used in an actual wavefront coding system for DoF extension experiments. The optimized result 90.23 is taken as the cubic phase mask parameter in the experiment. Note that the cubic phase mask parameter is optimized in normalized coordinates. Taking 90.23 as an example, the maximum phase modulation at the edge of the pupil, i.e., \(x=\pm 1\), is 90.23 according to Equation (1). A spatial light modulator (SLM) is used to generate a cubic phase mask with a size of 15.36 mm \(\times\) 8.64 mm. Assuming that the maximum phase modulation at the long edge remains unchanged, the cubic phase mask parameter of the actual system can be converted to 0.20, which is the actual phase mask parameter used in the experiment. The two-dimensional cubic phase mask \(f(x,y)\) can be described as  
\[f(x,y)=\alpha\Big{(}x^{3}+y^{3}\Big{)} \tag{7}\]  
where \(x\) and \(y\) are the coordinates of the phase mask. Let the center of the cubic phase mask be the origin of the coordinates, then the range of values of \(x\) and \(y\) are \(-7.68\) mm \(\leq x\leq 7.68\) mm and \(-4.32\) mm \(\leq y\leq 4.32\) mm, respectively. The pupil function, which ignores all optical aberrations but defocus, can be described as  
\[p(x,y)=\exp\Big{[}\mathrm{j}\Big{(}f(x,y)+\phi\Big{(}x^{2}+y^{2}\Big{)}\Big{)} \Big{]} \tag{8}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Avg** & **Var** & **Average Time/s** \\ \hline \(D=20;I=100\) & 90.19 & \(2.14\times 10^{-2}\) & 3.97 \\ \(D=10;I=100\) & 90.07 & \(6.61\times 10^{-2}\) & 1.97 \\ \(D=30;I=10\) & 89.42 & 1.00 & 0.64 \\ \(D=30;I=100\) & 90.23 & \(7.40\times 10^{-3}\) & 5.900 \\ \(D=10;I=10\) & 87.64 & 7.73 & 0.22 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The influence of the population of particles and the number of iterations on the improved PSO. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Avg** & **Var** & **Average Time/s** \\ \hline \(T_{\text{max}}=10^{2};T_{\text{min}}=10^{-12}\) & 89.89 & 0.16 & 58.67 \\ \(T_{\text{max}}=10;T_{\text{min}}=10^{-12}\) & 89.81 & 0.26 & 58.86 \\ \(T_{\text{max}}=10^{3};T_{\text{min}}=10^{-1}\) & 18.16 & \(2.72\times 10^{2}\) & 8.29 \\ \(T_{\text{max}}=10^{3};T_{\text{min}}=10^{-6}\) & 88.22 & 3.67 & 31.74 \\ \(T_{\text{max}}=10;T_{\text{min}}=10^{-1}\) & 16.96 & 2.53 & 8.27 \\ \hline \hline \end{tabular}  
* The data in Table 5 are based on \(r=0.9\) and \(K=100\). This method is based on reference [5].  
\end{table} 
Table 5: Influence of the maximum temperature and the minimum temperature on SA. where \(\phi\) is the defocus aberration and j is the imaginary unit. Figure 4a shows a three-dimensional plot of the actual cubic phase mask, with the x and y axes corresponding to the spatial coordinates, respectively, and the z axis indicating the phase. Its corresponding contour map of the surface of the cubic phase mask is shown in Figure 4b. Figure 5 shows a DoF extended wavefront encoding system, where the light diffusely reflected from the object passes through the polarizer (P) and arrives at the spatial light modulator (SLM) after being reflected by the beam splitter (BS). The light, which is modulated by the SLM, passes through the BS and is imaged on the camera by the lens. P works in conjunction with SLM to achieve cubic phase modulation. A tilted ruler is used as a large DoF object, as shown as the object of Figure 5.  
The measured PSFs are almost identical at defocus amounts of 0, 15, and 30, and the focused PSF is given in Figure 6.  
Figure 4: The profiles of the cubic phase mask used in the experiment: (**a**) three-dimensional cubic phase mask; and (**b**) the contour map of the surface of the cubic phase mask.