Automatic adjustment method of sampling time window, medium, program, electronic terminal and system

By automatically setting the sampling time window and filtering the signal start time, the measurement error and resource waste caused by manual adjustment and fixed window in the existing technology are solved, and the complete display of the signal and efficient measurement are realized.

CN120870702APending Publication Date: 2025-10-31SHANGHAI YOUHEMEI MEDICAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510937248.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

In existing technologies for radar echo detection, ultrasonic scanning, and pulse power testing, the adjustment of the sampling time window relies on manual adjustment or fixed window oversampling, which cannot meet the needs of unattended or batch testing, resulting in measurement errors and waste of resources.

Method used

By acquiring the target sampling duration and time difference margin of the signal under test, the initial sampling time window is automatically set, and the signal start time is filtered out through peak filtering and envelope detection. The final sampling time window is dynamically adjusted to cover the entire signal range, ensuring complete signal display.

Benefits of technology

It achieves automated sampling time window adjustment, avoids signal truncation and resource waste, improves measurement accuracy and efficiency, and is suitable for unattended and batch testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120870702A_ABST
    Figure CN120870702A_ABST
Patent Text Reader

Abstract

The invention provides an automatic adjustment method of a sampling time window, a medium, a program, an electronic terminal and a system, and the method comprises the steps: enabling a detected signal to completely cover a range of an initial sampling time window through setting the initial sampling time window, and enabling the detected signal to fall in a middle region of the window from the start to the end through setting a final sampling time window on this basis, the display device is not cut off by the left edge and is not close to the right edge, and a detected signal can be displayed on a display interface in a proper horizontal proportion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic test and measurement and signal sampling control, and in particular to an automatic adjustment method, medium, program, electronic terminal and system for sampling time window. Background Technology

[0002] In scenarios such as radar echo detection, ultrasonic scanning, and pulse power testing, the sampling front-end (the module used for sampling in instruments and equipment such as oscilloscopes, digitizers, or data acquisition cards) usually needs to pre-set a sampling time window to select the signal under test and other waveform signals to be observed. If the time window is too narrow, if the signal under test appears slightly late after triggering, the waveform will fall outside the window and be missed. If the time window is too wide, the number of sampling points that can be allocated per unit time will decrease under a fixed storage depth, the lateral resolution will decrease, and it will be impossible to observe the signal details in detail.

[0003] Currently, there are two main types of common practices in the industry:

[0004] One method involves manually adjusting the horizontal time base, which means the operator repeatedly performs trial sampling based on experience, adjusting the position of the horizontal time base and trigger delay until the waveform is fully displayed. This method relies on manual judgment and cannot meet the needs of unattended or batch testing.

[0005] Second, the principle of fixed window and oversampling redundancy is adopted, that is, after triggering, the window is opened directly according to the longest estimated delay, for example, reserving several times the round-trip flight time; although it ensures that "sampling can be achieved", it will reduce the effective sampling rate (the number of points is diluted), increase the amount of data and post-processing overhead, and even cause measurement errors due to insufficient lateral resolution. Summary of the Invention

[0006] In view of the shortcomings of the prior art described above, the purpose of this application is to provide an automatic adjustment method, medium, program, electronic terminal and system for sampling time windows to solve the above problems.

[0007] To achieve the above and other related objectives, a first aspect of this application provides an automatic adjustment method for a sampling time window, applied to a sampling front end. The method includes the following steps: acquiring the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input of the sampling channel. max Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). maxThe time corresponding to the initial sampling time window [T1, T2] is used to select the signal to be measured and determine the start time of the signal to be measured. The final sampling time window [T3, T4] of the sampling front end is set according to the start time. Wherein, T3 is the time corresponding to the shift of ΔT1 from the trigger time, and T4 is the time corresponding to the shift of ΔT2 from T3. ΔT1 is the time span between the start time and the trigger time, and ΔT2 = N × T0, and N ≥ 1.

[0008] In one embodiment of the first aspect of this application, the method for selecting the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test includes: performing peak filtering on the signal under test; wherein the peak threshold of the peak filtering is K1; traversing the filtered signal under test in chronological order within the initial sampling time window [T1, T2], and selecting the time corresponding to the first sampling point whose amplitude reaches the peak threshold K1 as the start time of the signal under test.

[0009] In one embodiment of the first aspect of this application, the method for selecting the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test includes: performing peak filtering and envelope detection on the signal under test to obtain threshold-selected sampling points; wherein the peak threshold of the peak filtering is K1; dividing the threshold-selected sampling points into several continuous segments according to the index order of the sampling storage area; wherein threshold-selected sampling points with consecutive index numbers are grouped into the same continuous segment, and the segments with discontinuous index numbers are automatically segmented; traversing the continuous segments in ascending order, and when the first continuous segment with a time span greater than or equal to a preset second threshold K2 is reached, obtaining the initial time of the continuous segment as the start time of the signal under test.

[0010] In one embodiment of the first aspect of this application, the measured signal is envelope detected and then peak filtering is performed, or the measured signal is peak filtered and then envelope detection is performed.

[0011] In one embodiment of the first aspect of this application, the method for selecting the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test includes: performing envelope detection on the signal under test to obtain envelope sampling points; dividing the envelope sampling points into several continuous segments according to their index order in the sampling storage area; wherein envelope sampling points with consecutive index numbers are grouped into the same continuous segment, and segments are automatically formed where the index numbers are not consecutive; performing peak filtering on all the continuous segments to obtain threshold-selected continuous segments; wherein the peak threshold of the peak filtering is K1; traversing the threshold-selected continuous segments in ascending order, and when the first threshold-selected continuous segment with a time span greater than or equal to a preset second threshold K2 is reached, obtaining the initial time of the threshold-selected continuous segment as the start time of the signal under test.

[0012] In one embodiment of the first aspect of this application, |K1|>-10dB×|A0| or |K1|>max(|A1|,|A2|,|A3|), where |A0| is the maximum absolute value of the amplitude of the measured signal, |A1| is the maximum absolute value of the reflected echo in the sampling channel, |A2| is the maximum absolute value of the crosstalk in the sampling channel, and |A3| is the maximum absolute value of the transducer or cable ringing in the sampling channel.

