# 6G Technology for Indoor Localization by Deep Learning with Attention Mechanism
## 2 Channel Modeling and Indoor Positioning System  
In the channel model, the ray-tracing method is used to calculate the frequency response of 6G terahertz communication. (1) is the frequency response, and its equation is expressed as  
\[H(f)=\sum_{i=1}^{J}\alpha_{i}(f)e^{i\varphi(f)} \tag{1}\]  
where \(J\) is the total number of paths, \(f\) is the frequency, \(i\) is the path index of the ray, \(\alpha_{i}\) is the i-th amplitude, and \(\varphi\) is the phase shift delay equation described in [29]. To calculate the frequency response using the SBR technique, we try high-frequency radio waves in complex indoor environments by triangular ray tubes rather than individual rays [30; 31; 32; 33]. The process begins by creating an icosahedron composed of 20 identical equilateral triangles. Each triangle is further subdivided into smaller equilateral triangles and then projected onto a sphere to form ray tubes with vertices defined by these projections. As each ray tube interacts with the environment, we determine if the receiver is within a reflected ray tube. If so, the contribution of the ray tube to the receiver's signal will be modeled as coming from an equivalent source. Once a ray tube has checked the receiver's position, it examines whether the ray encounters an obstacle. If there's an obstacle, an assessment will be made to determine whether the interaction is a transmission or a reflection. If it is a reflection, the reflection bounce count will be increased by 1, and the newly generated reflected ray will be added to the stack. If it's a transmission, the newly computed transmitted ray will be added to the stack without incrementing the reflection bounce count. The next ray tube is then popped from the stack for further tracing. This process continues until the ray tube's reflection bounce count exceeds the maximum allowed reflections. The iterative process continues until the stack is empty, signifying the completion of all ray tube tracing and the finalization of the results. Each ray tube's contribution is analyzed, including wedge diffraction effects, which are also attributed to corresponding images. By leveraging these images and their contributions, we can determine the channel's frequency response \(H(f)\), and other parameters, such as amplitude \(\alpha_{i}\) and phase shift \(\varphi\). The environment in the SBR/Image method is constructed from various triangular patches. After setting up the environment, we specify the positions, types, radiation patterns, and frequency for both the receiving and transmitting antennas. We also determine the maximum number of reflections (bounces). A higher number of transmitted rays leadsto more accurate statistical results, although it increases computing time. Similarly, the number of reflection bounces will also affect computation time. In our simulation, reflections are limited to six bounces to capture a realistic portion of detectable rays, while diffraction is restricted to a maximum of one instance due to significant power attenuation after the first diffraction. The carrier frequency is set at 120 GHz with a bandwidth of 14 GHz. A three-dimensional coordinate system is used, where the origin \(O\) is the reference point, the x-y plane represents the horizontal plane, and the positive z-axis represents the height above the ground. Figure 1 illustrates the overall framework of the proposed indoor positioning terahertz (THz) wireless system. The system consists of several key components that work sequentially to estimate the position within an indoor environment. Each component's output is essential for the next step, ultimately leading to accurate indoor positioning. The CSI data are composed of 30 frequency responses and three transmitters. In other words, the input data are two-dimensional 30 \(\times\) 3 forms that are converted into an image for CNN input. We have measured the CSI 200 times for each receiver at each noise level, resulting in a dataset of 57,800 (289 \(\times\) 200) CSI samples for 289 receiving antennas.