STM32 and Raspberry Pi-based underwater acoustic modem

CN117714254BActive Publication Date: 2026-08-14TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-25
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]采用数字信号处理芯片DSP的调制解调器,成本高,开发难度大,与系统的兼容性相对较差;采用无线电架构的基于软件定义的调制解调器硬件成本高,能耗高,不适合在水下通信网络中部署;现有的多数调制解调器无法同时保证通信距离以及误码率

Benefits of technology

[0069] This invention utilizes a low-power, low-cost STM32 chip and a high-speed Raspberry Pi development board as the core board for developing a modem, effectively reducing the overall system cost and power consumption. Using the Raspberry Pi as the software core offers faster operation, larger memory, and easier development and expansion. A self-designed MCU reduces device size and improves transportation flexibility, meeting the needs of underwater network nodes. An adaptive autocorrelation threshold algorithm is also employed, enabling the demodulator to adapt to various underwater environments during frame synchronization. The device supports multiple control methods from the host via serial port, achieving reliable underwater acoustic communication with longer communication distances and lower bit error rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714254B_ABST
    Figure CN117714254B_ABST
Patent Text Reader

Abstract

This invention discloses an underwater acoustic modem based on STM32 and Raspberry Pi, belonging to the field of underwater acoustic communication technology. Compared with previous modems, this invention improves upon the shortcomings of DSP-based modems, which are characterized by high cost, difficult development, and relatively poor system compatibility; and software-defined radio architecture modems, which are characterized by high hardware cost, high power consumption, and unsuitability for deployment in underwater communication networks. Furthermore, most existing modems cannot simultaneously guarantee communication distance and low bit error rate. This invention utilizes a low-power, low-cost STM32 chip and Raspberry Pi as the core board for modem development. With Raspberry Pi as the software core, it offers faster speed, larger memory, and easier development and expansion. The device size is reduced through a self-designed MCU, meeting the requirements of underwater network nodes. It also employs an adaptive autocorrelation threshold algorithm, enabling the demodulator to adapt to various underwater environments during frame synchronization, while achieving longer communication distances and lower bit error rates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater acoustic communication technology, and more particularly to underwater acoustic modems based on STM32 and Raspberry Pi. Background Technology

[0002] Underwater acoustic communication modems are fundamental to the deployment of underwater sensor networks. Low-cost, high-performance underwater acoustic modems are of significant research importance in the field of underwater acoustic communication. Optical communication has a short effective propagation distance underwater and is severely affected by water quality, exhibiting significant performance differences in clear and turbid water environments. Most underwater sensor systems use acoustic signals for communication. Currently available commercial acoustic modems are bulky and expensive. The academic community has also made numerous attempts, and currently available modems are based on combinations of single or multiple hardware platforms, including: digital signal processors (DSPs), field-programmable gate arrays (FPGAs), ARM Cortex processors, microcontrollers (MCUs), and software-defined radio (SDR) based on laptops / personal computers (PCs). Some modems use DSP chips, which are costly, difficult to develop, and have relatively poor system compatibility. Software-defined modems using radio architectures can flexibly utilize existing popular algorithms, but they are also expensive in hardware and power-consuming, making them unsuitable for deployment in underwater communication networks. Most existing modems cannot simultaneously guarantee communication distance and low bit error rate.

[0003] To address the aforementioned issues, this invention proposes an underwater acoustic modem based on STM32 and Raspberry Pi. Summary of the Invention

[0004] The purpose of this invention is to propose an underwater acoustic modem based on STM32 and Raspberry Pi to solve the problems mentioned in the background art:

[0005] Modems using digital signal processing chips (DSPs) are expensive, difficult to develop, and have relatively poor compatibility with the system; software-defined modems using radio architectures are expensive in hardware and consume a lot of power, making them unsuitable for deployment in underwater communication networks; and most existing modems cannot simultaneously guarantee communication distance and bit error rate.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] An underwater acoustic modem based on STM32 and Raspberry Pi includes: a main body, a lower underwater acoustic transducer, and an upper cable. The main body internally includes an upper-layer Raspberry Pi and an MCU, as well as a lower-layer power amplifier. The underwater acoustic transducer is connected to the output of the power amplifier inside the main body. The cable is connected to the MCU inside the main body, and the end of the cable is an RS422 interface for connecting to a computer host. Data is transmitted between the Raspberry Pi and the MCU via the GPIO interface and the Raspberry Pi Serial Peripheral Interface (SPI). The power amplifier is connected to the output of the MCU.

