## 2 Design of Matrix-Type Coding Metasurface  
### Matrix-Type Random Coding Theory and RCS Reduction Analysis  
Based on the principle of reflective antenna array, a series of random coding MSs with different combinations are designed. The incident wave can be diffusely reflected through the design of the array MS [43; 44; 45]. According to \"energy conservation law\", an effective RCS reduction under normal incidence can be achieved by enhancing the EM energy scattering at other direction. Assuming the surface is composed of A \(\times\) B array elements, each array element consists of two basic elements: \"0\" and \"1\". The concept of RCS reduction can be explained by the principle of planar array theory [46]. Under normal incidence, the array factor of MS can be expressed as:  
\[AF=\sum_{a=1}^{A}\sum_{b=1}^{B}e^{i[(a-1/2)(kd\sin\theta\cos\varphi)+(b-1/2)( kd\sin\theta\sin\varphi)+\phi(a,b)]} \tag{1}\]  
where \(\theta\) and \(\varphi\) are the angles of elevation and azimuth, \(k=2\pi/\lambda\), \(d\) is the distance between the basic elements, and \(\phi(a,b)\) is the initial phase of the lattice. In our design, the characteristic of cross-polarization reflection phase difference of 180\({}^{\circ}\) can be achieved by rotating the basic unit simply, which avoids the complex design of structure size and arranges the MS in a simple and effective way. A matrix-type random coding way is proposed to design 2-bit coding MS, and the coding flowchart is shown in Figure 1. The basic units of \"0\" and \"1\" are placed in the matrix with a fixed ratio. In the case of \"0\" and \"1\" with same number, the co-polarization reflection phase difference is 0\({}^{\circ}\) and the cross-polarization reflection phase difference is 180\({}^{\circ}\). Therefore, the cross-polarization component of the scattered field can be effectively canceled; leading to a better RCS reduction effect than the traditional random coding MS (the probability of \"0\" or \"1\" is 50% in each matrix unit). If the number of units \"0\" and \"1\" is not consistent, the cross-polarization component of the scattered field cannot be effectively canceled, leading to a suppression of RCS reduction. A simulation is presented to verify this assumption. Matrix-type random coding mode \(M_{random}\) for Matlab calculation can be expressed as the following functional form:  
\[M_{random}=round\left\{\text{mod}\left[\sum_{i=1}^{N}kron\left(rand(2^{i}),ones(2 ^{N-i})\right)\right],1\right\} \tag{2}\]  
where \(rand(2^{i})\) and \(ones(2^{N-i})\) represent the numbers of block matrix \(2^{i}\times 2^{i}\), each block matrix composed of \(2^{N-i}\times 2^{N-i}\) is the same random number. The \"\(kron\)\" is matrix multiplication, where the Kronecker product A, B represents the larger matrix formed by the product of all the elements of matrix A and B. The open interval range of random number is (0, 1). The step to obtain the random coding pattern of the MS is as follows: Firstly, the number of different random matrices in the range of (1, \(N\)) is counted. Secondly, the number of patterns is calculated. Finally, the random numbers (0 and 1) are added to the discrete binary codes \"0\" and \"1\", and a random coding matrix is obtained through the operation flow chart. Based on the results of simulation and optimization, we choose \(i=6\) and \(N-i=5\) to satisfy the preparation and measurement of sample. Therefore, the designed MS consists of a 6 \(\times\) 6 supercell, with each supercell consisting of \(5\times 5\) basic units.