[0013] In one embodiment of the first aspect of this application, the peak threshold K1 is set according to the signal condition in the display window corresponding to the initial sampling time window [T1, T2], wherein the setting of the peak threshold K1 should be able to filter out the target interference signal in the display window.

[0014] In one embodiment of the first aspect of this application, the envelope detection method includes the Hilbert transform algorithm.

[0015] In one embodiment of the first aspect of this application, the term "continuous index numbers" means that the difference between adjacent index numbers is 1.

[0016] In one embodiment of the first aspect of this application, the signal under test is bandpass filtered.

[0017] In one embodiment of the first aspect of this application, the sampling front end is an oscilloscope; the step of obtaining the number N of horizontal grids of the oscilloscope; and setting the initial sampling time window [T1, T2] of the sampling front end includes: setting the initial horizontal time base S of the oscilloscope; wherein, The step of setting the final sampling time window [T3, T4] of the sampling front end includes: setting the trigger delay D and the final horizontal time base H of the oscilloscope; where D = ΔT1,

[0018] In one embodiment of the first aspect of this application, the number N of the horizontal grid of the oscilloscope is the total number of horizontal grids N1 of the oscilloscope screen, or the number of horizontal grids N2 corresponding to the time span from the trigger time to the rightmost side of the screen.

[0019] To achieve the above and other related objectives, a second aspect of this application provides an automatic adjustment method for a sampling time window, applied to an ultrasonic testing system. The method includes the following steps: setting the final sampling time window [T3, T4] of the sampling front-end for the initial coordinate point (x1, y1, z1) of the ultrasonic receiving device using the method described in any one of claims 1-11; wherein the time difference margin T... max The calculation methods include: Among them, L max Let V be the maximum spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device, and V be the speed of sound of the ultrasonic wave. When the ultrasonic receiving device moves, dynamic compensation ΔT1 is performed to obtain the final sampling time window [T3', T4'] corresponding to the current coordinate point (x2, y2, z2); where T3' = T3 + ΔT1', T4' = T3' + ΔT2, and ΔT1' = ΔT1 + Δ(ΔT1). Where (x0, y0, z0) are the coordinates of the ultrasonic transmitter, ΔT1 is the time span between the initial time and the trigger time corresponding to the initial coordinates (x1, y1, z1), and ΔT1' is the time span between the initial time and the trigger time corresponding to the current coordinates (x2, y2, z2).

[0020] In one embodiment of the first aspect of this application, the maximum spatial distance includes: the maximum value of the actual three-dimensional spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device, or the maximum value of the projected distance between the ultrasonic receiving device and the ultrasonic transmitting device in the direction of the sound beam axis; when the maximum spatial distance is the maximum value of the projected distance, the calculation formula for Δ(ΔT1) can be simplified to:

[0021] To achieve the above and other related objectives, a third aspect of this application provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the preceding claims.

[0022] To achieve the above and other related objectives, a fourth aspect of this application provides a computer program product comprising computer program code that, when executed on a computer, causes the computer to perform the method described in any of the preceding claims.

[0023] To achieve the above and other related objectives, a fifth aspect of this application provides an electronic terminal, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in any of the preceding claims.

[0024] To achieve the above and other related objectives, a sixth aspect of this application provides an automatic adjustment system for a sampling time window, comprising: a data acquisition, calculation, and control module, used to acquire the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input terminal of the sampling channel. max Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). max The time corresponding to the initial sampling time window [T1, T2]; the measured signal is selected from the initial sampling time window [T1, T2] and the start time T of the measured signal is determined. start According to the aforementioned start time T start Set the final sampling time window [T3, T4] of the sampling front-end; where, ΔT=N×T0=T4-T3, N≥1. .

[0025] To achieve the above and other related objectives, a seventh aspect of this application provides an automatic adjustment system for a sampling time window, comprising: a data acquisition, calculation, and control module, used to set the final sampling time window [T3, T4] of the sampling front end for the initial coordinate point (x1, y1, z1) of the ultrasonic receiving device using the method described in any one of the preceding claims; wherein the time difference margin T max The calculation methods include: Among them, L max Let V be the maximum spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device, and V be the speed of sound of the ultrasonic wave. When the ultrasonic receiving device moves, dynamic compensation ΔT1 is performed to obtain the final sampling time window [T3', T4'] corresponding to the current coordinate point (x2, y2, z2); where T3' = T3 + ΔT1', T4' = T3' + ΔT2, and ΔT1' = ΔT1 + Δ(ΔT1). Where (x0, y0, z0) are the coordinates of the ultrasonic transmitter, ΔT1 is the time span between the initial time and the trigger time corresponding to the initial coordinates (x1, y1, z1), and ΔT1' is the time span between the initial time and the trigger time corresponding to the current coordinates (x2, y2, z2).

[0026] As described above, this application has the following beneficial effects:

[0027] This invention provides an algorithm for automatically setting the sampling time window of the sampling front-end. First, it obtains the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input of the sampling channel. max Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). max The initial sampling time window is set to completely cover the measured signal within the range of the initial sampling time window [T1, T2]. Next, the measured signal is selected from the initial sampling time window [T1, T2] and the start time T of the measured signal is determined. start ; and according to the stated start time T start The final sampling time window [T3, T4] of the sampling front-end is set; where T3 is the time corresponding to shifting backward by ΔT1 from the trigger time, and T4 is the time corresponding to shifting backward by ΔT2 from T3; ΔT1 is the time span between the start time and the trigger time, ΔT2=N×T0, and N≥1. This ensures that the measured signal falls within the central region of the window from start to finish, without being truncated by the left edge or close to the right edge, and that the measured signal is presented on the display interface at a suitable horizontal scale. Attached Figure Description

[0028] Figure 1 The diagram shown is a flowchart illustrating an automatic adjustment method for a sampling time window according to an embodiment of this application.