[0008] The MCU includes a serial link debugging interface, an input / output connector, an analog-to-digital / digital-to-analog converter module, and a power management circuit.

[0009] The input / output connector is used to connect the underwater acoustic transducer and the power amplifier;

[0010] The analog-to-digital / digital-to-analog conversion module is used for signal transmission and reception, and includes a transmission module and a reception module;

[0011] The power management circuit is used to convert the power supply voltage into the voltage required by each module.

[0012] The Raspberry Pi provides a USB interface for online software debugging, system control, signal encoding, frame synchronization and decoding. The frame synchronization uses a sliding correlation method optimized by an adaptive threshold change algorithm for initial decision-making, and then a piecewise FFT algorithm for secondary decision-making.

[0013] Preferably, the data transmitted between the Raspberry Pi and the MCU includes three data types: a custom message protocol, trigger signals, and raw digital signals.

[0014] Preferably, the transmitting module includes an external ADC, an emitter follower circuit, a low-pass filter, a programmable attenuator, and a servo output amplifier circuit; wherein, the external ADC is a DAC8830, and the STM32 sends the signal to the DAC8830 via SPI; the emitter follower circuit is composed of operational amplifiers, used to reduce the output impedance of the analog signal output from the external DAC when it passes through the emitter follower circuit; the low-pass filter is a Bessel low-pass filter composed of capacitors and operational amplifiers, used to eliminate signal aliasing and smooth the output signal; the programmable attenuator is a MAX4581, controlled by the STM32, used to achieve signal attenuation of arbitrary amplitude, and the attenuated signal is amplified and output through the servo amplifier circuit;

[0015] The receiving module includes an external ADC, a high-impedance preamplifier circuit, an anti-aliasing filter circuit, and an active differential amplifier circuit. The acquired signal is amplified by the high-impedance preamplifier circuit, and after impedance matching, the active differential amplifier circuit converts the single-ended signal into a differential signal and amplifies it. The anti-aliasing filter consists of two stages of RC differential low-pass filters, which are respectively connected to the input and output of the active differential amplifier circuit to filter out out-of-band aliasing signals. The signal finally enters the external ADC, is converted into a digital signal, and the generated digital signal is first stored in the STM32's internal buffer, and then the system software controls the signal transmission to the Raspberry Pi for digital signal processing.

[0016] Preferably, during the system control process, the system includes a sleep state, an idle state, a data acquisition state, and a transmission state;

[0017] When the system is in hibernation mode, the Raspberry Pi is powered off.

[0018] When the system is in an idle state, the Raspberry Pi periodically checks for instructions from the host computer. Upon receiving a state switching instruction, the Raspberry Pi synchronizes its state with the MCU and enters this state.

[0019] When the system is in acquisition mode, the Raspberry Pi starts the frame synchronization thread and the decoding thread. The MCU starts acquiring signals and transmits the converted digital signals to the Raspberry Pi, which then performs synchronous decoding.

[0020] When the system is in transmit mode, the Raspberry Pi starts the encoding thread to generate data and transmits the generated data to the MCU in real time. After the signal passes through the MCU transmission module, it is output to the underwater acoustic transducer to transmit the acoustic signal.

[0021] Preferably, the Raspberry Pi is modulated based on two signal modulation methods, SC-MFSK and MC-MFSK, wherein one frame of data includes a synchronization header signal, a control signal, a symbol signal, and a symbol interval signal.

[0022] Preferably, the signal encoding step is as follows:

[0023] S1.1: Receive character data from the host computer;

[0024] S1.2: Determine the modulation scheme and select whether to perform Ldpc encoding based on the modulation scheme;

[0025] S1.3: Record data information and fill the data into the buffer to be transmitted;

