# A Rectangular Toroidal Current-Based Approach for Lung Biopsy Needle Tracking
## 2 Materials and Methods
### Position Calculation Algorithm  
To determine the pose parameters of the receiving coil, a mathematical equation is formulated that establishes the relationship between the induced voltage and the coil's spatial position and orientation. Since this equation contains five unknowns, at least five independent equations are required to solve for the pose parameters. Each equation can be derived from the voltage induced by a distinct transmitting coil, meaning that a minimum of five transmitting coils is necessary to provide sufficient data for accurate localization. However, relying solely on five transmitting coils poses limitations due to the rapid attenuation of the magnetic field with distance, resulting in a constrained operational range that may be insufficient for lung biopsy procedures. To address this, the system employs a total of eight transmitting coils, each operating at a distinct frequency. This expanded coil configuration enhances the spatial coverage and signal robustness while mitigating localization errors caused by field inhomogeneities. Nevertheless, increasing the number of coils introduces additional complexities in signal separation, hardware calibration, and pose computation, potentially affecting system latency and real-time performance. Thus, the selection of eight coils represents a balance between accuracy, computational efficiency, and practical feasibility in medical applications. Considering these factors, this study employs a magnetic field emission board incorporating a total of eight transmitting coils, each operating at distinct frequencies. Four of these coils are positioned in a standard orientation, while the remaining four are rotated 90 degrees about the central axis. This strategic configuration not only optimizes the utilization of the available layout space but also enhances the uniformity and strength of the generated magnetic field within the designated working area, thereby improving the system's overall localization accuracy and stability. Since the sensor coil generates eight induced voltages caused by the transmitting coil currents when operating in an electromagnetic positioning system, the signal collected by the sensor is the sum of the eight induced voltages, as shown in Equation (13). \[v(t)=\sum_{i=1}^{8}V_{i}\mathrm{sin}\big{(}\omega_{i}t+\varphi_{V_{i}}\big{)} \tag{13}\]  
where \(V_{i}\) is the amplitude of each induced voltage component and \(\varphi_{V_{i}}\) is the phase of each induced voltage at the start of timing. At a given moment, when calculating the pose of the receiving coil based on the induced voltage, the acquired voltage signal is the superposition of the induced voltages generated by eight transmitting coils on the receiving coil. However, the required induced voltage corresponds to each transmitting coil individually. Therefore, it is necessary to extract the induced voltage corresponding to each transmitting coil. A commonly used method is to apply the Fourier transform algorithm to convert the acquired signal from the time domain to the frequency domain. In this study, the electromagnetic tracking system utilizes sinusoidal excitation signals, resulting in induced voltages that are also sinusoidal. Consequently, Fourier transform can be effectively employed to accurately obtain the frequency domain information of the sinusoidal components within the acquired voltage signal. By analyzing the frequency spectrum, the voltage amplitude corresponding to each specific frequency can then be determined. Both the transmitting coil current and the sensing coil are demodulated using the Fourier transform, as described in the synchronous demodulation method described inthe previous section. The amplitude and phase of the transmitter coil current and sensor coil-induced voltage can be obtained as follows:  
\[\left\{