[0029] Figure 2 The diagram shown is a flowchart illustrating an automatic adjustment method for a sampling time window according to an embodiment of this application.

[0030] Figure 3 The diagram shown is a flowchart illustrating an automatic adjustment method for a sampling time window according to an embodiment of this application.

[0031] Figure 4 The diagram shown is a structural schematic of an electronic terminal according to an embodiment of this application.

[0032] Figure 5 The diagram shown is a structural schematic of an automatic adjustment system for a sampling time window according to an embodiment of this application. Detailed Implementation

[0033] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0034] like Figure 1 As shown, the first aspect of this application provides an automatic adjustment method for the sampling time window, applied to the sampling front end. The method includes the following steps:

[0035] S1: Obtain the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input of the sampling channel. max .

[0036] It should be understood that the sampling front end refers to an analog input circuit (AFE) located between the input terminal of the signal under test and the analog-to-digital converter, which has attenuation / amplification functions and its gain can be switched programmably. The sampling front end can be set in devices with adjustable gain sampling channels, such as oscilloscopes, data acquisition cards or digitizers.

[0037] It should be understood that the target sampling duration T0 of the measured signal refers to the time span from the start to the end of sampling at the sampling front end. Within this time span, the system continuously digitizes the measured signal, generating a series of data points for subsequent analysis and processing. This time span is typically set by the user based on the signal's frequency, waveform characteristics, and application requirements. The target sampling duration T0 of the measured signal is greater than or equal to the actual pulse length of the measured signal.

[0038] It should be understood that when using an external signal for triggering, the signal under test typically does not immediately reach the input of the sampling channel when the trigger signal is issued. Because the signal may traverse different circuit loops or media (such as cables, optical fibers, or sound waves) during transmission, there may be a certain propagation delay between the two signals. This delay creates a time difference between the moment the trigger signal arrives at the sampling front end and meets the triggering condition (i.e., the triggering time) and the moment the signal under test arrives at the input of the sampling channel and is acquired by the sampling front end (i.e., the signal acquisition time). The time difference margin T is... maxThis refers to the margin of the theoretical maximum value of this time difference. Specifically, when the theoretical time difference between two signals is within a certain range (e.g., 10 microseconds to 1 second), the maximum value (e.g., 1 second) is appropriately relaxed or tolerated, and a margin (e.g., 1.1 seconds) is taken to ensure that the system can tolerate a certain range of signal delays. In other words, the time difference margin not only considers the possible propagation delay of the signal, but also provides a certain fault tolerance space for this delay to ensure that the system will not cause errors or sampling failures due to small delay variations during signal transmission and acquisition.

[0039] S2: Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). max The time corresponding to ).

[0040] It should be understood that the sampling time window described in this invention refers to the time window used to select sampled data and provide it to the display device after data is acquired at the sampling front end, and does not specifically refer to the size of the sampling storage space (although sometimes the sampling time window is equal to the time span that the storage space can record). Taking the sampling front end of an oscilloscope as an example, the sampling time window is the time window framed by the leftmost and rightmost moments on the oscilloscope screen. The initial moment T1 of the sampling window can be either the trigger moment or the display start moment determined based on the trigger moment. Specifically, T1 can be the trigger moment, the pre-trigger moment before triggering, or the post-trigger moment after triggering, and the starting point of the sampling display can be flexibly adjusted as needed. When T1 is the trigger moment, the left side of the sampling time window (i.e., the initial sampling point) corresponds to the moment when the trigger signal meets the trigger condition. That is, the sampled data is displayed starting from the trigger signal moment. This setting is suitable for application scenarios where it is desirable to observe the signal waveform starting from the trigger moment. When T1 is a moment earlier than the trigger moment, the sampling front end can select sampling points for a period of time before the trigger moment, thereby facilitating the observation of changes or events before the measured signal occurs. When T1 is a time later than the trigger time, it helps to further analyze the changes in the signal after the trigger event occurs.

[0041] It should be understood that the initial sampling time window is based on the target sampling duration T0 and the time difference margin T. max A preliminary, relatively large sampling time window is designed to address the issue of complete waveform capture in scenarios where there is a propagation delay between the measured signal and the trigger signal. The target sampling duration T0 reflects the effective duration of the measured signal, and the time margin T... maxThe margin representing the theoretical maximum time difference between the arrival of the trigger signal and the measured signal at the measurement channel is defined by setting the right boundary of the time window to T1 and the time difference margin T. max The sum of the three values ​​(sampling time, target sampling time, and target sampling duration, T0) ensures that the entire lifecycle of the measured signal, from its arrival at the acquisition system to its complete disappearance, is fully framed within the sampling time window. This fundamentally avoids the risk of signal truncation due to propagation delay and ensures that the correct signal waveform is presented on the display device.

[0042] S3: Select the signal to be measured from the initial sampling time window [T1, T2] and determine the start time of the signal to be measured.

[0043] In one embodiment of the first aspect of this application, the method for selecting the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test includes: performing peak filtering on the signal under test; wherein the peak threshold of the peak filtering is K1; traversing the filtered signal under test in chronological order within the initial sampling time window [T1, T2], and selecting the time corresponding to the first sampling point whose amplitude reaches the peak threshold K1 as the start time of the signal under test.

[0044] It should be understood that the core of peak filtering lies in setting an amplitude threshold K1, discarding all sampling points below the threshold, and retaining only those with amplitudes greater than or equal to K1. Taking a sound field scanning system as an example, in scenarios with sufficient signal amplitude and a high signal-to-noise ratio, there is often a significant amplitude difference between the measured signal and background interference. This threshold alone can quickly eliminate most irrelevant components. The first sampling point exceeding the threshold usually falls on the first rising edge of the measured pulse, thus providing the start time with a high success rate. In principle, sampling points exceeding the peak threshold K1 can only exist on the measured signal. When these peak-filtered sampling points are traversed in chronological order within the initial sampling time window [T1, T2], the first sampling point whose amplitude reaches the peak threshold K1 is found. The time corresponding to this sampling point is closest to the start time of the measured signal and can be approximated as the start time of the measured signal. When the measured signal weakens as a whole due to attenuation, obstruction, or other reasons, its amplitude may be close to that of some interference. In this case, it is difficult to completely separate the two by relying solely on a fixed threshold. At this point, there is a certain probability of failure in filtering out the measured signal by simply setting a peak threshold K1.

