# Ultrasonic Through-Metal Communication Based on Deep-Learning-Assisted Echo Cancellation
## 2 Materials and Methods
### Implementation of Signal Transmission  
Each module in the aforementioned communication system was actually constructed with the means of hardware or software for the signal transmission experiment. Figure 7 illustrates the constructed signal transmitting side, which utilizes a field programmable logic gate array (FPGA, EP4 CE10F17C8, Cyclone IV E) as its core unit. The FPGA contains two image acquisition methods: camera and data interface, and generates a carrier wave with its numerically controlled oscillator (NCO). After image data are collected by the FPGA, they undergo sequentially SDRAM buffering, parallel-serial conversion, and ASK digital modulation. Since the output signals of the FPGA are digital, a DA circuit is applied to carry out the digital-to-analog conversion. Converted signals further experience bandpass filtering to remove out-of-band noise and their amplitude is increased by an amplification circuit. Finally, the ultrasonic transmitting transducer is driven to transmit ultrasonic signals into the metal channel.  
As depicted in Figure 8, the signal-receiving side is actually constructed with an amplification circuit, an AD conversion circuit, and a personal computer (PC). After the received signals pass through amplification and AD conversion circuits, they are captured by an oscilloscope and then sent to the PC. Within the PC, signals are treated with two routes of echo cancellation. One route is called LMS adaptive filtering which is built with Matlab. Another one is DPRNN processing which is established with Python. The implementation of ASK demodulation, serial-parallel conversion and image restoration are also performed on the PC.  
A photo of the constructed ultrasonic communication system is shown in Figure 9. It is noted that data were simultaneously collected at two sites of the transmitting transducer and AD conversion circuit with the oscilloscope, denoted as \(S_{T}(t)\) and \(S_{R}(t)\), respectively. The carrier frequency \(f_{c}\) was set as 10 MHz, while the sampling frequency \(f_{s}\) was set as 50 MHz, and the transmission rate was kept at 2 Mpbs. Continuous data sampling was conducted for a duration of 1.2 s, producing 60 million data points at each signal collection site. As for the DPRNN route of echo cancellation, the data streams \(S_{T}(t)\) and \(S_{R}(t)\) were, respectively, partitioned into 20,000 segments, with each segment containing 3000 data points. By grouping together corresponding data segments from \(S_{T}(t)\) and \(S_{R}(t)\) that were captured simultaneously, a total of 20,000 data sets were formed.  
Figure 7: Actual construction of the signal transmitting side.  
The training of the LMS adaptive filter and DPRNN model was conducted on a PC equipped with a Geforce MX450 (2G) graphics card. The DPRNN model was developed based on the PyTorch deep learning framework, utilizing Python interpreter version 3.8. Signals captured from the transmitting transducer served as source signals, and were used as the labels for the model; signals captured from the receiving transducer contained echoes and noise. The data treated with echo cancellation of LMS and DPRNN were signed as \(S_{LMS}(t)\) and \(S_{DPRNN}(t)\), respectively.