[0026] S1.4: Deconstruct the data to be sent into several frames and record the frame structure information;

[0027] S1.5: Generate several parts according to the frame structure and record the part information;

[0028] S1.6: Generate digital signals according to the part structure and store them in the fifo.

[0029] Preferably, the frame synchronization and decoding steps are as follows:

[0030] S2.1: The system is in an idle state;

[0031] S2.2: Read the data stored in the data buffer;

[0032] S2.3: Convert a uint32 vector to a float vector;

[0033] S2.4: Perform filtering processing on the signal;

[0034] S2.5: The xcorr function is used to perform cross-correlation processing on the signal;

[0035] S2.6: Determine whether the synchronization header signal has changed based on the result of S2.5. If the signal has changed, return to S2.1. If the signal has not changed, check sta. When sta = lfm, perform the synchronization header signal capture operation. When sta = control, perform the control symbol fetch operation. When sta = frame, perform the information symbol fetch operation.

[0036] The specific operation for capturing the synchronization head signal is as follows:

[0037] S2.6.1.1: Make a preliminary decision based on the sliding correlation method, and a secondary decision based on the piecewise FFT algorithm. If both decisions pass, jump to S2.6.1.2; otherwise, jump to S2.6.1.5.

[0038] S2.6.1.2: Stores both old and new signal data;

[0039] S2.6.1.3: Calculate the start position of the control symbol and the number of blocks to end;

[0040] S2.6.1.4: Let sta=control;

[0041] S2.6.1.4: The state has ended;

[0042] The specific operation of fetching control symbols is as follows:

[0043] S2.6.2.1: Store data;

[0044] S2.6.2.2: Check if the number of data blocks has reached the end of the control code. If yes, jump to S2.6.2.3; otherwise, jump to S2.6.2.6.

[0045] S2.6.2.3: Decode control symbols;

[0046] S2.6.2.4: Calculate the start position of information symbols, the number of ending blocks, and the frame length;

[0047] S2.6.2.5: Let sta = frame;

[0048] S2.6.2.6: The state has ended;

[0049] The specific operation for retrieving information symbols is as follows:

[0050] S2.6.3.1: Store data;

[0051] S2.6.3.2: Check if the number of data blocks has reached the end of the information symbol position. If yes, jump to S2.6.3.3; otherwise, jump to S2.6.3.5.

[0052] S2.6.3.3: pow++;

[0053] S2.6.3.4: Let sta = lfm;

[0054] S2.6.3.5: The state has ended;

[0055] S2.7: After the operations of capturing the synchronization header signal, fetching control symbols, and fetching information symbols are completed, the processing of a block of data is finished, and the process returns to S2.2.

[0056] Preferably, in the preliminary decision-making process, the received signal is autocorrelated with the standard LFM signal using a sliding correlation method. When the synchronization head signal arrives, the correlation peak value is determined based on an adaptive threshold change algorithm. The adaptive threshold change algorithm is as follows:

[0057] Let the average value of the noise correlation results be the initial value of the threshold. Then, based on the point-by-point variation of the autocorrelation results, the signal autocorrelation results are divided into three segments:

[0058] First paragraph: αT <abso<βT

[0059] Second segment: βT <abso<γT

[0060] Third paragraph: abso < γT

[0061] Where T is the current threshold; abso is the relevant result; α, β and γ are all adjustment factors; the value range of α is 0.5 < α < 1; the value range of β is 1 < β < 2; the value range of γ is γ ≤ 3;

[0062] When the signal autocorrelation result is in the first segment, the threshold is adaptively adjusted according to the noise level:

[0063] T = (1-μ)T + μabsoμ∈[0,1]

[0064] Where μ represents how quickly the threshold changes with the current autocorrelation result;

[0065] When the signal autocorrelation result is in the second segment, the threshold is not processed;

[0066] When the signal autocorrelation result is in the third segment, it is determined that the synchronization head signal has been received, and the position with the largest value in the subsequent signal autocorrelation result is recorded as the starting position of the synchronization head signal.