[0045] Preferably, the method for selecting the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test includes: performing peak filtering and envelope detection on the signal under test to obtain threshold-selected sampling points; wherein the peak threshold of the peak filtering is K1; dividing the threshold-selected sampling points into several continuous segments according to the index order of the sampling storage area; wherein threshold-selected sampling points with consecutive index numbers are grouped into the same continuous segment, and the segments with discontinuous index numbers are automatically segmented; traversing the continuous segments in ascending order, and when the first continuous segment with a time span greater than or equal to a preset second threshold K2 is reached, obtaining the initial time of the continuous segment as the start time of the signal under test.

[0046] It should be understood that the envelope detection method described in this invention includes upper envelope detection, full envelope detection, or lower envelope detection. When it is upper envelope or full envelope detection, the peak threshold K1 is positive; when it is lower envelope detection, the peak threshold K1 is negative. Preferably, the process of performing peak filtering and envelope detection on the measured signal to obtain threshold-selected sampling points involves first performing envelope detection on the measured signal, and then performing peak filtering. Preferably, the process of performing peak filtering and envelope detection on the measured signal to obtain threshold-selected sampling points involves first performing peak filtering on the measured signal, and then performing envelope detection. It should be understood that this invention does not limit the fixed order of "envelope detection first, peak filtering second" or "peak filtering first, envelope detection second," because the processing principles of the two are interchangeable: the role of envelope detection is to transform the instantaneous amplitude curve into a smooth amplitude envelope, while peak filtering essentially applies threshold gating to this amplitude information. As long as the threshold K1 is always set with reference to the current shape of the input signal (original waveform or envelope waveform), whether the envelope is performed first and then the threshold is applied, or the threshold is applied first and then the envelope is extracted, the same batch of sampling points with "significantly higher energy than the noise floor" will be retained. The only difference is the internal operation order and the required computing power. When the sampling rate is high, the threshold can be applied first to reduce the amount of subsequent envelope operation. When the signal-to-noise ratio is low or the interference is complex, the envelope can be applied first to make the threshold decision more stable, thus maintaining a consistent technical effect under different hardware and scenario constraints.

[0047] After envelope detection and peak filtering of the measured signal, threshold-selected sampling points corresponding to the envelope signal exceeding the peak threshold K1 are obtained. Then, according to the index order of the threshold-selected sampling points in the sampling storage area, they are divided into several continuous segments. Among them, threshold-selected sampling points with consecutive index numbers are grouped into the same continuous segment, and segments are automatically formed where the index numbers are not consecutive. Then, the continuous segments are traversed in ascending order. When the first continuous segment with a time span greater than or equal to the preset second threshold K2 is reached, the initial time of the continuous segment is obtained as the start time of the measured signal. For example, if there are 10 threshold-selected sampling points, namely: M100, M101, M102, M103, M150, M151, M152, M153, M160, M161 (the number after M is the index number), then M100-M103 is continuous segment A, M150-M153 is continuous segment B, and M160-M161 is continuous segment C. Automatic segmentation is implemented between M103 and M150, and between M153 and M160, due to the discontinuous index numbers. The continuous segments AC are traversed in ascending order; the first encountered segment corresponds to the starting position of the measured signal, and its initial time can be used as the starting time of the measured signal. In this way, even in low signal-to-noise ratio scenarios where the pulse amplitude of the measured signal attenuates to near the interference level, as long as its energy has sufficient continuity in the time domain, it can be accurately preserved based on the segment duration. Simultaneously, interference segments whose amplitude occasionally crosses K1 but lack time domain continuity are effectively intercepted by K2. Through dual "amplitude-time" filtering, the system maintains a fast single-threshold response in high-amplitude scenarios, while achieving higher positioning success rate and robustness under weak signal or complex multipath conditions, avoiding the false triggering and start-time drift problems common in direct peak filtering.

[0048] Preferably, the method for selecting the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test includes: performing envelope detection on the signal under test to obtain envelope sampling points; dividing the envelope sampling points into several continuous segments according to their index order in the sampling storage area; wherein, envelope sampling points with consecutive index numbers are grouped into the same continuous segment, and segments are automatically formed where the index numbers are not consecutive; performing peak filtering on all the continuous segments to obtain threshold-selected continuous segments; wherein, the peak threshold of the peak filtering is K1; traversing the threshold-selected continuous segments in ascending order, and when the first threshold-selected continuous segment with a time span greater than or equal to a preset second threshold K2 is reached, obtaining the initial time of the threshold-selected continuous segment as the start time of the signal under test.

[0049] For example, if there are 10 envelope sampling points: P100, P101, P102, P103, P150, P151, P152, P153, P160, P161 (the numbers after P are index numbers), then P100-P103 is a continuous segment D, P150-P153 is a continuous segment E, and P160-P161 is a continuous segment F. P103 and P150, and P153 and P160, are automatically segmented because their index numbers are not consecutive. After peak filtering of the continuous segment AC, a threshold-selected continuous segment is obtained. If the threshold-selected continuous segments are continuous segments E and F, traversing continuous segments E and F, since continuous segment E is traversed first according to the ascending order of index numbers, the initial time of continuous segment E is taken as the starting time of the measured signal.

