## 3 Simulation Results and Analysis
### Influence of the Number of Iterations and the Population of Particles on the Improved PSO  
Tables 1 and 2 show the influence of the population of particles \(D\) and the number of iterations \(I\), respectively, on the improved PSO.  
As shown in Tables 1 and 2, the larger the population of particles \(D\) and the number of iterations \(I\), the more stable the optimal solution will be, and the less likely it is that the improved PSO will fall into the local optimal solution. However, the optimization process takes more time. Therefore, it is necessary to select a balance between computational efficiency and optimal solution stability, which can be easily found in the data in the fourth row of Table 2: the average value of the cubic phase mask parameter is 90.23 when the number of particles \(D=30\) and the number of iterations \(I=100\), and the variance is 7.40 \(\times\) 10\({}^{-3}\); the calculation time is only 5.90 s.  
Figure 2 shows the MTF curve of an ideal optical system at a different defocus aberration \(\phi\). As shown in Figure 2, the system establishes a clear image at the defocus aberration \(\phi=0\). With the increase in defocus aberration, the MTF curve of the system changes more obviously, the MTF value drops more rapidly, and a result of zero occurs, leading to losses of image information.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Population of Particles** & **Avg** & **Var** & **Average Time/s** \\ \hline \(D=1\) & 51.94 & 7.37 \(\times\) 10\({}^{2}\) & 0.19 \\ \(D=10\) & 90.06 & 7.15 \(\times\) 10\({}^{-2}\) & 2.05 \\ \(D=20\) & 90.20 & 1.15 \(\times\) 10\({}^{-2}\) & 3.86 \\ \(D=30\) & 90.23 & 7.40 \(\times\) 10\({}^{-3}\) & 5.90 \\ \(D=40\) & 90.25 & 5.61 \(\times\) 10\({}^{-3}\) & 7.71 \\ \hline \hline \end{tabular} The data in Table 1 are based on the number of iterations \(I=100\).  
\end{table}
Table 1: Influence of the population of particles on the improved PSO.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Number of Iterations** & **Avg** & **Var** & **Average Time/s** \\ \hline \(I=10\) & 89.35 & 0.76 & 0.63 \\ \(I=50\) & 90.16 & 2.79 \(\times\) 10\({}^{-2}\) & 2.91 \\ \(I=100\) & 90.23 & 7.40 \(\times\) 10\({}^{-3}\) & 5.90 \\ \(I=150\) & 90.25 & 4.34 \(\times\) 10\({}^{-3}\) & 8.82 \\ \(I=200\) & 90.27 & 1.41 \(\times\) 10\({}^{-3}\) & 11.60 \\ \hline \hline \end{tabular} The data in Table 2 are based on the population of particles \(D=30\).  
\end{table}
Table 2: Influence of the number of iterations on the improved PSO.  
The optimized result 90.23 in the fourth row of Table 2 was taken as the cubic phase mask parameter, and this cubic phase mask was added to the ideal optical system in Figure 2. As shown in Figure 3, after optimizing the phase mask parameter obtained by the improved PSO, the MTF curves of the wavefront coding system under the different defocus aberrations are almost the same, and there are no zero points. This proves that the current system can achieve defocus insensitivity under different defocus aberrations, that is, realize the DoF extension of the current system. This also proves that the improved PSO can optimize a reasonable cubic phase mask parameter.  
Figure 3: The MTF curves of wavefront coding systems with the cubic phase mask.  
Figure 2: The MTF curve of an ideal optical system before adding the cubic phase mask.