[0067] Preferably, the secondary decision-making process based on the segmented FFT algorithm is as follows: the synchronization header signal is segmented, FFT transformation is performed on each segment, the maximum frequency obtained after transformation is compared with the center frequency corresponding to each segment, and when the difference between the two does not exceed the frequency range of each segment, it is determined that the condition is met.

[0068] Compared with the prior art, the present invention provides an underwater acoustic modem based on STM32 and Raspberry Pi, which has the following advantages:

[0069] This invention utilizes a low-power, low-cost STM32 chip and a high-speed Raspberry Pi development board as the core board for developing a modem, effectively reducing the overall system cost and power consumption. Using the Raspberry Pi as the software core offers faster operation, larger memory, and easier development and expansion. A self-designed MCU reduces device size and improves transportation flexibility, meeting the needs of underwater network nodes. An adaptive autocorrelation threshold algorithm is also employed, enabling the demodulator to adapt to various underwater environments during frame synchronization. The device supports multiple control methods from the host via serial port, achieving reliable underwater acoustic communication with longer communication distances and lower bit error rates. Attached Figure Description

[0070] Figure 1 This is a schematic diagram of the underwater acoustic modem structure mentioned in Embodiment 1 of the present invention;

[0071] Figure 2 This is a simulated circuit diagram of the transmitting module mentioned in Embodiment 1 of the present invention;

[0072] Figure 3 This is a simulated circuit diagram of the receiving module mentioned in Embodiment 1 of the present invention;

[0073] Figure 4 This is a schematic diagram of the Raspberry Pi state transition mentioned in Embodiment 1 of the present invention;

[0074] Figure 5 This is a schematic diagram of the signal frame structure mentioned in Embodiment 1 of the present invention;

[0075] Figure 6 This is the encoding flowchart mentioned in Embodiment 1 of the present invention;

[0076] Figure 7 This is a flowchart of the frame synchronization and decoding process mentioned in Embodiment 1 of the present invention;

[0077] Figure 8 This is a schematic diagram of the 32FSK time-frequency circuit mentioned in Embodiment 2 of the present invention;

[0078] Figure 9 This is a time-frequency diagram of 8-16FSK mentioned in Embodiment 2 of the present invention.

[0079] Meaning of markings in the image:

[0080] 1. Main body; 11. Raspberry Pi; 12. MCU; 13. Power amplifier; 2. Underwater acoustic transducer; 3. Cable. Detailed Implementation

[0081] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0082] This invention utilizes a low-power, low-cost STM32 chip and a high-speed Raspberry Pi development board as the core board for developing a modem, effectively reducing the overall system cost and power consumption. Using the Raspberry Pi as the software core offers faster operation, larger memory, and easier development and expansion. Through a self-designed MCU, the device size is reduced, making transportation flexible and meeting the needs of underwater network nodes. An adaptive autocorrelation threshold algorithm is also employed, enabling the demodulator to adapt to various underwater environments during frame synchronization. The device supports multiple control functions from the host via serial port, achieving reliable underwater acoustic communication with longer communication distances and lower bit error rates. Specifically, it includes the following:

[0083] Example 1:

[0084] Please see Figure 1-7This invention relates to an underwater acoustic modem based on STM32 and Raspberry Pi, comprising: a main body 1, a lower underwater acoustic transducer 2, and an upper cable 3. The main body 1 internally includes an upper Raspberry Pi 11 and an MCU 12, and a lower power amplifier 13. The underwater acoustic transducer 2 is connected to the output of the power amplifier 13 inside the main body 1. The cable 3 is connected to the MCU 12 inside the main body 1, and the end of the cable 3 is an RS422 interface for connecting to a computer host. Data transmission between the Raspberry Pi 11 and the MCU 12 is achieved through the GPIO interface and the SPI serial peripheral interface provided by the Raspberry Pi 11. The power amplifier 13 is connected to the output of the MCU 12. The Raspberry Pi 11 measures 65mm × 30mm, and the MCU 12 measures 100mm × 56mm. The hardware circuit board model MCU 12, connected via a 40-pin connector, is equipped with input / output connectors for connecting the underwater acoustic transducer 2 and the external power amplifier 13. The MCU 12 also includes a power management circuit for converting the power supply voltage (12V-60V) to the voltage required by each module. The MCU12 is also equipped with a serial link debugging interface for J-link devices, while the Raspberry Pi 11 provides a USB interface for debugging, enabling online software debugging. The Raspberry Pi 11 is responsible for software functions such as system control, frame synchronization, signal modulation, and demodulation. Among them, frame synchronization uses a sliding correlation method optimized by an adaptive threshold change algorithm for initial decision-making, and then performs secondary decision-making based on a piecewise FFT algorithm to realize the frame synchronization process of the signal.

