# Design of a Baseband Signal for the 406 MHz Satellite Emergency Radio Transmitter Based on STM32
## 1 Introduction  
The COSPAS-SARSAT system [1; 2], which consists of space segment and ground segment, provides a distress alert and the position information for a distressed ship or person with beacon equipment [3; 4; 5; 6]. The second generation 406 MHz beacon allows for the coding of position data in the transmitted 406 MHz message, thus providing for quasi-real time alerts and position information from the GEOSAR system [7; 8]. The baseband signal coding of the 406 MHz COSPAS-SARSAT emergency beacon includes the information bit coding and the BCH error correcting coding. As a classic cyclic code with error-correcting ability, the BCH code is widely used in traditional communication, quantum communication, optical fiber communication and storage fields [9; 10; 11; 12]. In 2016, [PERSON], [PERSON] et al. designed an improved 8b/10b coding structure to meet the current coding requirements of high-rate and low-bit error rate and introduced the BCH coding module into the 8b/10b encoder to reduce the bit error rate of the system, so as to improve the reliability of data transmission in a digital communication system [13]. However, this coding is mainly for the BCH (7, 4) code, which contains only a few information bits. In 2022, [PERSON], [PERSON] et al. proposed an optimized structure of BCH code based on the RTL platform [14], which can process 16-bit data in parallel per clock cycle during encoding and decoding operations. While in 2023, [PERSON], [PERSON] et al. presented an efficient BCH code encoding and decoding algorithm of STT-MRAM polynomial division based on division distance [12], which can effectively improve the efficiency of BCH coding. Using this algorithm, the BCH (63, 51) and BCH (127, 106) coding calculations can be completed in 1.2 microseconds and 1.3 microseconds, respectively. In general, the linear feedback shift register [14; 15; 16; 17] is employed to complete the BCH coding, but this method relies heavily on FPGA or other special hardware unit circuits. Compared with the powerful real-time data processing ability of FPGA, MCU, which focuses on industrial control, is more suitable for baseband signal coding. In addition, in terms of cost, MCU is also superior to FGPA. This paper performed a baseband signal generation of the 406 MHz COSPAS-SARSAR transmitter based on STM32 microcontroller with low power consumption and high performance. Compared with the optimization structure of BCH code based on RTL proposed by [PERSON] et al., the proposed code based on STM32 can process 32-bit data in parallel. Compared with the BCH coding algorithm proposed by [PERSON] et al., which is applied to the field of STT-MRAM with microsecond-level coding efficiency, the BCH coding algorithm proposed in this paper is a BCH coding algorithm with millisecond-level coding efficiency applicable to COSAS-SARSAT transmitter. In order to improve the coding efficiency of the baseband signal for the 406 MHz transmitter in the STM32 microcontroller, this paper proposed a calculation method for first BCH error-correcting coding (BCH-1) and second BCH error-correcting coding (BCH-2) of the COSPAS-SARAST transmitter. First, conduct the data coding process by 64-bit integral data; then, compute the BCH (127, 106) code and the BCH (63, 51) code to obtain the respective error-correcting codes for improving the coding rate; next, generate the baseband signal according to the GB 14391-2021 coding format; finally, modulate the baseband signal into a 406 MHz-RF signal, send it out and complete the task of distress alerting. The experimental results show that the proposed STM32 microcontroller-based baseband signal generation method is effective, and the EPIRB (Emergency Position Indicating Radio Beacon) designed based on this method has reached the industry standard. The structure of this paper is as follows. Section 2 describes the coding rules for the 406 MHz emergency beacon. Section 3 analyzes the generation details of the baseband signal for COSPAS-SARSAT transmitter.