[0050] It should be understood that the process of first performing envelope detection and then segmenting by index continuity is merely a prelude to the subsequent selection of continuous segments based on period length and amplitude. Envelope detection compresses the original high-frequency oscillation into a smooth energy curve, while segmenting by index continuity gathers naturally adjacent energy sampling points in the time domain into a continuous segment. Then, amplitude judgment is performed on the continuous segment, retaining those with amplitudes exceeding the peak threshold K1 as threshold-selected continuous segments. Finally, the first continuous segment with a period length meeting the requirements is selected from the threshold-selected continuous segments, and its initial time is taken as the start time of the measured signal. This method is essentially the same as the method of "performing peak filtering and envelope detection on the measured signal to obtain threshold-selected sampling points, dividing the threshold-selected sampling points into several continuous segments according to their index order in the sampling storage area, traversing the continuous segments in ascending order, and taking the initial time of the first continuous segment with a time span greater than or equal to a preset second threshold K2 as the start time of the measured signal." Both methods select the measured signal by judging the signal amplitude and period after envelope detection. After envelope detection, the amplitude of any sampling point and its index position in the time domain are known and fixed. Whether you first cluster adjacent index points into segments and then look at the segment peak value, or first pick out points that cross the threshold from a single point and then cluster adjacent points into segments, essentially both are performing an intersection operation of "amplitude ≥ K1" and "index continuity" on the same set of envelope data. Regardless of the order, the segment that can be selected in the end is the one with an envelope peak value not lower than K1 and a time domain span not shorter than K2. Therefore, both methods have the same accuracy and robustness in locating the starting time. In other words, both methods achieve the same technical effect: accurately distinguishing target pulses from scattered interference using amplitude threshold K1 and duration threshold K2 in a sound field scanning scenario with noise and multiple interferences.

[0051] It should be understood that all methods for screening the signal under test according to this concept fall within the protection scope of the present invention, which is "screening the signal under test from the initial sampling time window [T1, T2] and determining the start time of the signal under test".

[0052] Preferably, |K1|>-10dB×|A0| or |K1|>max(|A1|,|A2|,|A3|), where |A0| is the maximum absolute value of the measured signal amplitude, |A1| is the maximum absolute value of the reflected echo amplitude in the sampling channel, |A2| is the maximum absolute value of the crosstalk amplitude in the sampling channel, and |A3| is the maximum absolute value of the transducer or cable ringing amplitude in the sampling channel.

[0053] For example, in a sound field scanning system, when the amplitude of the measured signal is not too small, the amplitudes of the interference signals are all smaller than the measured signal and have obvious distinction. The amplitude of the largest interference signal is generally less than -10dB of the measured signal. When the amplitude of the measured signal is small, generally speaking, the amplitudes of the three types of interference signals in the sampling channel—reflected echo, crosstalk in the sampling channel, and transducer or cable ringing in the sampling channel—are distinguishable from the amplitude of the measured signal. Therefore, setting the threshold to be greater than the maximum amplitude of these three types of interference signals can filter out these three types of interference signals even when the amplitudes of the interference signals and the measured signal are similar.

[0054] Preferably, the peak threshold K1 is set according to the signal condition within the display window corresponding to the initial sampling time window [T1, T2], wherein the setting of the peak threshold K1 should be able to filter out the target interference signal within the display window.

[0055] It should be understood that in this embodiment, the peak threshold K1 is not calculated by a fixed formula, but is set directly based on the real-time waveform performance in the display window corresponding to the initial sampling time window [T1, T2]. The operator first observes the entire data segment in the waveform view of the oscilloscope or sound field scanning software to confirm that the "target interference signal" determined at the start time will interfere within this time window, and records the maximum power generation amplitude of these interference envelopes. Then, K1 is set to a safety margin slightly higher than this maximum power generation amplitude, thereby ensuring that all interference waveforms do not exceed the threshold at the envelope level, while the actual measured pulse can be clearly captured as long as its peak value exceeds the highest point of the interference. The advantage of this peak threshold setting method is that it does not require prior measurement of the absolute signal amplitude, nor does it rely on model inference. The threshold can be located simply by visual inspection or automatic scanning of the amplitude distribution within the window, which is both intuitive and in line with the real-time environment. At the same time, since the threshold is always set "slightly above the peak of the interference", even if the test site or equipment status changes, as long as the operator checks the display window again and adjusts K1 accordingly, the filtering effect can be guaranteed to always be locked above the interference and below the target, thus maintaining a high success rate in determining the starting time under varying experimental conditions.

[0056] Preferably, the envelope detection method includes the Hilbert transform algorithm.

[0057] Specifically, the method for envelope detection using the Hilbert transform algorithm includes:

[0058] After performing a Hilbert transform on the measured signal x(t), its orthogonal component f[x(t)] is obtained; an analytic signal is constructed based on the measured signal x(t) and its orthogonal component f[x(t)], where j is the imaginary unit, and z(t) = x(t) + j × f[x(t)]. The instantaneous amplitude e(t) of the analytic signal is calculated, where... The instantaneous amplitude e(t) is the envelope value corresponding to the sampling point at time t after detection.

[0059] Preferably, the consecutive index numbers mean that the difference between adjacent index numbers is 1.

[0060] It should be understood that, in this embodiment, "continuous index numbers" is explicitly defined as the difference between adjacent index numbers being equal to 1. This ensures that continuous segments truly correspond to a seamless waveform segment in the sampling buffer with no missed samples. Since the sampling rate is usually much higher than the main frequency of the measured pulse, any two sampling points with an index difference of 1 are almost continuous in time. This segmentation can preserve the complete envelope of signal energy to the maximum extent and avoid errors caused by discontinuity when calculating the segment peak and segment duration in subsequent calculations.

[0061] In one embodiment of the first aspect of this application, the signal under test is bandpass filtered.

[0062] It should be understood that bandpass filtering is a supplement to the core idea of ​​the present invention of using the dual criteria of "peak threshold K1 and duration threshold K2" to screen the signal under test, and can remove low-frequency drift and high-frequency spikes outside the bandwidth. The bandpass filter can be flexibly inserted before or after any of the processing nodes such as envelope detection, peak filtering, continuous segment division, and continuous segment screening in all embodiments of the present invention, as long as it can achieve the purpose of filtering out interference signals through the passband frequency, it falls within the protection scope of the present invention.

[0063] S4: Set the final sampling time window [T3, T4] of the sampling front end according to the start time; where T3 is the time corresponding to the shift of ΔT1 from the trigger time, and T4 is the time corresponding to the shift of ΔT2 from T3; ΔT1 is the time span between the start time and the trigger time, ΔT2=N×T0, and N≥1.