[0085] The MCU12 is equipped with an analog-to-digital (ADC) / digital-to-analog (DAC) module, which transmits and receives signals through a transmitter module and a receiver module. The transmitter module mainly consists of an external DAC, a transmitter-follower circuit, a low-pass filter, a programmable attenuator, and a servo output amplifier circuit. Analog circuitry includes... Figure 2 As shown. The external DAC is a DAC8830 with a 16-bit resolution and an output signal sampling frequency of up to 400ksps. The STM32 sends signals to the DAC8830 via SPI. The emitter follower circuit consists of an operational amplifier; when the analog signal output from the DAC passes through the emitter follower circuit, it effectively reduces the output impedance. The low-pass filter is a Bessel low-pass filter composed of capacitors and operational amplifiers. The filter's cutoff frequency is 80kHz, which can eliminate signal aliasing and make the output signal smoother. The programmable attenuator MAX4581 is controlled by the STM32 and can achieve signal attenuation of any amplitude. The attenuated signal is amplified and output through a servo output amplifier circuit.

[0086] The receiver module mainly consists of an external ADC, a high-impedance preamplifier circuit, an anti-aliasing filter circuit, and an active differential amplifier circuit. Analog circuits include... Figure 3As shown. The acquired signal is amplified by a high-impedance preamplifier circuit to achieve impedance matching. Then, a differential amplifier circuit converts the single-ended signal into a differential signal and amplifies it to increase the signal swing range. The anti-aliasing filter consists of two stages of RC differential low-pass filters, connected to the input and output of the active differential amplifier circuit, which can filter out out-of-band aliasing signals. After a series of processing steps, the signal enters the external ADC circuit and is converted into a digital signal. The generated digital signal is first stored in the STM32's internal buffer, and then transmitted to the Raspberry Pi 11 by system software control for digital signal processing.

[0087] The system communicates with the host via an RS422 serial port. Meanwhile, the Raspberry Pi 11 and MCU 12 transmit data through the GPIO interface and SPI interface provided by the Raspberry Pi 11. There are three types of data: one is a custom message protocol containing basic information of the message; the second is a trigger signal, which is a switch for thread processing, state transition and other functions; and the third is raw digital signal.

[0088] The system has four states: sleep state, idle state, acquisition state, and transmission state. See details in [link to documentation]. Figure 4 .

[0089] Each state corresponds to a working mode. In sleep mode, the Raspberry Pi 11 is powered down, and the system power consumption is at its lowest.

[0090] In idle state, Raspberry Pi 11 periodically checks for instructions from the host computer. Upon receiving a state switching instruction, Raspberry Pi 11 synchronizes its state with MCU 12 and enters this state.

[0091] In acquisition mode, Raspberry Pi 11 will launch a frame synchronization thread and a decoding thread. MCU 12 starts acquiring signals and transmits the converted digital signals to Raspberry Pi 11, which then performs synchronous decoding.

[0092] In transmit mode, the Raspberry Pi 11 starts an encoding thread to generate data and transmits the generated data to the MCU 12 in real time. After passing through the MCU 12 transmission module, the signal is output to the underwater acoustic transducer 2 to transmit the acoustic signal.

