Sonar time-varying gain control method and device, electronic equipment and storage medium
By setting the bottom line detection and calculating TVG compensation lines in the sonar system, the problems of poor image quality and low detection accuracy in the variable water droplet environment are solved, and higher quality bottom image and more accurate detection effects are achieved.
Patent Information
- Application Number
- CN202510160461.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-06-03
AI Technical Summary
The prior art cannot adapt to the variable water drop environment, resulting in poor sonar image quality and low detection accuracy.
By setting the minimum distance and time window for bottom line detection, the energy ratio is calculated to locate the bottom line sampling point, receive the echo signal and convert it into a decibel value, determine the gain starting point, calculate the compensation factor curve, and obtain the TVG compensation line through local weighted regression and iterative adjustment, which is added to the echo signal to improve the signal quality.
It significantly improves the signal-to-noise ratio and clarity of the echo signal, improves the quality and detection accuracy of sonar images, and can effectively deal with complex and changeable underwater environments.
Smart Images

Figure CN120085288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of marine exploration and underwater imaging, and particularly to a method and device for time-varying gain control of sonar, an electronic device, and a storage medium. Background Art
[0002] Side-scan sonar is an underwater detection and imaging tool widely used in multiple fields and industries. Its working principle is to emit acoustic wave pulses into the water. When the acoustic waves encounter an object during propagation in the water, they are reflected, and the reflected acoustic wave signals are received and analyzed by the sonar receiver. By measuring the time difference and intensity of the echo, information such as the distance, direction, and shape of underwater objects can be calculated, and finally, an underwater image and topographic map are generated. The application scenarios of side-scan sonar include multiple fields such as channel survey, seabed exploration, and military. It can be used for marine science and seabed topographic mapping, channel survey and shipping to detect obstacles to ensure smooth channels, pipeline and cable detection, seabed structure inspection, military reconnaissance, anti-submarine warfare, seabed resource exploration, etc.
[0003] However, during the acoustic wave emission and propagation process: on the one hand, due to the continuous expansion of the wavefront during the transmission of acoustic waves, the energy per unit area decreases, resulting in spreading loss; on the other hand, due to the absorption of acoustic wave energy by water viscosity and molecular relaxation mechanisms, absorption loss is generated. These energy losses cause the amplitude of the echo signal to decrease with increasing distance, resulting in phenomena such as too dark brightness and blurred details in the sonar image after a certain distance. Therefore, it is necessary to add time-varying gain control (TVG) to compensate for the attenuation of acoustic waves during propagation in water. The TVG compensation curve can balance the brightness of the side-scan sonar image, making it more convenient for human eye observation and subsequent underwater target exploration.
[0004] The underwater environment has extremely complex and variable characteristics. For example, factors such as water depth, temperature, salinity, sediment concentration, and water flow velocity will have a significant impact on the propagation of sonar signals. These changes often interfere with the quality and accuracy of sonar measurement data. Especially in measurements in different waters, different seasons, or different locations, the variability of the underwater environment poses a great challenge to the quality of sonar imaging.
[0005] In addition, due to the non-linear changes in the underwater environment, the underwater conditions are complex and variable. For example, in waters containing a large amount of sediment or plankton, the attenuation and scattering of sonar signals are more significant, resulting in weak echo signals, low signal-to-noise ratio, and poor image quality; while in areas with large variations in water layer depth and significant fluctuations in temperature or salinity, the speed and attenuation characteristics of acoustic wave propagation may also change significantly, making it difficult for fixed-gain processing methods to effectively adapt to all measurement situations.
[0006] However, the existing technology relies on empirical formulas for underwater acoustic wave attenuation. The attenuation formula of underwater acoustic waves usually adopts an exponential attenuation model, and the specific attenuation coefficient depends on factors such as frequency, water temperature, and salinity. In practical applications, it is usually necessary to combine environmental parameters to accurately calculate the attenuation coefficient in order to perform gain compensation on sonar or underwater communication systems and improve signal quality.
[0007] Therefore, there is a need for a sonar time-varying gain control method that can adaptively adjust to different bottom environments to compensate for the attenuation of acoustic waves during propagation in water and improve sonar image quality and detection accuracy. Summary of the Invention
[0008] Embodiments of the present invention provide a sonar time-varying gain control method to solve the problem that the existing technology cannot adapt to the changing underwater environment, resulting in poor sonar image quality and low detection accuracy. The technical solutions are as follows:
[0009] According to one aspect of the present invention, a sonar time-varying gain control method includes: setting a minimum distance and a time window for seabed line detection, equally dividing the time window and calculating an energy ratio, and obtaining seabed line sampling points according to the energy ratio; receiving echo signals at each sampling point and converting them into decibel values, determining a gain starting point according to the decibel values of the seabed line sampling points, and calculating a compensation factor curve by performing a mean calculation on the decibel values; performing locally weighted regression on the compensation factor curve by setting a window width and a weight function to obtain a fitting value, and performing iterative adjustment of the weight and polynomial fitting according to the fitting value to obtain a TVG compensation line; adding the TVG compensation line to the echo signals and converting them into voltage values, and drawing a sidescan sonar image according to the voltage values.
[0010] In one embodiment, equally dividing the time window and calculating an energy ratio, and obtaining seabed line sampling points according to the energy ratio are implemented through the following steps: equally dividing the time window into a front part and a rear part, dividing the sum of the energy of the rear part by the sum of the energy of the front part to obtain an energy ratio; continuously sliding the time window, and taking the midpoint in the time window with the largest energy ratio as the seabed line sampling point.
[0011] In one embodiment, determining a gain starting point according to the decibel values of the seabed line sampling points and calculating a compensation factor curve by performing a mean calculation on the decibel values are implemented through the following steps: obtaining a gray value sequence according to the decibel values, taking the seabed line sampling point with the smallest decibel value as the gain starting point, and calculating the amplitude mean of the echo signals according to the gray value sequence; calculating a total mean according to the amplitude mean and the gain starting point, and calculating a compensation factor according to the total mean and the amplitude mean and generating a compensation factor curve.
[0012] In one embodiment, the method further includes the following steps: setting an upper threshold and a lower threshold for the compensation factor, and when the compensation factor is greater than the upper threshold, setting the compensation factor to the upper threshold, and when the compensation factor is less than the lower threshold, setting the compensation factor to the lower threshold.
[0013] In one embodiment, local weighted regression of the compensation factor curve to obtain a fitted value by setting a window width and a weight function is achieved through the following steps: determining an observation ratio for local regression, determining observation points according to the sampling points and the observation ratio, defining a weight function, and setting a window width centered on the observation points; calculating the normalized distance from each of the observation points to other observation points, and calculating the weight of each of the observation points according to the normalized distance and the weight function; calculating the fitted value of each of the observation points according to each of the observation points and other observation points through a weighted regression algorithm.
[0014] In one embodiment, iterative adjustment of the weight and polynomial fitting according to the fitted value to obtain a TVG compensation line is achieved through the following steps: calculating a fitting residual according to the fitted value, updating the weight of each of the observation points according to the fitting residual, and performing polynomial fitting on the weight of each of the observation points by the least squares method to update the fitted value; iteratively updating the fitted value and the weight until a set condition is reached to obtain a TVG compensation line; the set condition includes that the weight change amount reaches a set condition and the number of iterations reaches a set value.
[0015] In one embodiment, the calculation formula for receiving the echo signal of each sampling point and converting it into a decibel value is as follows:
[0016]
[0017] where dB represents the decibel value, V represents the measured voltage in the echo signal, and Vref represents a reference voltage of 1 volt.
[0018] According to one aspect of the present invention, a sonar time-varying gain control device, the device comprising: a seabed line detection module, configured to set a minimum distance and a time window for seabed line detection, divide the time window evenly and calculate an energy ratio, and obtain seabed line sampling points according to the energy ratio; a compensation factor calculation module, configured to receive echo signals of each sampling point and convert them into decibel values, determine a gain starting point according to the decibel values of the seabed line sampling points, and calculate an average value according to the decibel values to obtain a compensation factor curve; a compensation factor processing module, configured to perform locally weighted regression on the compensation factor curve by setting a window width and a weight function to obtain a fitting value, and perform iterative adjustment of weights and polynomial fitting according to the fitting value to obtain a TVG compensation line; a time-varying gain control module, configured to add the TVG compensation line to the echo signal and convert it into a voltage value, and draw a side-scan sonar image according to the voltage value.
[0019] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein computer-readable instructions are stored on the memory; the computer-readable instructions are executed by one or more of the processors, enabling the electronic device to implement a sonar time-varying gain control method as described above.
[0020] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement a sonar time-varying gain control method as described above.
[0021] The beneficial effects brought by the technical solution provided by the present invention are:
[0022] In the above technical solution, the present invention first sets the minimum distance and time window for seabed line detection, evenly divides the time window and calculates the energy ratio, obtains the seabed line sampling points according to the energy ratio, receives the echo signals of each sampling point and converts them into decibel values, determines the gain starting point according to the decibel values of the seabed line sampling points, calculates the mean value according to the decibel values to obtain the compensation factor curve, performs locally weighted regression on the compensation factor curve by setting the window width and weight function to obtain the fitting value, performs iterative adjustment of the weight and polynomial fitting according to the fitting value to obtain the TVG compensation line, adds the TVG compensation line to the echo signal and converts it into a voltage value, and draws the sidescan sonar image according to the voltage value. First, it realizes the accurate positioning of the seabed line sampling points, and then converts the echo signal into decibel values to improve the accuracy of signal processing, determines the gain starting point to effectively avoid signal distortion, obtains the compensation factor curve through mean value calculation, combines locally weighted regression and iterative adjustment of the weight and polynomial fitting to obtain an accurate TVG compensation line, adds the TVG compensation line to the echo signal and converts it into a voltage value, significantly improving the signal-to-noise ratio and clarity of the echo signal, being able to cope with the complex and changeable seabed environment, performing post-processing on each sonar measurement data separately by adding time-varying gain control to obtain a higher-quality seabed image, thereby effectively solving the problem that the prior art cannot adapt to the changing underwater environment, resulting in poor sonar image quality and low detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the following drawings are only some embodiments of the present invention, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0024] Figure 1 is a flowchart of a sonar time-varying gain control method shown according to an exemplary embodiment;
[0025] Figure 2 is a flowchart of a sonar time-varying gain control method shown in an exemplary embodiment;
[0026] Figure 3 is Figure 2 a schematic diagram of the seabed line detection result in the corresponding embodiment;
[0027] Figure 4 is Figure 3 a schematic diagram of the Tvg compensation line in the corresponding embodiment;
[0028] Figure 5 is Figure 3 a comparison diagram of sonar images before and after adding the Tvg compensation line in the corresponding embodiment;
[0029] Figure 6 is Figure 3 The contrast diagram of signal amplitudes before and after adding the Tvg compensation line in the corresponding embodiment;
[0030] Figure 7 It is a block diagram of a sonar time-varying gain control device shown according to an exemplary embodiment;
[0031] Figure 8 It is a hardware structure diagram of an electronic device shown according to an exemplary embodiment;
[0032] Figure 9 It is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners
[0033] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention.
[0034] Those skilled in the art of the present technology can understand that unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "including" used in the specification of the present disclosure means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more related listed items.
[0035] Time-Varying Gain Control (TVG) is a technique used to compensate for signal attenuation. In underwater sonar systems, it is widely applied to enhance the intensity of echo signals, ensuring that the sonar system can reliably receive target echoes. During the propagation of underwater sound waves, due to water absorption, scattering, and multipath effects, the signal gradually attenuates, resulting in the intensity of the received echo signal being much smaller than that of the source signal. The present invention calculates the attenuation based on the echo signal and performs data fitting. Through gain control technology, the received gain is dynamically adjusted to compensate for signal attenuation, enabling the echo signal to be restored to an identifiable intensity. When the propagation distance of the echo signal is relatively long, the system automatically increases the gain to compensate for the attenuation. Through gain compensation, the system can effectively restore the target echo signal and improve the sensitivity of target detection, especially in relatively long distances or complex underwater environments.
[0036] To this end, the present invention provides a sonar time-varying gain control method. By separately post-processing each sonar measurement data to add time-varying gain control, a higher-quality seabed image can be obtained, effectively solving the problems in the prior art that it cannot adapt to the changing underwater environment, resulting in poor sonar image quality and low detection accuracy. This sonar time-varying gain control method is applicable to a sonar time-varying gain control device, which can be an electronic device. A sonar time-varying gain control method in an embodiment of the present invention can be applied to various scenarios, such as sonar time-varying gain control, etc.
[0037] Please refer to Figure 1 , an embodiment of the present invention provides a sonar time-varying gain control method, which is applicable to an electronic device.
[0038] In the following method embodiments, for the sake of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.
[0039] As Figure 1 shown, the method may include the following steps:
[0040] Step 110, set the minimum distance and time window for seabed line detection, evenly divide the time window and calculate the energy ratio, and obtain the seabed line sampling points according to the energy ratio.
[0041] In a possible implementation, the time window is equally divided into a front part and a rear part, the energy ratio is obtained by dividing the energy sum of the rear part by the energy sum of the front part, the time window is continuously slid, and the midpoint of the time window with the largest energy ratio is taken as the seabed line sampling point.
[0042] Step 130: Receive the echo signals of each sampling point and convert them into decibel values. Determine the gain starting point based on the decibel values of the seabed line sampling points, and calculate the compensation factor curve by calculating the mean value according to the decibel values.
[0043] In a possible implementation, obtain a grayscale value sequence according to the decibel values. Take the seabed line sampling point with the smallest decibel value as the gain starting point. Calculate the amplitude mean value of the echo signal according to the grayscale value sequence. Calculate the total mean value based on the amplitude mean value and the gain starting point. Calculate the compensation factor based on the total mean value and the amplitude mean value and generate the compensation factor curve.
[0044] In a possible implementation, set the upper threshold and lower threshold of the compensation factor. When the compensation factor is greater than the upper threshold, set the compensation factor to the upper threshold. When the compensation factor is less than the lower threshold, set the compensation factor to the lower threshold.
[0045] Step 150: Perform locally weighted regression on the compensation factor curve by setting the window width and weight function to obtain the fitted values. Iteratively adjust the weights and polynomial fitting according to the fitted values to obtain the TVG compensation line.
[0046] In a possible implementation, determine the observation ratio of the local regression. Determine the observation points according to the sampling points and the observation ratio. Define the weight function. Set the window width centered on the observation points. Calculate the standardized distance from each observation point to other observation points. Calculate the weights of each observation point according to the standardized distance and the weight function. Calculate the fitted values of each observation point according to each observation point and other observation points through the weighted regression algorithm.
[0047] In a possible implementation, calculate the fitting residuals according to the fitted values. Update the weights of each observation point according to the fitting residuals. Perform polynomial fitting on the weights of each observation point by the least squares method to update the fitted values. Iteratively update the fitted values and weights until the set conditions are met to obtain the TVG compensation line.
[0048] Among them, the set conditions include that the weight change amount reaches the set condition and the number of iterations reaches the set value.
[0049] Step 170: Add the TVG compensation line to the echo signal and convert it into a voltage value. Draw the sidescan sonar image according to the voltage value.
[0050] In a possible implementation, the calculation formula for receiving the echo signals of each sampling point and converting them into decibel values is as follows:
[0051]
[0052] Among them, dB represents the decibel value, V represents the measured voltage in the echo signal, and Vref represents the reference voltage of 1 volt.
[0053] Through the above process, in the embodiment of the present invention, the present invention first sets the minimum distance and time window for seabed line detection, evenly divides the time window and calculates the energy ratio, obtains the seabed line sampling points according to the energy ratio, receives the echo signals of each sampling point and converts them into decibel values, determines the gain starting point according to the decibel values of the seabed line sampling points, calculates the mean value according to the decibel values to obtain the compensation factor curve, performs local weighted regression on the compensation factor curve by setting the window width and weight function to obtain the fitting value, performs iterative adjustment of the weight and polynomial fitting according to the fitting value to obtain the TVG compensation line, adds the TVG compensation line to the echo signal and converts it into a voltage value, and draws a sidescan sonar image according to the voltage value. First, it realizes the accurate positioning of the seabed line sampling points, and then converts the echo signal into decibel values to improve the accuracy of signal processing. Determining the gain starting point effectively avoids signal distortion. The compensation factor curve obtained through mean value calculation, combined with local weighted regression and iterative adjustment of the weight and polynomial fitting, obtains an accurate TVG compensation line. Adding the TVG compensation line to the echo signal and converting it into a voltage value significantly improves the signal-to-noise ratio and clarity of the echo signal, can cope with the complex and changeable seabed environment, and performs post-processing on each sonar measurement data separately to add time-varying gain control to obtain a higher-quality seabed image, thereby effectively solving the problems that the prior art cannot adapt to the changing underwater environment, resulting in poor sonar image quality and low detection accuracy.
[0054] In an exemplary embodiment, the present invention provides a method for sonar time-varying gain control to perform sonar time-varying gain control.
[0055] As Figure 2 shown, it may specifically include the following steps:
[0056] Step S1, seabed line detection to determine the compensation factor calculation range.
[0057] Specifically, set the minimum distance of the seabed line and the length of the time window, evenly divide the time window into two parts before and after, calculate the ratio of the sum of the energies of the two parts, slide the time window, observe the change of the ratio, select the time window where the ratio is the maximum, take the midpoint in this time window as the pick-up point of the seabed line, and finally obtain the seabed line as Figure 3 shown.
[0058] Among them, the purpose of detecting the seabed line is to add time-varying gain starting from the seabed line. Because the echo signals closer to the seabed are less attenuated during transmission and can perform gain compensation more effectively, many detection targets (such as sunken ships, terrain mapping, etc.) are located at the seabed, and starting the gain from the seabed line can directly optimize these targets; the time-varying gain control starting from the seabed line is more in line with the actual detection needs and has stronger adaptability, which helps to obtain clearer echo signals under different water depths and bottom sediment conditions.
[0059] Specifically, the sonar continuously detects along the track. Each "Ping" represents the emission and reception of an acoustic wave pulse. For each emitted Ping, the system records the time and intensity of the returned signal, thereby updating the underwater image in real time to ensure comprehensive detection of the coverage area.
[0060] Among them, N p is the number of Pings in the track direction. The sampling points of the seabed line along the track direction are recorded as b(i). The specific formula for seabed line detection is as follows:
[0061]
[0062] Among them, T0 is the start point of the time window, T1 is the midpoint of the time window, T2 is the end point of the time window, s(t) is the amplitude. Since the ratio method is sensitive to noise, the calculation is performed by adding a stability factor B.
[0063] Step S2, calculate the compensation factor in logarithmic scale.
[0064] Specifically, convert the image voltage value to decibel value. Since using logarithmic scale is easier to understand and compare, and is suitable for representing large-range gain changes, it can intuitively reflect the increase or decrease of gain. When gains are multiplied, the corresponding decibel values can be directly added, thus simplifying the calculation process.
[0065] The specific conversion formula is as follows:
[0066]
[0067] Among them, V is the measured voltage, and V ref is the reference voltage, usually 1 volt.
[0068] Furthermore, assume that N p is the number of Pings in the track direction, N s is the number of sampling points in a certain Ping(j). According to the converted dB(i,j), a gray value sequence is obtained, where i = 1, 2... N p ; j = 1, 2... N s , the sampling points on the seabed line are b(i), and the starting point of the time-varying control gain curve is set to N min .
[0069] N min = min(b(i)), i = 1, 2... N p
[0070] Furthermore, calculate the amplitude mean value of each Ping. The formula is as follows:
[0071]
[0072] Further, calculate the total mean value of the entire image, and the formula is as follows:
[0073]
[0074] Further, calculate the compensation factor, and the formula is as follows:
[0075] M-mean(j)
[0076] Further, set the compensation factor threshold dB min and dB max To prevent some uneven areas of the image from affecting the overall image quality, when the compensation factor exceeds the upper threshold, set the compensation value to the upper threshold; when the compensation factor is less than the lower threshold, set the compensation value to the lower threshold. Usually, set the lower threshold to 0dB.
[0077] Step S3: Eliminate outliers and smooth the compensation factor curve.
[0078] Specifically, select the proportion f of the number of observations participating in the local regression to the total number of observations, and select the window width centered on each observation point for local weighted regression.
[0079] Specifically, first define a quartic weight function to calculate the weight of each observation point. The standardized distance from point x to the center point x i is u, and the weight function is specifically as follows:
[0080]
[0081] Further, for each observation point with a weight, calculate the estimated value of the regression coefficient to obtain the fitted value of y i at x i , and the specific formula is as follows:
[0082]
[0083] Further, let be the residual of the fitted value, S be the median value of |e i |, define δ k = ω(e k / (6S)), for each i at (x i , y i ), use δ i ω k (x i ) to replace the original weight ω k (x i ), and use the least squares method for polynomial fitting to calculate the new Recalculate the residuals of the new fitted values to obtain new Perform iteration until the weights are stable or the specified number of iterations is reached, and the finally obtained fitted values are the TVG compensation lines of the strong locally weighted regression. The obtained Tvg compensation lines are as Figure 4 shown.
[0084] Step S4, perform time-varying gain control according to the compensation factor.
[0085] Specifically, since the voltage value provides more detailed signal information and can truly reflect the waveform and details of the original signal, while the decibel value is a relative measure and is often used to simplify comparison and represent the dynamic range, the TVG compensation decibel line is gradually added to each Ping and then converted into a voltage value. The side-scan sonar image can be drawn according to the voltage value after gain compensation.
[0086] The formula for converting to the voltage value is specifically as follows:
[0087] dB = dB(i,j) + M - mean(j)
[0088]
[0089] As Figure 5 and Figure 6 shown, Figure 5 shows the comparison diagram of the sonar images before and after the addition of the Tvg compensation line. Figure 5 The left side of Figure 5 is the sonar image before the addition of the compensation line, and the right side of Figure 6 is the sonar image after the addition of the compensation line. It can be clearly seen that the sonar image after the addition of the compensation line is significantly clearer and of higher quality;
[0090] Through the above process, in the embodiment of the present invention, by precisely setting the minimum distance and time window for seabed line detection, and calculating the energy ratio after evenly dividing the time window, the precise positioning of the seabed line sampling points is realized. The echo signals of each sampling point are received and converted into decibel values, which not only improves the accuracy of signal processing, but also determines the gain starting point according to the decibel values of the seabed line sampling points, thus effectively avoiding signal distortion. Through the compensation factor curve obtained by mean calculation, combined with locally weighted regression and iterative adjustment of weights and polynomial fitting, an accurate TVG compensation line is obtained. The TVG compensation line is added to the echo signal and converted into a voltage value, significantly improving the signal-to-noise ratio and clarity of the echo signal. The side-scan sonar image drawn according to the voltage value has richer details and clearer levels, providing strong support for the precise detection and analysis of the seabed topography and geomorphology.
[0091] The following is an embodiment of the device of the present invention, which can be used to execute a sonar time-varying gain control method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the sonar time-varying gain control method involved in the present invention.
[0092] Please refer to Figure 7 , an embodiment of the present invention provides a sonar time-varying gain control device 800.
[0093] The device 800 includes but is not limited to: a seabed line detection module 810, a compensation factor calculation module 830, a compensation factor processing module 850, and a time-varying gain control module 870.
[0094] Among them, the seabed line detection module 810 is used to set the minimum distance and time window for seabed line detection, evenly divide the time window and calculate the energy ratio, and obtain the seabed line sampling points according to the energy ratio.
[0095] The compensation factor calculation module 830 is used to receive the echo signals of each sampling point and convert them into decibel values, determine the gain starting point according to the decibel values of the seabed line sampling points, and calculate the mean value according to the decibel values to obtain the compensation factor curve.
[0096] The compensation factor processing module 850 is used to perform local weighted regression on the compensation factor curve by setting the window width and weight function to obtain the fitting value, and perform iterative adjustment of the weight and polynomial fitting according to the fitting value to obtain the TVG compensation line.
[0097] The time-varying gain control module 870 is used to add the TVG compensation line to the echo signal and convert it into a voltage value, and draw a sidescan sonar image according to the voltage value.
[0098] It should be noted that when the above-mentioned embodiment provides sonar time-varying gain control, only the above-mentioned division of each functional module is used for illustration. In actual application, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the sonar time-varying gain control device will be divided into different functional modules to complete all or part of the functions described above.
[0099] In addition, the sonar time-varying gain control device provided by the above-mentioned embodiment and the embodiment of a sonar time-varying gain control method belong to the same concept. The specific manners in which each module performs operations have been described in detail in the method embodiment, and will not be elaborated here.
[0100] Figure 8 The structural schematic of an electronic device shown according to an exemplary embodiment.
[0101] It should be noted that this electronic device is only an example adapted to the present invention and should not be considered as imposing any limitation on the scope of use of the present invention. Nor can this electronic device be construed as requiring dependence on or necessarily having Figure 8 one or more components of the exemplary electronic device 2000 shown.
[0102] The hardware structure of the electronic device 2000 can vary significantly due to different configurations or performances. For example, Figure 8 as shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.
[0103] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000.
[0104] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted to the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. As Figure 8 shown, this is not a specific limitation here.
[0105] The memory 250, as a carrier for resource storage, can be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 251, application programs 253, and data 255, etc. The storage method can be transient storage or permanent storage.
[0106] Among them, the operating system 251 is used to manage and control each hardware device and application program 253 on the electronic device 2000 to enable the central processing unit 270 to perform operations and processing on the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0107] The application program 253 is a computer-readable instruction that completes at least one specific task based on the operating system 251. It can include at least one module ( Figure 8 not shown), and each module can separately contain computer-readable instructions for the electronic device 2000. For example, the sonar time-varying gain control device can be regarded as an application program 253 deployed on the electronic device 2000.
[0108] The data 255 can be signal information, etc., and is stored in the memory 250.
[0109] The central processing unit 270 may include one or more processors, and is configured to communicate with the memory 250 via at least one communication bus, so as to read computer-readable instructions stored in the memory 250, and then perform operations and processing on the massive data 255 in the memory 250. For example, a sonar time-varying gain control method is completed in the form of reading a series of computer-readable instructions stored in the memory 250 by the central processing unit 270.
[0110] In addition, the present invention can also be implemented by a hardware circuit or a combination of a hardware circuit and software. Therefore, the implementation of the present invention is not limited to any specific hardware circuit, software, or the combination of the two.
[0111] Please refer to Figure 9 , in an embodiment of the present invention, an electronic device 4000 is provided, and the electronic device 400 may include: a desktop computer, a notebook computer, a server, etc. with sensor recognition capabilities.
[0112] In Figure 9 , the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.
[0113] Among them, the data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 9 only a thick line is used to represent it in
[0114] Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as data sending and / or data receiving, etc. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiments of the present invention.
[0115] The processor 4001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of the present invention. The processor 4001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0116] The memory 4003 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or it can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or any other medium that can be used to carry or store desired program instructions or code in the form of instruction or data structures and can be accessed by the electronic device 400, but is not limited thereto.
[0117] Computer-readable instructions are stored on the memory 4003, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002.
[0118] The computer-readable instructions are executed by one or more processors 4001 to implement a sonar time-varying gain control method in the above embodiments.
[0119] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored, and the computer-readable instructions are executed by one or more processors to implement a sonar time-varying gain control method as described above.
[0120] In an embodiment of the present invention, a computer program product is provided. The computer program product includes computer-readable instructions stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements a sonar time-varying gain control method as described above.
[0121] Compared with the related art, the beneficial effects of the present invention are as follows:
[0122] 1. In the present invention, by precisely setting the minimum distance and time window for seabed line detection, and calculating the energy ratio after evenly dividing the time window, this solution realizes the precise positioning of seabed line sampling points. Receiving the echo signals of each sampling point and converting them into decibel values not only improves the accuracy of signal processing, but also determines the gain starting point based on the decibel values of the seabed line sampling points, thus effectively avoiding signal distortion. Further, through the compensation factor curve obtained by mean calculation, combined with locally weighted regression, iterative adjustment of weights, and polynomial fitting, an accurate TVG compensation line is obtained. Adding the TVG compensation line to the echo signal and converting it into a voltage value significantly improves the signal-to-noise ratio and clarity of the echo signal. The side-scan sonar image drawn based on the voltage value has richer details and clearer levels, providing strong support for the precise detection and analysis of seabed topography and geomorphology, and thus can effectively solve the problems in the prior art that it cannot adapt to the changing underwater environment, resulting in poor sonar image quality and low detection accuracy.
[0123] 2. The present invention can improve the image quality: By adding time-varying gain control (TVG), the attenuation of sound waves in water can be effectively compensated, enabling the enhancement of distal signals, thereby improving the brightness and clarity of the sonar image and reducing the phenomena of too dark brightness and blurred details.
[0124] 3. The present invention can enhance adaptability: In view of the complex and variable underwater environment, post-processing each sonar measurement data separately can be adaptively adjusted according to different underwater environments and detection targets, thereby obtaining a more accurate and reliable underwater image.
[0125] 4. The present invention can optimize the detection efficiency: Adding time-varying gain starting from the seabed line can more directly optimize the detection targets (such as sunken ships, terrain mapping, etc.), reduce unnecessary gain compensation, and improve the detection efficiency; Simplify the calculation process: By applying decibel values on a logarithmic scale to the calculation of gain compensation, the calculation process is simplified, and at the same time, the gain change is easier to understand and compare.
[0126] 5. The present invention can improve detection accuracy: By smoothing the TVG compensation line, the influence of outliers on the overall gain compensation is avoided, improving the detection accuracy; Enhance image stability: Through local weighted regression on the TVG compensation line, the increasing and smoothing effects of the TVG compensation line are ensured, thereby enhancing the image stability; Improve user experience: By optimizing the brightness and clarity of sonar images, as well as improving the detection accuracy and efficiency, the user experience and satisfaction when using a sidescan sonar for underwater detection will ultimately be improved.
[0127] 6. The present invention can dynamically adjust the receiving gain by accurately calculating the attenuation degree of the echo signal and fitting it with real-time echo data. The system first calculates the attenuation of the echo signal in real time, analyzes the intensity change trend of the echo signal, and predicts the signal attenuation using the established attenuation model. Based on these calculation results, the system can dynamically adjust the gain to compensate for the decrease in echo intensity caused by the increase in propagation distance and signal attenuation. When the propagation distance of the echo signal is relatively long, the system will automatically increase the gain to compensate for the signal attenuation during long-distance propagation, ensuring that the received signal intensity is still high enough for effective target detection and distance measurement. In the case of a short propagation distance or a strong signal, the system will reduce the gain to avoid over-amplifying the echo signal, thereby improving the sensitivity and anti-interference ability of the system. The core advantage of this method is that it can adaptively adjust the gain according to the actual attenuation of the echo signal, combined with dynamic data calculation and environmental changes, with strong adaptability and flexibility. Compared with traditional gain control methods, the present invention can not only more accurately compensate for signal attenuation, but also effectively cope with complex and changing underwater environments, ensuring that the echo signal can maintain good recognition intensity in various situations. In addition, the gain control algorithm based on data fitting can optimize the system performance, achieve a more balanced signal processing effect, and avoid noise interference and misjudgment caused by uneven signal attenuation.
[0128] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps does not have a strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0129] The above are only some embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A sonar time-varying gain control method, characterized in that: The method comprises: Set the minimum distance and time window for seabed line detection, calculate the energy ratio after equally dividing the time window, and obtain the seabed line sampling point according to the energy ratio; Receiving the echo signal of each sampling point and converting it into a decibel value, determining the gain starting point according to the decibel value of the seabed line sampling point, and performing mean value calculation according to the decibel value to obtain a compensation factor curve; Performing local weighted regression on the compensation factor curve by setting the window width and weight function to obtain a fitting value, and iteratively adjusting the weight and polynomial fitting according to the fitting value to obtain a TVG compensation line; The TVG compensation line is added to the echo signal and converted into a voltage value, and a side scan sonar image is obtained by drawing according to the voltage value.
2. A sonar time-varying gain control method as claimed in claim 1, characterized in that: The step of calculating the energy ratio after equally dividing the time window and obtaining the seafloor sampling point according to the energy ratio includes: The time window is equally divided into a front part and a rear part, and the energy sum of the rear part is divided by the energy sum of the front part to obtain an energy ratio; The time window is continuously slid, and the midpoint of the time window with the largest energy ratio is taken as the seafloor line sampling point.
3. A sonar time-varying gain control method as claimed in claim 1, characterized in that: The step of determining the gain starting point according to the decibel value of the seabed line sampling point, and performing mean calculation according to the decibel value to obtain a compensation factor curve includes: Obtaining a gray value sequence according to the decibel value, taking the seafloor line sampling point with the smallest decibel value as the gain starting point, and calculating the amplitude mean of the echo signal according to the gray value sequence; A total mean value is calculated based on the amplitude mean value and the gain starting point, a compensation factor is calculated based on the total mean value and the amplitude mean value, and a compensation factor curve is generated.
4. A sonar time-varying gain control method as claimed in claim 3, characterized in that: The method further comprises: An upper threshold and a lower threshold of the compensation factor are set. When the compensation factor is greater than the upper threshold, the compensation factor is set to the upper threshold. When the compensation factor is less than the lower threshold, the compensation factor is set to the lower threshold.
5. A sonar time-varying gain control method as claimed in claim 1, characterized in that: The step of performing local weighted regression on the compensation factor curve by setting the window width and the weight function to obtain the fitting value comprises: Determine the observation ratio of local regression, determine the observation point according to the sampling point and the observation ratio, define a weight function, and set the window width with the observation point as the center; Calculating the standardized distance from each observation point to other observation points, and calculating the weight of each observation point according to the standardized distance and the weight function; The fitting value of each observation point is calculated based on each observation point and other observation points through a weighted regression algorithm.
6. A sonar time-varying gain control method as claimed in claim 5, characterized in that: The iterative adjustment of weights and polynomial fitting according to the fitting values to obtain the TVG compensation line includes: Calculate a fitting residual according to the fitting value, update the weight of each of the observation points according to the fitting residual, and perform polynomial fitting on the weight of each of the observation points by the least square method to update the fitting value; The fitting value and the weight are iteratively updated until the set conditions are met to obtain the TVG compensation line; the set conditions include the weight change reaching the set conditions and the number of iterations reaching the set value.
7. A sonar time-varying gain control method as claimed in claim 1, characterized in that: The calculation formula for receiving the echo signal of each sampling point and converting it into a decibel value is as follows: Wherein, dB represents the decibel value, V represents the measured voltage in the echo signal, and V ref Indicates that the reference voltage is 1 volt.
8. A sonar time-varying gain control device, characterized in that: The device comprises: A sea bottom line detection module, used to set the minimum distance and time window for sea bottom line detection, calculate the energy ratio after dividing the time window equally, and obtain the sea bottom line sampling point according to the energy ratio; A compensation factor calculation module is used to receive the echo signal of each sampling point and convert it into a decibel value, determine the gain starting point according to the decibel value of the seabed line sampling point, and perform mean calculation according to the decibel value to obtain a compensation factor curve; A compensation factor processing module, used to perform local weighted regression on the compensation factor curve by setting a window width and a weight function to obtain a fitting value, and iteratively adjust the weight and polynomial fitting according to the fitting value to obtain a TVG compensation line; The time-varying gain control module is used to add the TVG compensation line to the echo signal and convert it into a voltage value, and draw a side-scan sonar image according to the voltage value.
9. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the sonar time-varying gain control method according to any one of claims 1 to 7.
10. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement a sonar time-varying gain control method according to any one of claims 1 to 7.