[0064] It should be understood that after determining the start time of the signal under test in step S3, the starting position T3 of the final sampling time window is set according to the time span ΔT1 between the start time and the trigger time, and the ending position T4 of the final sampling time window is determined according to T3 and the time span ΔT2 of the final sampling time window to ensure that the signal under test can be completely contained within the final sampling time window. Furthermore, by setting ΔT2 = N × T0, and N ≥ 1, the horizontal display ratio of the signal under test within the final sampling time window can be freely adjusted. This ensures that the signal under test falls within the central area of ​​the window from start to end, without being truncated by the left edge or close to the right edge, and that the signal under test is presented on the display interface at a suitable horizontal ratio.

[0065] like Figure 2 As shown, preferably, the sampling front-end is an oscilloscope; the number of horizontal grids N of the oscilloscope is obtained; the step of setting the initial sampling time window [T1, T2] of the sampling front-end includes: setting the initial horizontal time base S of the oscilloscope; wherein, The step of setting the final sampling time window [T3, T4] of the sampling front end includes: setting the trigger delay D and the final horizontal time base H of the oscilloscope; where D = ΔT1,

[0066] It should be understood that when the sampling front end is an oscilloscope, setting the initial sampling time window for the sampling front end is also setting the horizontal time base of the oscilloscope. At this time, the leftmost position of the oscilloscope display screen is determined by default by the trigger time (or the display start time set according to the trigger time in pre-trigger mode), while the horizontal time base is determined according to the horizontal time span of the entire screen, that is, the time span ΔT2 of the initial sampling time window.

[0067] Preferably, the number of horizontal grids N of the oscilloscope is the total number of horizontal grids N1 on the oscilloscope screen.

[0068] Preferably, the number of horizontal grids N2 corresponds to the time span from the trigger time to the far right of the screen.

[0069] like Figure 3 As shown, a second aspect of this application provides an automatic adjustment method for a sampling time window, applied to an ultrasonic testing system. The method includes the following steps: setting the final sampling time window [T3, T4] of the sampling front-end for the initial coordinate point (x1, y1, z1) of the ultrasonic receiving device using the method described in any one of claims 1-11; wherein the time difference margin T... max The calculation methods include: Among them, L maxLet V be the maximum spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device, and V be the speed of sound of the ultrasonic wave. When the ultrasonic receiving device moves, dynamic compensation ΔT1 is performed to obtain the final sampling time window [T3', T4'] corresponding to the current coordinate point (x2, y2, z2); where T3' = T3 + ΔT1', T4' = T3' + ΔT2, and ΔT1' = ΔT1 + Δ(ΔT1). Where (x0, y0, z0) are the coordinates of the ultrasonic transmitter, ΔT1 is the time span between the initial time and the trigger time corresponding to the initial coordinates (x1, y1, z1), and ΔT1' is the time span between the initial time and the trigger time corresponding to the current coordinates (x2, y2, z2).

[0070] Preferably, the maximum spatial distance is the maximum value of the actual three-dimensional spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device.

[0071] Preferably, the maximum spatial distance is the maximum value of the projected distance between the ultrasonic receiving device and the ultrasonic transmitting device along the beam axis. When the maximum spatial distance is the maximum value of the projected distance, the formula for calculating Δ(ΔT1) can be simplified to:

[0072] It should be understood that when the automatic adjustment method for the sampling time window of this invention is applied to an ultrasonic testing system, since the relative distance between the ultrasonic receiver and the ultrasonic transmitter in the ultrasonic testing system is constantly changing, it is necessary to change the start time of the measured signal arriving at the oscilloscope due to this distance change. This change can be calculated using the three-dimensional coordinates of the ultrasonic receiver and the ultrasonic transmitter. When the distance between the ultrasonic receiver and the ultrasonic transmitter is calculated according to the actual three-dimensional spatial distance, When the distance between the ultrasonic receiver and the ultrasonic transmitter is calculated based on the projected distance along the beam axis, the formula for calculating Δ(ΔT1) can be simplified to:

[0073] A third aspect of this application provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the preceding claims.

[0074] A fourth aspect of this application provides a computer program product comprising computer program code that, when executed on a computer, causes the computer to perform the method described in any of the preceding claims.

[0075] like Figure 4As shown, a fifth aspect of this application provides an electronic terminal, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in any of the preceding claims. The electronic terminal includes at least one processor 401, a memory 402, at least one network interface 403, and a user interface 405. The various components in the electronic terminal are coupled together via a bus system 404. It is understood that the bus system 404 is used to implement communication between these components. In addition to a data bus, the bus system 404 also includes a power bus, a control bus, and a status signal bus.

[0076] The user interface 405 may include a monitor, keyboard, mouse, trackball, clicker, button, touchpad, or touch screen.

[0077] It is understood that memory 402 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM) or programmable read-only memory (PROM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM) and synchronous static random access memory (SSRAM). The memories described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable categories of memory.

[0078] In this embodiment of the invention, the memory 402 is used to store various types of data to support the operation of the electronic terminal 400. Examples of this data include: any executable program for operation on the electronic terminal 400, such as the operating system 4021 and application programs 4022; the operating system 4021 contains various system programs, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks. The application program 4022 may contain various applications, such as a media player, browser, etc., for implementing various application services. The methods provided in this embodiment of the invention may be included in the application program 4022.

[0079] The methods disclosed in the above embodiments of the present invention can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 401 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. General-purpose processor 401 may be a microprocessor or any conventional processor, etc. The steps of the accessory optimization method provided in the embodiments of the present invention can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in a memory. The processor reads the information in the memory and combines it with its hardware to complete the steps of the aforementioned method.

[0080] In an exemplary embodiment, the electronic terminal 400 may be used by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), or complex programmable logic devices (CPLDs) to execute the aforementioned method.