[0093] This system employs two signal modulation methods: SC-MFSK and MC-MFSK. The signal frame structure is as follows: Figure 5 As shown. A data frame includes a synchronization header signal, control signals, symbol signals, and symbol interval signals. The synchronization header signal is a linear frequency modulated (LFM) signal used for frame synchronization. The control signals contain all information about the signal in this frame, such as the modulation scheme and the number of symbols. The signal frame structure is as follows. Figure 5As shown in Table 1, the modulation schemes are 32FSK and 8-16FSK, and the host computer can control which signal to send. The software generates single-frequency or linear frequency modulated signals based on the frame structure information using a direct digital frequency synthesis (DDS) algorithm. The encoding process is as follows... Figure 6 As shown.

[0094] Table 1 Symbol signal parameters

[0095] 32FSK single frequency 5bit 21kHz-27kHz 8-16FSK 8 frequencies 32bit 20kHz-30kHz

[0096] The receiver acquires the signal and demodulates it in real time. To improve frame synchronization accuracy and reduce misjudgment of the synchronization header signal due to underwater environmental noise, the system employs a sliding correlation method and a piecewise FFT algorithm for two judgments to achieve the frame synchronization process. The reception and decoding process is as follows: Figure 7 As shown.

[0097] A sliding correlation method is used to autocorrelate the received signal with a standard LFM signal, and the correlation results are real-time and continuous. A peak is generated in the result when the actual synchronization head signal arrives. An appropriate threshold should be set to determine the correlation peak. To cope with the complex underwater environment, an adaptive threshold variation algorithm is implemented.

[0098] Adaptive threshold change algorithm:

[0099] The initial value of the threshold is set to the average value of the first part of the noise correlation results, and then it is changed point by point according to the autocorrelation results. The signal autocorrelation results are divided into three segments.

[0100] First paragraph: αT <abso<βT

[0101] Second segment: βT <abso<γT

[0102] Third paragraph: abso < γT

[0103] Where T is the current threshold; abso is the relevant result; α, β and γ are all adjustment factors; the value range of α is 0.5 < α < 1; the value range of β is 1 < β < 2; the value range of γ is γ ≤ 3;

[0104] The results in the first paragraph hover around the threshold, indicating that noise is being received. At this point, the threshold needs to be adaptively adjusted based on the noise level. The threshold adjustment is as follows:

[0105] T = (1-μ)T + μabsoμ∈[0,1]

[0106] Here, μ represents how quickly the threshold changes with the current autocorrelation result. μ is in the range of 0-0.1, which ensures a smooth change in the threshold.

[0107] The second segment is a buffer zone where the correlation results increase; no threshold is processed during this phase. When the correlation results reach the third segment, it indicates a sharp increase in correlation, at which point it is determined that a synchronization header signal has been received. The position of this signal is recorded. From this position, the correlation results of subsequent signals are compared to find the position with the largest correlation result, and this position is recorded as the starting position of the synchronization header signal.

[0108] To improve the accuracy of frame synchronization, a segmented FFT algorithm is used to make secondary decisions on the signal.

[0109] The synchronization head signal is divided into 10 segments. The signal frequency range is 20kHz-30kHz, and the center frequency of each segment is (20.5+n-1)kHz. An FFT is performed on each segment, and the maximum frequency obtained is compared with the center frequency of that segment. If the difference between the two does not exceed the frequency range of that segment (1kHz), the condition is considered met. A segmentation threshold of k is set. If the frequency of k segments out of the 10 segments meets the requirement, it indicates that the acquired signal is a linear frequency modulated (LFM) signal. Experiments have verified that a value of k = 6 yields the best results.

[0110] Example 2:

[0111] On September 23, 2022, a point-to-point signal transmission and reception experiment was conducted in a river channel in Dongli District, Tianjin. The communication distance was 3km. This experiment tested the communication performance of SC-MFSK and MC-MFSK signals.

[0112] Figure 8 , Figure 9 The time-frequency characteristics of the signal received at a distance of 3 km are shown in Table 2. Table 2 shows the reception error at a distance of 3 km. This experiment demonstrates that the system can achieve an extremely low bit error rate even at long communication distances.

[0113] Table 2: Symbol Reception Parameters

[0114] 32FSK 2.430db 173.24db 0 8-16FSK 2.582db 185.77db 0.00116

