## 3 Preliminaries
### Reconfigurable Intelligent Surfaces
#### 3.1.1 RSSI Calculation in RIS-Enhanced Environments  
The DeepMIMO dataset [38] for evaluation in this paper does not provide RSSI values, thereby we cannot directly build fingerprints for experiments. Hence, this section elaborates on the RSSI calculation method in RIS-enhanced environments using channel matrices among BSs, DOI, and the RIS given by the DeepMIMO.  
Figure 3: Different beamforming directions given different codewords.  
Figure 2: RIS behaviors: anomalous reflection (including specular reflection) and focusing.  
To calculate the RSSI measured by DOI, a common practice is to apply a link budget model, which describes all power gains and losses during the whole signal transmission process [69]. In general, the power gains (dB) \(G_{p}\) come from transmitter output power and transmitter/receiver antenna gain, whereas the power losses mainly include transmitter/receiver losses (dB) \(L_{p}\) and path loss (dB) \(PL\)[70]. Then, applying a similar link budget model in [71], we have  
\[\text{RSSI(dB)}=G_{p}-L_{p}-PL.\]  
The values of \(G_{p}\) and \(L_{p}\) are usually given in the device documentation. To calculate \(PL\), we first assume that the RIS only affects the phase shifts, which means there is no loss in the amplitude of the incident signals. Next, our path loss model works in a MIMO-OFDM system with \(K\) sub-carriers, containing a BS with \(P\) antennas, a DOI with \(Q\) antennas, and an RIS with \(M\) elements. For the sub-carrier \(k\), the channel matrices of the direct link \(\mathbf{H}_{DL,k}\in\mathbb{C}^{Q\times P}\) (from the BS to the DOI) and the RIS-assisted link, including \(\mathbf{H}_{BR,k}\in\mathbb{C}^{M\times P}\) (from the BS to the RIS) and \(\mathbf{H}_{RD,k}\in\mathbb{C}^{Q\times M}\) (from the RIS to the DOI), are provided by the DeepMIMO dataset. Figure 5 depicts the scenario we consider for path loss calculation. According to [72], for all \(K\) sub-carriers, the channel matrix of the direct link \(\mathbf{H}_{DL}\in\mathbb{C}^{Q\times P}\) is just the sum of all sub-carrier components; i.e.,  
\[\mathbf{H}_{DL}=\sum_{k=1}^{K}\mathbf{H}_{DL,k}.\]  
As defined in [73], given the codeword \(\psi\in\mathbb{C}^{M\times 1}\), the channel matrix of the RIS-assisted link \(\mathbf{H}_{RL}\in\mathbb{C}^{Q\times P}\) over all \(K\) sub-carriers is calculated as:  
\[\mathbf{H}_{RL}=\sum_{k=1}^{K}\mathbf{H}_{RD,k}diag(\psi)\mathbf{H}_{BR,k},\]  
where \(diag(\psi)\) is the diagonal matrix with the entries of \(\psi\) on its diagonal. Note that the codeword \(\psi\) is the same for all \(K\) sub-carriers. Finally, using the method described in [31; 35], the path loss \(PL\) in decibels from the BS to the DOI in this model is  
\[PL(\text{dB})=10\log_{10}|\mathbf{H}_{DL}+\mathbf{H}_{RL}|^{2}=20\log_{10}| \mathbf{H}_{DL}+\mathbf{H}_{RL}|,\]  
where \(|\cdot|\) means the complex magnitude. Finally, combining these formulas, we can calculate the RSSI of BSs for a DOI using the DeepMIMO dataset.  
Note that we do not need this RSSI calculation step in real-world deployments, since we can directly access the RSSI values using users' devices, such as mobile phones. We emphasize that our fingerprint-based method has no dependencies on accurate field measurements. The experiments in this paper rely on simulation using the DeepMIMO because RIS hardware is currently rare. There are only a few prototypes throughout the world [66; 67; 68]. Hence, collecting real-world data through experiments is hardly possible at present.  
Figure 4: A sketch map illustrating an RIS manipulating reflection angles in two dimensions.