[0081] like Figure 5 As shown, the first aspect of this application provides an automatic adjustment method for a sampling time window, applied to a sampling front end. The method includes the following steps: acquiring the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input terminal of the sampling channel. max Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). maxThe time corresponding to the initial sampling time window [T1, T2] is used to select the signal to be measured and determine the start time of the signal to be measured. The final sampling time window [T3, T4] of the sampling front end is set according to the start time. Wherein, T3 is the time corresponding to the shift of ΔT1 from the trigger time, and T4 is the time corresponding to the shift of ΔT2 from T3. ΔT1 is the time span between the start time and the trigger time, and ΔT2 = N × T0, and N ≥ 1.

[0082] It should be understood that the specific process of each module performing the above-mentioned steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.

[0083] It should also be understood that the module division in the embodiments of this application is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods. Furthermore, the functional modules in the various embodiments of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0084] like Figure 5 As shown, the seventh aspect of this application discloses an automatic adjustment system for a sampling time window, comprising: a data acquisition, calculation, and control module, used to set the final sampling time window [T3, T4] of the sampling front end for the initial coordinate point (x1, y1, z1) of the ultrasonic receiving device using the method described in any one of claims 1-11; wherein the time difference margin T max The calculation methods include: Among them, L max V is the maximum projected distance between the ultrasonic receiving device and the ultrasonic transmitting device on the sound wave transmission axis; V is the ultrasonic speed; when the ultrasonic receiving device moves, ΔT1 is dynamically compensated to obtain the final sampling time window [T3', T4'] corresponding to the current coordinate point (x2, y2, z2); where T3' = T3 + ΔT1', T4' = T3' + ΔT2.

[0085] Where (x0, y0, z0) are the coordinates of the ultrasonic transmitter, ΔT1 is the time span between the initial time and the trigger time corresponding to the initial coordinates (x1, y1, z1), and ΔT1' is the time span between the initial time and the trigger time corresponding to the current coordinates (x2, y2, z2).

[0086] It should be understood that the specific process of each module performing the above-mentioned steps has been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.

[0087] It should also be understood that the module division in the embodiments of this application is illustrative and only represents a logical functional division; in actual implementation, there may be other division methods. Furthermore, the functional modules in the various embodiments of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0088] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect. For example, "first XX" and "second XX" are merely used to distinguish different XXs and do not limit their order. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that terms such as "first" and "second" do not necessarily imply that they are different.

[0089] It should be noted that in the embodiments of this application, the words "for example" or "for instance" indicate examples, illustrations, or descriptions. Any embodiment or design described as "for example" or "for instance" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a concrete manner.

[0090] In this application embodiment, "at least one" refers to one or more, "more than one" refers to two or more, and "several" refers to one or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0091] The terms “component,” “module,” “system,” etc., used in this specification are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or a computer. As illustrated, applications running on computing devices and computing devices can both be components. One or more components may reside in a process and / or an execution thread, and components may be located on a single computer and / or distributed among two or more computers. Furthermore, these components can be executed from various computer-readable media on which various data structures are stored. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).

[0092] Those skilled in the art will recognize that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0093] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0094] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0095] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0096] In the above embodiments, the functions of each functional unit can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. A computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs, DVDs), or semiconductor media (e.g., solid-state disks, SSDs, etc.).

[0097] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0098] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0099] In summary, this application effectively overcomes the various shortcomings of the prior art and has high industrial application value.

[0100] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. An automatic adjustment method for the sampling time window, applied at the sampling front end, characterized in that, The steps of this method include: Obtain the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input of the sampling channel. max ; Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). max The time corresponding to ) The signal to be measured is selected from the initial sampling time window [T1, T2] and the start time of the signal to be measured is determined; The final sampling time window [T3, T4] of the sampling front end is set according to the start time; where T3 is the time corresponding to the shift of ΔT1 from the trigger time, and T4 is the time corresponding to the shift of ΔT2 from T3; ΔT1 is the time span between the start time and the trigger time, ΔT2=N×T0, and N≥1.

2. The method for automatically adjusting the sampling time window according to claim 1, characterized in that, The method for selecting the signal to be measured from the initial sampling time window [T1, T2] and determining the start time of the signal to be measured includes: Peak filtering is performed on the measured signal; wherein, the peak threshold of the peak filtering is K1; The filtered signal under test is traversed in chronological order within the initial sampling time window [T1, T2], and the time corresponding to the first sampling point whose amplitude reaches the peak threshold K1 is selected as the start time of the signal under test.

3. The method for automatically adjusting the sampling time window according to claim 1, characterized in that, The method for selecting the signal to be measured from the initial sampling time window [T1, T2] and determining the start time of the signal to be measured includes: Peak filtering and envelope detection are performed on the measured signal to obtain threshold-selected sampling points; wherein, the peak threshold of the peak filtering is K1; The threshold-selected sampling points are divided into several continuous segments according to their index order in the sampling storage area; wherein, threshold-selected sampling points with consecutive index numbers are grouped into the same continuous segment, and segments are automatically formed where the index numbers are not consecutive. The continuous segments are traversed in ascending order. When the first continuous segment with a time span greater than or equal to the preset second threshold K2 is reached, the initial time of the continuous segment is obtained as the start time of the measured signal.

4. The method for automatically adjusting the sampling time window according to claim 3, characterized in that, The measured signal is subjected to envelope detection followed by peak filtering, or the measured signal is subjected to peak filtering followed by envelope detection.

5. The method for automatically adjusting the sampling time window according to claim 1, characterized in that, The method for selecting the signal to be measured from the initial sampling time window [T1, T2] and determining the start time of the signal to be measured includes: Envelope detection is performed on the measured signal to obtain envelope sampling points; The envelope sampling points are divided into several continuous segments according to their index order in the sampling storage area; where the envelope sampling points with consecutive index numbers are grouped into the same continuous segment, and where the index numbers are not consecutive, they are automatically segmented. After peak filtering is applied to all the continuous segments, a threshold-selected continuous segment is obtained; wherein, the peak threshold of the peak filtering is K1; The threshold-selected continuous segments are traversed in ascending order. When the first threshold-selected continuous segment with a time span greater than or equal to the preset second threshold K2 is reached, the initial time of the threshold-selected continuous segment is obtained as the start time of the measured signal.