[0115] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An underwater acoustic modem based on STM32 and Raspberry Pi, characterized in that, include: The main body (1), the lower underwater acoustic transducer (2) and the upper cable (3) are included. The main body (1) includes an upper Raspberry Pi (11) and an MCU (12) and a lower power amplifier (13). The underwater acoustic transducer (2) is connected to the output of the power amplifier (13) inside the main body (1). The cable (3) is connected to the MCU (12) inside the main body (1). The end of the cable (3) is an RS422 interface for connecting to a computer host. The Raspberry Pi (11) and the MCU (12) transmit data through the GPIO interface provided by the Raspberry Pi (11) and the serial peripheral interface SPI of the Raspberry Pi (11). The power amplifier (13) is connected to the output of the MCU (12). The MCU (12) is an STM32, including a serial link debugging interface, an input / output connector, an analog-to-digital / digital-to-analog converter module and a power management circuit; The input / output connector is used to connect the underwater acoustic transducer (2) and the power amplifier (13). The analog-to-digital / digital-to-analog conversion module is used for signal transmission and reception, and includes a transmission module and a reception module; The power management circuit is used to convert the power supply voltage into the voltage required by each module. The Raspberry Pi (11) provides a USB interface for online debugging of software, system control, signal encoding, frame synchronization and decoding. The frame synchronization uses a sliding correlation method optimized by an adaptive threshold change algorithm for initial decision-making, and then a secondary decision-making based on a segmented FFT algorithm. During the system control process, the system includes a sleep state, an idle state, a data acquisition state, and a transmission state. When the system is in hibernation mode, the Raspberry Pi (11) is powered off; When the system is in an idle state, the Raspberry Pi (11) periodically detects the instructions from the host computer. After receiving the state switching instruction, the Raspberry Pi (11) synchronizes its state with the MCU (12) and enters this state. When the system is in the acquisition state, the Raspberry Pi (11) starts the frame synchronization thread and the decoding thread, the MCU (12) starts to acquire signals and transmits the converted digital signals to the Raspberry Pi (11), and the Raspberry Pi (11) performs synchronous decoding; When the system is in the transmitting state, the Raspberry Pi (11) starts the encoding thread to generate data and transmits the generated data to the MCU (12) in real time. After the signal is transmitted by the MCU (12), it is output to the underwater acoustic transducer (2) to transmit the acoustic signal.

2. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, The data transmitted between the Raspberry Pi (11) and the MCU (12) includes three data types: a self-defined message protocol, trigger signals, and raw digital signals.

3. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, The transmitting module includes an external DAC, an emitter follower circuit, a low-pass filter, a programmable attenuator, and a servo output amplifier circuit. The external DAC is a DAC8830, and the STM32 transmits signals to the DAC8830 via SPI. The emitter follower circuit, composed of operational amplifiers, reduces the output impedance of the analog signal from the external DAC as it passes through the emitter follower circuit. The low-pass filter, composed of capacitors and operational amplifiers, is a Bessel low-pass filter used to eliminate signal aliasing and smooth the output signal. The programmable attenuator is a MAX4581, controlled by the STM32, used to achieve arbitrary signal attenuation. The attenuated signal is then amplified and output through the servo output amplifier circuit. The receiving module includes an external ADC, a high-impedance preamplifier circuit, an anti-aliasing filter circuit, and an active differential amplifier circuit. The acquired signal is amplified by the high-impedance preamplifier circuit, and after impedance matching, the active differential amplifier circuit converts the single-ended signal into a differential signal and amplifies it. The anti-aliasing filter consists of two stages of RC differential low-pass filters, which are connected to the input and output of the active differential amplifier circuit, respectively, to filter out out-of-band aliasing signals. The signal finally enters the external ADC and is converted into a digital signal. The generated digital signal is first stored in the STM32 internal buffer, and then the system software controls the signal to be transmitted to the Raspberry Pi (11) for digital signal processing.

4. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, The Raspberry Pi (11) is modulated based on two signal modulation methods, SC-MFSK and MC-MFSK. A frame of data includes a synchronization header signal, a control signal, a symbol signal, and a symbol interval signal.

5. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, The signal encoding steps are as follows: S1.1: Receive character data from the host computer; S1.2: Determine the modulation scheme and select whether to perform Ldpc encoding based on the modulation scheme; S1.3: Record data information and fill the data into the buffer to be transmitted; S1.4: Deconstruct the data to be sent into several frames and record the frame structure information; S1.5: Generate several parts according to the frame structure and record the part information; S1.6: Generate digital signals according to the part structure and store them in the fifo.

6. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, The frame synchronization and decoding steps are as follows: S2.1: The system is in an idle state; S2.2: Read the data stored in the data buffer; S2.3: Convert a uint32 vector to a float vector; S2.4: Perform filtering processing on the signal; S2.5: The xcorr function is used to perform cross-correlation processing on the signal; S2.6: Determine whether the synchronization header signal has changed based on the result of S2.

5. If the signal has changed, return to S2.

1. If the signal has not changed, check sta. When sta=lfm, perform the synchronization header signal capture operation. When sta=control, perform the control symbol fetch operation. When sta=frame, perform the information symbol fetch operation. The specific operation for capturing the synchronization head signal is as follows: S2.6.1.1: Make a preliminary decision based on the sliding correlation method, and a secondary decision based on the piecewise FFT algorithm. If both decisions are successful, proceed to S2.6.1.2; otherwise, proceed to S2.6.1.

5. S2.6.1.2: Stores both old and new signal data; S2.6.1.3: Calculate the start position of the control symbol and the number of blocks to end; S2.6.1.4: Let sta = control; S2.6.1.5: The state has ended; The specific operation of fetching control symbols is as follows: S2.6.2.1: Store data; S2.6.2.2: Check if the number of data blocks has reached the end of the control code. If yes, jump to S2.6.2.3; otherwise, jump to S2.6.2.

6. S2.6.2.3: Decode control symbols; S2.6.2.4: Calculate the start position of information symbols, the number of ending blocks, and the frame length; S2.6.2.5: Let sta = frame; S2.6.2.6: The state has ended; The specific operation of retrieving information symbols is as follows: S2.6.3.1: Store data; S2.6.3.2: Check if the number of data blocks has reached the end of the information symbol position. If yes, jump to S2.6.3.3; otherwise, jump to S2.6.3.

5. S2.6.3.3: pow++, pow is the data block counter, pow++ means that the number of frames that have been correctly received is incremented by 1; S2.6.3.4: Let sta = lfm; S2.6.3.5: The state has ended; S2.7: After the operations of capturing the synchronization header signal, fetching control symbols, and fetching information symbols are completed, the processing of a block of data is finished, and the process returns to S2.

2.

7. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, In the initial decision-making process, the received signal is autocorrelated with the standard LFM signal using a sliding correlation method. When the synchronization head signal arrives, the correlation peak value is determined based on an adaptive threshold change algorithm. The adaptive threshold change algorithm is as follows: Let the average value of the noise correlation results be the initial value of the threshold. Then, based on the point-by-point variation of the autocorrelation results, the signal autocorrelation results are divided into three segments: First paragraph: Second paragraph: Third paragraph: in, This is the current threshold. For relevant results; , and All are regulatory factors; The range of values ​​is ; The range of values ​​is ; The range of values ​​is ; When the signal autocorrelation result is in the first segment, the threshold is adaptively adjusted according to the noise level: in, This indicates how quickly the threshold changes with the current autocorrelation result; When the signal autocorrelation result is in the second segment, the threshold is not processed; When the signal autocorrelation result is in the third segment, it is determined that the synchronization head signal has been received, and the position with the largest value in the subsequent signal autocorrelation result is recorded as the starting position of the synchronization head signal.

8. The underwater acoustic modem based on STM32 and Raspberry Pi according to claim 1, characterized in that, The specific process of secondary decision-making based on the segmented FFT algorithm is as follows: the synchronization header signal is segmented, FFT transformation is performed on each segment, and the maximum frequency obtained after transformation is compared with the center frequency corresponding to each segment. When the difference between the two does not exceed the frequency range of each segment, it is determined that the condition is met.