6. The method for automatically adjusting the sampling time window according to any one of claims 2-5, characterized in that, |K1|>-10dB×|A0| or |K1|>max(|A1|,|A2|,|A3|), Where |A0| is the maximum absolute value of the measured signal amplitude, |A1| is the maximum absolute value of the reflected echo amplitude in the sampling channel, |A2| is the maximum absolute value of the crosstalk amplitude in the sampling channel, and |A3| is the maximum absolute value of the transducer or cable ringing amplitude in the sampling channel.

7. The method for automatically adjusting the sampling time window according to any one of claims 2-5, characterized in that, The peak threshold K1 is set according to the signal condition within the display window corresponding to the initial sampling time window [T1, T2], wherein the setting of the peak threshold K1 should be able to filter out the target interference signal within the display window.

8. The method for automatically adjusting the sampling time window according to any one of claims 3-5, characterized in that, The envelope detection method includes the Hilbert transform algorithm.

9. The method for automatically adjusting the sampling time window according to claim 3 or 5, characterized in that, The term "sequential index numbers" means that the difference between adjacent index numbers is 1.

10. The method for automatically adjusting the sampling time window according to any one of claims 2-5, characterized in that, The measured signal is bandpass filtered.

11. The method for automatically adjusting the sampling time window according to claim 1, characterized in that, The sampling front end is an oscilloscope; Obtain the number N of horizontal grids on the oscilloscope; The step of setting the initial sampling time window [T1, T2] of the sampling front end includes: setting the initial horizontal time base S of the oscilloscope; wherein... The step of setting the final sampling time window [T3, T4] of the sampling front end includes: setting the trigger delay D and the final horizontal time base H of the oscilloscope; wherein, D = ΔT1, 12. The method for automatically adjusting a sampling time window according to claim 11, characterized in that, The number of horizontal grids N of the oscilloscope is either the total number of horizontal grids N1 on the oscilloscope screen, or the number of horizontal grids N2 corresponding to the time span from the trigger time to the rightmost side of the screen.

13. An automatic adjustment method for the sampling time window, applied to an ultrasonic testing system, characterized in that, The steps of this method include: For the initial coordinates (x1, y1, z1) of the ultrasonic receiving device, the final sampling time window [T3, T4] of the sampling front end is set using the method described in any one of claims 1-12; wherein, the time difference margin T max The calculation methods include: Among them, L max The maximum spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device is V, where V is the speed of ultrasonic sound. When the ultrasonic receiving device moves, dynamic compensation ΔT1 is performed to obtain the final sampling time window [T3', T4'] corresponding to the current coordinate point (x2, y2, z2); where, T3' = T3 + ΔT1' T4' = T3' + ΔT2, ΔT1'=ΔT1+Δ(ΔT1), Where (x0, y0, z0) are the coordinates of the ultrasonic transmitter, ΔT1 is the time span between the initial time and the trigger time corresponding to the initial coordinates (x1, y1, z1), and ΔT1' is the time span between the initial time and the trigger time corresponding to the current coordinates (x2, y2, z2).

14. The method for automatically adjusting a sampling time window according to claim 13, characterized in that, The maximum spatial distance includes: the maximum value of the actual three-dimensional spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device, or the maximum value of the projected distance between the ultrasonic receiving device and the ultrasonic transmitting device in the direction of the sound beam axis. When the maximum spatial distance is the maximum value of the projected distance, the formula for calculating Δ(ΔT1) can be simplified to:

15. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-12, or the method of claims 13-14.

16. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer, causes the computer to implement the method as described in any one of claims 1-12, or the method as described in claims 13-14.

17. An electronic terminal, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method of any one of claims 1-12, or the method of claims 13-14.

18. An automatic adjustment system for a sampling time window, characterized in that, include: The data acquisition, calculation, and control module is used to obtain the target sampling duration T0 of the measured signal, and the time difference margin T between the trigger time and the time when the measured signal arrives at the input of the sampling channel. max Based on the target sampling duration T0 and the time difference margin T max The initial sampling time window [T1, T2] is set for the sampling front end; where T1 is the trigger time or the display start time determined based on the trigger time, and T2 is the time window shifted backward from T1 (T0+T2). max The time corresponding to the initial sampling time window [T1, T2] is used to select the signal to be measured and determine the start time of the signal to be measured. The final sampling time window [T3, T4] of the sampling front end is set according to the start time. Wherein, T3 is the time corresponding to the shift of ΔT1 from the trigger time, and T4 is the time corresponding to the shift of ΔT2 from T3. ΔT1 is the time span between the start time and the trigger time, and ΔT2 = N × T0, and N ≥ 1. The sampling front end is used to provide the data parameters required by the data acquisition, calculation and control modules, and to receive and execute their control commands.

19. An automatic adjustment system for a sampling time window, characterized in that, include: The data acquisition, calculation, and control module is used to set the final sampling time window [T3, T4] of the sampling front end for the initial coordinate point (x1, y1, z1) of the ultrasonic receiving device using the method described in any one of claims 1-11; wherein the time difference margin T max The calculation methods include: Among them, L max Let V be the maximum spatial distance between the ultrasonic receiving device and the ultrasonic transmitting device, and V be the speed of sound of the ultrasonic wave. When the ultrasonic receiving device moves, dynamic compensation ΔT1 is performed to obtain the final sampling time window [T3', T4'] corresponding to the current coordinate point (x2, y2, z2); where T3' = T3 + ΔT1', T4' = T3' + ΔT2, and ΔT1' = ΔT1 + Δ(ΔT1). Where (x0, y0, z0) are the coordinates of the ultrasonic transmitter, ΔT1 is the time span between the initial time and the trigger time corresponding to the initial coordinates (x1, y1, z1), and ΔT1' is the time span between the initial time and the trigger time corresponding to the current coordinates (x2, y2, z2). The sampling front end is used to provide the data parameters required by the data acquisition, calculation and control modules, and to receive and execute their control commands.