Waveform reconstruction method and device based on dynamic sampling frequency and electronic equipment
By synchronously recording carrier frequency information and performing normalization processing, a target data sequence with a unified index step size is generated, which solves the distortion problem caused by fixed frequency in traditional waveform acquisition and realizes high-fidelity reconstruction and accurate analysis of dynamic signals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN KELIER IND AUTOMATION CONTROL TECH CO LTD
- Filing Date
- 2026-01-15
- Publication Date
- 2026-05-01
AI Technical Summary
In traditional waveform acquisition and display systems, fixed sampling frequencies cannot adapt to dynamically changing signals, leading to distortion of the reconstructed waveform, which fails to accurately reflect the actual form of the signal and affects the accuracy and reliability of non-steady-state signal analysis.
By synchronously recording carrier frequency information to generate composite data units, calculating local period time and performing normalization processing, generating target data sequences with uniform index step size, using the cumulative fractional part to pass integer index values, and reconstructing waveforms to adapt to dynamic frequency changes.
It significantly improves the accuracy of waveform storage and display in frequency variation scenarios, and is suitable for high-fidelity analysis of non-steady-state signals such as motor phase current and bioelectric signals, reducing cumulative errors and improving time consistency.
Smart Images

Figure CN121958780A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of signal processing and data acquisition technology, and in particular to a waveform reconstruction method, apparatus, electronic device and computer-readable storage medium based on dynamic sampling frequency. Background Technology
[0002] In traditional waveform acquisition and display systems, it is typically assumed that the sampling frequency or signal period remains constant, and the acquired discrete data points are connected and plotted at fixed time intervals. However, in practical applications, the frequencies of many signals are dynamically changing, such as the phase current frequency changes caused by fluctuations in motor speed or the rhythmic drift of bioelectrical signals, leading to inconsistencies in the actual time intervals between sampling points. If a fixed-period plotting method is still used, generating waveforms solely based on the original sampling sequence will result in significant distortion of the period, phase, and frequency characteristics of the reconstructed waveform, failing to accurately reflect the actual form of the signal. Furthermore, existing methods do not synchronously retain carrier frequency information during data storage, making subsequent accurate reconstruction based on the true time relationship impossible, severely impacting the accuracy and reliability of non-steady-state signal analysis. Summary of the Invention
[0003] The purpose of this application is to provide a waveform reconstruction method, apparatus, electronic device, and computer-readable storage medium based on dynamic sampling frequency, so as to alleviate the above-mentioned technical problems existing in the prior art.
[0004] In a first aspect, the present invention provides a waveform reconstruction method based on dynamic sampling frequency, comprising: The system acquires raw signal data at multiple sampling times and synchronously records the carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude. The local period time corresponding to each sampling point is calculated based on the carrier frequency information in each composite data unit, and the local period time is normalized based on the preset average reference period to obtain the normalized time increment. Accumulate the normalized time increment sequentially. At each step, add the current increment to the fractional part of the previous accumulation and round it to generate the integer index value of the current sampling point, and retain the new fractional part for subsequent calculations. The composite data units are rearranged according to the integer index values to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, so as to reconstruct the waveform.
[0005] In an optional implementation, raw signal data at multiple sampling times are acquired, and carrier frequency information at the corresponding time is recorded synchronously during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude, including: Acquire raw signal data at multiple sampling times and synchronously record the carrier frequency information at the corresponding time during each acquisition; The carrier frequency information corresponding to each sampling point is packaged with the multi-channel signal amplitude into a fixed-length data frame, and the carrier frequency information is encoded into one byte to generate a composite data unit. Composite data units are stored in a non-volatile storage medium in the order of acquisition.
[0006] In an optional implementation, the local period time corresponding to each sampling point is calculated based on the carrier frequency information in each composite data unit, and the local period time is normalized based on a preset average reference period to obtain the normalized time increment, including: The carrier frequency value in each composite data unit is converted into the corresponding period time, and the local period time of that sampling point is calculated. The local periodic time is normalized by dividing it by the preset average reference period to obtain a dimensionless time scaling factor, which is then used to obtain the normalized time increment.
[0007] In an optional implementation, the local periodic time is normalized by dividing it by a preset average reference period to obtain a dimensionless time scaling factor, thus obtaining the normalized time increment, including: The preset multiple of the system operating frequency corresponding to the period is determined as the average reference period; The local periodic time is normalized by dividing it by the average reference period to obtain a dimensionless time scaling factor, which is then used to obtain the normalized time increment.
[0008] In an optional implementation, the normalized time increment is accumulated sequentially. At each step, the current increment is added to the fractional part of the previous accumulation, rounded down, to generate the integer index value of the current sampling point. The new fractional part is retained for subsequent calculations. This includes: Initialize the cumulative decimal part to zero; For the current sampling point, add its normalized time increment to the cumulative decimal part retained after the iteration of the previous sampling point to obtain the intermediate sum; Round the middle value down to generate the integer index value of the current sampling point; Subtract the integer part from the sum of the middle values to obtain the new fractional part, and save it for the calculation of the next sampling point of the current sampling point.
[0009] In an optional implementation, the composite data units are rearranged according to integer index values to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, for waveform reconstruction, including: Each composite data unit is sorted sequentially according to its corresponding integer index value to generate a sparse index sequence; wherein, the index difference between adjacent valid data points in the sparse index sequence is used to characterize their actual time interval. The sparse index sequence is output to the waveform display module, which adjusts the horizontal axis time scale according to the index value and draws the corresponding data points in a line manner to reconstruct the waveform.
[0010] In an optional implementation, the method further includes: The carrier frequency information at the current sampling time is assigned to the composite data unit corresponding to the previous sampling point.
[0011] In a second aspect, the present invention provides a waveform reconstruction device based on dynamic sampling frequency, comprising: The data acquisition module is used to acquire raw signal data at multiple sampling times and synchronously record the carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude. The normalization module is used to calculate the local period time corresponding to each sampling point based on the carrier frequency information in each composite data unit, and to normalize the local period time based on the preset average reference period to obtain the normalized time increment. The index generation module is used to accumulate the normalized time increment in a sequential manner. At each step, the current increment is added to the fractional part of the previous accumulation and then rounded to generate the integer index value of the current sampling point, while retaining the new fractional part for subsequent calculations. The waveform reconstruction module is used to rearrange composite data units according to integer index values to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, so as to reconstruct the waveform.
[0012] Thirdly, the present invention provides an electronic device including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the waveform reconstruction method based on dynamic sampling frequency according to any of the foregoing embodiments.
[0013] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the waveform reconstruction method based on dynamic sampling frequency according to any of the foregoing embodiments.
[0014] This application provides a waveform reconstruction method, apparatus, electronic device, and computer-readable storage medium based on dynamic sampling frequency. By synchronously recording carrier frequency information and generating composite data units during acquisition, it solves the problem of waveform distortion caused by relying solely on a fixed sampling period under dynamic frequencies. By normalizing the local period time and introducing an average reference period, it achieves a standardized representation of variable-period signals. By generating integer index values through cumulative fractional part propagation, it avoids the accumulated errors caused by traditional rounding and ensures time consistency over long-term observations. Finally, by rearranging and generating a target sequence with a unified index step size, the reconstructed waveform is compatible with existing rendering systems and accurately reflects the temporal evolution of the signal. This method significantly improves the accuracy of waveform storage and display in frequency-changing scenarios, and is particularly suitable for high-fidelity analysis of non-steady-state signals such as motor phase currents and bioelectrical signals. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a waveform reconstruction method based on dynamic sampling frequency provided in this application embodiment; Figure 2 An overall framework diagram provided for embodiments of this application; Figure 3 A structural diagram of a waveform reconstruction device based on dynamic sampling frequency provided in an embodiment of this application; Figure 4 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0018] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0019] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0020] This application provides a waveform reconstruction method based on dynamic sampling frequency. See [link to relevant documentation]. Figure 1 As shown, the method mainly includes the following steps: S110 acquires raw signal data at multiple sampling times and synchronously records the carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude.
[0021] The aforementioned raw signal data refers to the measured values of physical quantities obtained by sensors or acquisition devices at different times, such as voltage, current, and vibration amplitude. These are discrete digital samples resulting from continuous analog signals after analog-to-digital conversion. Carrier frequency information refers to the main frequency (i.e., carrier frequency) of the signal corresponding to the current sampling moment. It is usually provided by an external system (such as a motor controller, communication modulator, or physiological signal generator) or estimated through real-time spectrum analysis algorithms. Each carrier frequency stores corresponding data points to ensure accuracy during subsequent reconstruction. Synchronous recording means that at each sampling moment, not only is the signal amplitude acquired, but the instantaneous carrier frequency at that moment is also obtained and bound. A composite data unit is a data structure that encapsulates the amplitude and carrier frequency together, such as a triple [f]... i A i B i ] or quadruple [f i A i B i C i ], where f i A represents the carrier frequency of the i-th sampling point. i B i The values represent the amplitude of multi-channel signals.
[0022] In practical applications, when acquiring signals under test (such as vibration signals from variable-speed rotating machinery, frequency-drifted wireless communication signals, or non-stationary bioelectrical signals), the acquisition system needs to sample at extremely high rates to ensure signal integrity. The carrier frequency typically represents the maximum sampling rate limit achievable by the data acquisition system. However, the actual carrier frequency is not absolutely stable; it can drift or jitter due to factors such as device aging, temperature changes, Doppler effects, or channel disturbances. Therefore, in this embodiment, a dynamic sampling strategy is adopted: after each signal amplitude acquisition (such as using an ADC module to read the voltage value at a certain moment), the actual carrier frequency f at the current moment is immediately read from the control system or frequency detection module. i And pack the carrier frequency and the current amplitude into a composite data unit [f] i V i Stored in cache or storage medium.
[0023] For example, in the phase current monitoring scenario of a motor drive system, the switching frequency of the PWM waveform output by the controller in real time is used as the carrier frequency f. i In EEG acquisition systems, local dominant frequencies can be estimated online using short-time Fourier transform (STFT) as carrier frequency inputs. All subsequent processing is based on this composite data unit, ensuring that each sampling point carries its corresponding frequency context information, providing a basis for accurate temporal reconstruction.
[0024] The key to this step lies in implementing a time-aligned synchronization mechanism, that is, ensuring the carrier frequency f i With amplitude V i Collect data from the same physical moment or within a time window with negligible delay to avoid introducing additional errors due to asynchronous acquisition.
[0025] S120: Calculate the local period time corresponding to each sampling point based on the carrier frequency information in each composite data unit, and normalize the local period time based on the preset average reference period to obtain the normalized time increment.
[0026] Local period time refers to the period from the current carrier frequency f i The calculated duration of one complete cycle of the signal, i.e., T i =1 / f i Normalization maps the actual periodicity of the time series to a uniform discrete time scale, allowing for subsequent representation of non-uniform time series using a fixed-step index. The preset average reference period is a design parameter denoted as T. avgTypically, a small multiple (such as 0.1 to 0.2 times the minimum period) of the geometric or arithmetic mean over the entire carrier frequency variation range is taken to control the granularity and precision of the final index growth. In specific calculations, if different sampling points are detected to generate the same sequence identifier, the sampling period is further reduced.
[0027] For each composite data unit [f] i V i First, according to formula T i =1 / f i Calculate its corresponding local periodic time T i Because the signal frequency changes with time, T i Since T is a set of non-constant time intervals, directly using it for plotting would result in non-linearity of the horizontal axis and make it difficult to visualize. Therefore, a normalization mechanism is introduced: for each T... i Relative to a selected average reference period T avg Scaling is performed to obtain the normalized time increment Δt. i = T i / T avg .
[0028] For example, if the carrier frequency at a certain point is 50Hz, then T i = 20ms; if T is set avg = 2ms, then Δt i = 10. This means that this point occupies 10 units of time relative to the baseline period. This normalization process converts the period differences at different frequencies into relative time weights in integer or decimal form, facilitating subsequent accumulation calculations.
[0029] It is worth noting that T avg The choice of T needs to balance accuracy and computational efficiency: too large a value will result in insufficient time resolution and loss of high-frequency details; too small a value may lead to an excessively large index, exceeding the range of integer variables or increasing storage overhead. Preferably, T... avg It can be set to the greatest common divisor of the differences between different frequencies to ensure sufficient resolution.
[0030] S130: Accumulate the normalized time increment in a sequential manner. At each step, add the current increment to the fractional part of the previous accumulation and round it to generate the integer index value of the current sampling point, and retain the new fractional part for subsequent calculations.
[0031] The cumulative normalized time increment refers to the accumulation of Δt according to the sampling order. iThe process of rounding down can take the form of flooring, rounding, etc. In one implementation, a strategy of accumulating decimals with carry and rounding is used to suppress long-term accumulated errors. The generated integer index values form a new discrete time axis to replace the original non-uniform timestamps. Retaining the decimal part is to propagate residuals not included in the current index to the next iteration, preventing error accumulation.
[0032] It should be noted that while using precise time information from each sampling point for waveform rendering theoretically preserves higher temporal resolution, this approach significantly increases the complexity of data processing and graphics rendering. Since most display systems and signal processing modules are designed based on equally spaced data, dealing with non-uniform timestamps requires additional calculations such as resampling or dynamic coordinate mapping, severely impacting rendering efficiency and system response speed. Furthermore, storing high-precision time stamps also increases storage overhead.
[0033] In contrast, this scheme constructs a neat integer index sequence through normalization. Although there may be a time quantization deviation of a few tenths of a unit at individual points, this error is imperceptible in the waveform visual presentation and does not produce cumulative offset. More importantly, the resulting data structure can be directly adapted to efficient plotting models and standard algorithm processes, bringing tens of times the performance improvement and several times the space compression effect, making it more suitable for practical engineering application environments.
[0034] To address the cumulative error problem caused by traditional rounding (e.g., multiple 0.4s are always discarded after addition, resulting in an overall offset), this embodiment employs an improved cumulative index generation algorithm. Details are as follows: Initialize two variables: cumulative_index = 0 (integer part, used to generate the final index) and fractional_remainder = 0.0 (floating-point fractional part, used for error compensation).
[0035] Perform the following operation on the i-th sampling point: 1. Calculate the current normalized time increment Δt i = T i / T avg ; 2. Δt i Adding the floating-point fractional part to the sum gives the temporary sum sum = Δt i + fractional_remainder; 3. Round the temporary sum to obtain the incremental index round(sum), add it to the integer part, and get the new index of the current point index_i = cumulative_index; 4. Update fractional_remainder = sum - round(sum) to retain the decimal part for use in the next step.
[0036] For example, suppose the first three Δt i The values are 0.6, 0.7, and 0.8 respectively, with an initial fractional_remainder=0. Point 1: sum=0.6 → round=1, index_1=1, remainder= -0.4 (Note: the remainder after rounding may be negative). Point 2: sum=0.7 + (-0.4)=0.3 → round=0, index_2=1, remainder=0.3; Point 3: sum=0.8 + 0.3=1.1 → round=1, index_3=2,remainder=0.1. This mechanism avoids data distortion caused by accumulated errors, thereby improving the temporal consistency and physical authenticity of long-term series.
[0037] S140, rearrange the composite data units according to the integer index value to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, so as to reconstruct the waveform.
[0038] The aforementioned integer index values constitute a new equally spaced time axis, similar to the time index sequence under a traditional fixed sampling rate. This allows the same drawing and storage framework to be used, enabling data to be differentiated during the preprocessing stage without the need for differentiation during waveform reconstruction, thus improving processing efficiency.
[0039] After processing by S130, each original sampling point is assigned a unique integer index, which represents its relative position on the reconstructed time axis. Next, a target array D[index] is constructed with the index as the key, and the corresponding amplitude V is... i Write it to this location.
[0040] If multiple points are mapped to the same index, causing a conflict, an error alarm is triggered, indicating an unreasonable parameter configuration. The average carrier frequency reference is then lowered, and the index value is recalculated until all sampling points can be uniquely mapped to different index positions, ensuring the independence and accuracy of each valid data point on the time axis. If some indices have no corresponding data, creating data gaps, since the actual collected data is discrete, intervals of 1ms or 5ms can be represented by connecting valid points with broken lines during plotting, without the need to construct a continuous sequence by adding points. In this case, conventional waveform plotting functions (such as MATLAB plot, Python matplotlib) can be directly called to visualize the sequence. Although the horizontal axis of the resulting graph is still equidistant, the actual time it represents has been correctly mapped, thus accurately presenting the periodic compression and stretching phenomena during signal frequency changes. In addition, whether to smooth the original signal should be treated as a separate data analysis operation, completed at the original channel level, and directly introduced into waveform plotting during the waveform reconstruction stage.
[0041] Furthermore, considering that carrier frequency information typically represents the duration of the next cycle, the implementation needs to misalign the time axis, that is, the carrier frequency f_ at the i-th point... i The time interval associated with the (i+1)th sampling point.
[0042] In summary, the four steps described above collectively achieve a complete process from non-uniform dynamic sampling data to a time-accurate reconstructed waveform. This method captures frequency variation details without relying on high sampling rates, preserves key context through a composite storage of "carrier frequency + amplitude," eliminates accumulated biases using an error-compensated cumulative indexing algorithm, and outputs a standard data format compatible with traditional plotting systems without requiring modifications to existing software architecture. Therefore, it is suitable for signal acquisition and playback needs with significant frequency fluctuations in fields such as motor control, power electronics, biomedical engineering, and communication signal monitoring.
[0043] For ease of understanding, the waveform reconstruction method based on dynamic sampling frequency provided in the embodiments of this application will be described in detail below.
[0044] The above-mentioned acquisition of raw signal data at multiple sampling times, and synchronous recording of carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude, may include the following steps 2-1 to 2-3 in specific implementation: Step 2-1: Obtain the raw signal data at each moment and synchronously record the carrier frequency information at the corresponding moment during each acquisition.
[0045] In this embodiment, whenever a sampling action is triggered, the acquisition system first reads the signal amplitude of one or more channels (such as the current of phase A, phase B, and phase C) through the ADC module, and at the same time immediately reads the carrier frequency at the current moment from the communication interface (such as SPI, I²C, CAN bus) or the on-chip frequency detection unit. For example, in a motor drive testing scenario, the controller updates the PWM frequency as the carrier frequency output every cycle. Meanwhile, the acquisition device synchronously acquires the current value and receives the current frequency command at each rising edge of the PWM, forming a complete time-amplitude-frequency triplet. This synchronization mechanism can be implemented using hardware trigger signals or timestamps, ensuring that each data point in subsequent processing has complete contextual information.
[0046] Step 2-2: Pack the carrier frequency information corresponding to the sampling point and the amplitude of the multi-channel signal into a fixed-length data frame, and encode the carrier frequency information into one byte to generate a composite data unit.
[0047] To improve storage efficiency and adapt to the resource constraints of embedded systems, this embodiment employs a data compression strategy: mapping continuous carrier frequencies to an 8-bit integer field [0, 255]. The specific method is as follows: Set the minimum possible carrier frequency f in the system. min and maximum carrier frequency f max (e.g. f) min = 20Hz, f max =200Hz), then any current carrier frequency f i Linear quantization is performed using the following formula: encoded_freq = round(( (f i -f min ) / (f max -f min () ) × 255), during decoding, the inverse operation can be used to recover the approximate frequency value: decoded_f i = f min +(encoded_freq / 255) × (f max -f min Quantization error can be mitigated by appropriately selecting f. min and f max Keep it within an acceptable range (e.g., within ±1%).
[0048] Subsequently, the encoded 1-byte carrier frequency is combined with the signal amplitudes of multiple channels (such as three 16-bit integers) to form a fixed-length data frame, for example, in the format: [freq_byte(1B), A_phase(2B), B_phase(2B), C_phase(2B)], with a total length of 7 bytes. This data frame is also the composite data unit mentioned above.
[0049] This encapsulation method preserves key frequency context information while achieving compact storage, making it particularly suitable for applications involving long-term continuous acquisition or multi-channel parallel recording.
[0050] Steps 2-3: The composite data units are stored in a non-volatile storage medium in the order of acquisition.
[0051] Each generated composite data unit is immediately appended to a pre-allocated storage area upon creation, using a sequential write mode to maximize write speed and reduce fragmentation. Buffering mechanisms (such as double-buffered queues) can be enabled during storage to handle sudden high-volume data streams and prevent data loss due to I / O latency.
[0052] For example, in vehicle vibration monitoring systems, the acquisition module continuously writes thousands of composite data units per second into the built-in Flash chip; in medical devices, the data can be saved to a microSD card in real time for doctors to access later.
[0053] Furthermore, to facilitate later analysis, metadata information can be added to the file header, such as sampling start time, minimum / maximum carrier frequency range, number of channels, and data frame format definition. The entire storage process requires no additional resampling; it only saves the original observation results and their frequency context, preserving the signal's authenticity to the greatest extent possible and providing a reliable foundation for subsequent high-fidelity waveform reconstruction.
[0054] This implementation not only solves the problem of plotting distortion caused by ignoring frequency changes in traditional waveform storage, but also takes into account practicality, efficiency and engineering feasibility, and has the potential to be widely used in multiple fields such as motor control, power electronics, biomedicine, and communication testing.
[0055] Furthermore, the above-mentioned calculation of the local period time corresponding to each sampling point based on the carrier frequency information in each composite data unit, and the normalization of the local period time based on the preset average reference period to obtain the normalized time increment, may include the following steps 2-1 and 2-2 in specific implementation: Step 2-1: Convert the carrier frequency value in each composite data unit into the corresponding period time, and calculate the local period time of the sampling point.
[0056] In this embodiment, each sampling point input to the model is organized in the form of a "composite data unit," which contains at least the original observation and the carrier frequency information acquired synchronously. The carrier frequency refers to the main oscillation frequency component of the signal at that sampling moment, and can be obtained through Hilbert transform to extract the instantaneous frequency, wavelet ridge analysis, or time-frequency analysis methods based on empirical mode decomposition (EMD).
[0057] For the i-th composite data unit D i = (x i , f i ), where x i f represents the raw observation value at time i. i The local period time T of the sampling point represents the carrier frequency value at the corresponding time (unit: Hz). i It is defined as the reciprocal of its carrier frequency.
[0058] The local periodic time T i This dynamic period estimation is used to characterize the time required for a signal to complete one full periodic oscillation near the i-th sampling point, and has a clear physical meaning. Compared with the traditional fixed sampling interval assumption, this dynamic period estimation can more realistically reflect the changing trend of signal rhythm, and is especially suitable for modeling non-stationary processes such as ECG RR interval fluctuations, EEG alpha wave frequency drift, and rotational speed changes of rotating machinery.
[0059] Furthermore, when f i When the value approaches zero or exceeds a reasonable physiological / engineering range, a threshold protection mechanism or a sliding window smoothing strategy can be set to prevent abnormal frequencies from causing numerical instability.
[0060] Step 2-2: Divide the local periodic time by the preset average reference period to normalize it, and obtain the dimensionless time scale coefficient to obtain the normalized time increment.
[0061] This embodiment uses a preset average reference period to unify the local periodic time at different scales into an operable integer index system. The average reference period is a fixed value preset according to the typical frequency range of the overall signal or the system design requirements. It is preferably taken from the reciprocal of the average frequency of the signal, such as the reciprocal of the original carrier frequency average, or empirically selected as 0.1 to 0.2 times the original main frequency, so as to ensure that the normalized time increment is within a reasonable order of magnitude.
[0062] In practice, the normalization process can further include the following steps 2-2-1 and 2-2-2: Step 2-2-1: Determine the preset multiple of the system operating frequency corresponding to the period as the average reference period.
[0063] The system operating frequency refers to the main control clock frequency of the waveform acquisition system or the reference operating frequency of the data processing module (such as the operating clock frequency of an MCU or FPGA), and its period is the reciprocal of that frequency. Let the system operating frequency be f. sys Then its corresponding basic period is: T sys =1 / f sys Based on this, a preset multiple of the basic period is selected as the average reference period T.ref .
[0064] Step 2-2-2: Divide the local periodic time by the average reference period to normalize it, and obtain the dimensionless time scale coefficient to get the normalized time increment.
[0065] Based on the above average reference period T ref The local period time extracted from each composite data unit is normalized as follows, and the result is the "normalized time increment" of the i-th sampling point, which is a dimensionless proportional value representing the relative length of the current signal period with respect to the system-level reference period. This value will be used in the subsequent cumulative index construction process. Specifically, it can be generated by accumulating the integer part to generate an incremental index sequence, while retaining the decimal part to participate in the next round of accumulation, in order to suppress cumulative error.
[0066] Due to the average reference period T ref With a fixed multiple relationship to the system's duty cycle, all normalization operations are performed within the same clock architecture, further enhancing the consistency and predictability of the time mapping. Furthermore, this design facilitates the use of fixed-point arithmetic instead of floating-point arithmetic on resource-constrained embedded platforms, improving computational efficiency and reducing power consumption.
[0067] Furthermore, in the specific implementation, considering the cumulative error problem caused by floating-point operations, the system adopts the method of retaining the cumulative decimal part for compensation processing. That is, only the integer part of each normalized increment is used for index update, while its decimal part is retained in the accumulator to participate in the next calculation, thereby avoiding the accumulation of systematic deviation caused by traditional rounding.
[0068] By performing period conversion on the carrier frequency information in each composite data unit and implementing normalization based on the average reference period, dynamically changing local time scales can be transformed into uniform, controllable dimensionless time increments. This processing not only preserves the non-uniform characteristics of the original signal in the time dimension but also lays the mathematical foundation for subsequently constructing a physically accurate incremental index sequence. Simultaneously, combined with a decimal part retention mechanism, it significantly reduces the cumulative errors caused by floating-point truncation or rounding, ensuring the overall consistency and accuracy stability of the time axis during waveform reconstruction. This method is simple to implement, computationally efficient, and suitable for high-fidelity storage and reconstruction of high-frequency changing signals, demonstrating good engineering practicality and wide applicability.
[0069] Furthermore, the above-mentioned normalized time increment is accumulated sequentially. At each step, the current increment is added to the fractional part of the previous accumulation and rounded to generate the integer index value of the current sampling point, while the new fractional part is retained for subsequent calculations. In specific implementation, this may include the following steps 3-1 to 3-4: Step 3-1: Initialize the cumulative decimal part to zero.
[0070] Before processing the first sampling point, the system sets up a variable to record the accumulated decimal part, and initializes it to 0. This variable is used to store the decimal residuals that are not included in the integer index after each calculation, and will continue to participate in the calculation of subsequent sampling points.
[0071] Step 3-2: For the current sampling point, add its normalized time increment to the cumulative decimal part retained after the iteration of the previous sampling point to obtain the intermediate sum.
[0072] For the currently processed sampling point, its corresponding normalized time increment is added to the cumulative decimal portion retained after the calculation of the previous sampling point, forming a new intermediate value. This intermediate sum includes both the proportional relationship between the current sampling period and the reference period, as well as all previously unreleased decimal deviations. In this way, the system achieves point-by-point transmission and gradual release of error energy, preventing the accumulation of small time offsets over long-term operation that could lead to overall time axis drift.
[0073] Step 3-3: Round down the middle sum to generate the integer index value of the current sampling point.
[0074] The intermediate sum is rounded down, and its integer part is used as the index increment for this step. This increment is then added to the current cumulative index to generate the integer index value corresponding to the current sampling point. This index value represents the relative position of the data point on the reconstruction time axis. Using rounding down instead of rounding to the nearest whole number avoids the oscillation effect caused by alternating positive and negative rounding, making the index growth more stable and reliable. The generated index sequence exhibits non-uniform increasing characteristics, accurately reflecting the temporal density relationship between sampling points at different carrier frequencies.
[0075] Steps 3-4: Subtract the integer part from the sum of the middle values to obtain the new fractional part and save it for calculation of the next sampling point of the current sampling point.
[0076] After removing the integer part from the sum of the intermediate values, the remaining fractional part is extracted and updated into the cumulative fractional part variable, serving as the input parameter for the next sampling point calculation. This fractional part is typically between 0 (inclusive) and 1 (exclusive), preventing numerical overflow and making it suitable for efficient execution in fixed-point arithmetic or resource-constrained embedded systems. By continuously retaining and passing this residual information, the system achieves fine compensation for minute time differences, significantly reducing the impact of long-term accumulated errors on waveform morphology and improving overall reconstruction accuracy.
[0077] This method achieves high-precision integer index generation during the normalization of time increments in the serialization process by introducing an iterative retention mechanism for the accumulated decimal part. At each step, the method fully considers the impact of historical decimal residuals, avoiding the accumulation of systematic biases caused by traditional truncation or rounding methods, and significantly improving the overall consistency and local accuracy of the time axis during waveform reconstruction. The generated index sequence not only maintains an increasing regularity but also accurately reflects the non-uniform time interval characteristics under dynamic changes in signal frequency, meeting the requirements for subsequent display in fixed-period plotting software. Furthermore, the algorithm has a simple structure, involving only basic arithmetic operations, making it easy to implement efficiently in embedded systems or high-performance acquisition devices. It possesses good engineering practicality and wide applicability, especially suitable for dynamic signal processing scenarios with extremely high time resolution requirements, such as motor drives, bioelectrical signal analysis, and vibration monitoring of variable-speed machinery.
[0078] Furthermore, the above-mentioned rearrangement of composite data units based on integer index values to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, for waveform reconstruction, may include the following steps 4-1 and 4-3 in specific implementation: Step 4-1: Sort each composite data unit in sequence according to its corresponding integer index value to generate a coefficient index sequence; wherein, the index difference between adjacent valid data points in the sparse index sequence is used to characterize their true time interval.
[0079] In this embodiment, the integer index value is not an equally spaced, incrementing time sequence number (such as 1, 2, 3, ...), but rather an integer quantization index calculated based on the actual carrier frequency corresponding to each sampling point, reflecting the relative position of that point on the global time axis. This index value is derived from the proportional relationship between the cumulative period time and the average carrier frequency, and avoids the cumulative error problem caused by floating-point operations by retaining the decimal part and gradually accumulating and rounding it. The resulting index is a discontinuous, skip-order integer sequence, thus generating the aforementioned sparse index sequence.
[0080] By generating this sparse index sequence, not every point occupies an independent array position, allowing for gaps in the middle, only retaining the positions of actual sampled data. The difference in the index between two adjacent valid data points (e.g., from index 2 to index 7) reflects the true time span between these two sampling moments. This method differs from the forced uniform distribution under the traditional fixed-period assumption; instead, it encodes time interval information using index differences, thus realistically reproducing the dynamic characteristics of the signal under frequency conversion conditions.
[0081] During waveform reconstruction, the system first reads the stored set of composite data units. Each unit contains a set of original sampled values (such as the three-phase signal values of A, B, and C) and the carrier frequency information acquired synchronously with them. Based on the preset average carrier frequency reference (usually 0.1 to 0.2 times the original carrier frequency range to ensure sufficient resolution), and combined with the actual period time converted from the carrier frequency at each point, the system calculates the corresponding integer index value point by point.
[0082] In one specific calculation method, a cumulative decimal point variable is first initialized to record the cumulative time fraction. For each sampling point, its current carrier frequency is converted into the period time, divided by the average carrier frequency to obtain a decimal value, which is added to the cumulative decimal point. The sum is then rounded down to obtain the incremental index, and the integer index value of the current point is updated to the previous point index plus the increment. Subsequently, the cumulative decimal point is updated to its fractional part for use by the next point.
[0083] After calculating the indexes for all points, all composite data units are sorted in ascending order based on these integer index values, generating an index-ordered but potentially discontinuous data sequence, also known as a sparse index sequence. For example, if three points are assigned indices 2, 6, and 12 respectively, it indicates that the time intervals between them are approximately 4 units and 6 units (based on the time corresponding to the average carrier frequency). In this case, although index positions 3, 4, 5, and 7-11 are empty, this does not affect data integrity; on the contrary, it improves storage efficiency and physical consistency.
[0084] Step 4-2: Output the sparse index sequence to the waveform display module. The waveform display module adjusts the horizontal axis time scale according to the index value and draws the corresponding data points in a line manner to reconstruct the waveform.
[0085] After generating the aforementioned sparse index sequence, it is passed as a whole to the waveform display module. This waveform display module has the ability to parse this special format, identify the integer index value associated with each composite data unit, and use it as the basis for the horizontal axis.
[0086] The waveform display module traverses the sparse index sequence, extracting the index value and corresponding signal amplitude (such as the voltage value of phase A) for each point. Then, it determines the absolute position of each point on the horizontal axis of the screen based on the relative difference between the index values. For example, if each index unit corresponds to Δt milliseconds, then index 2 is located at 2×Δt, index 7 is located at 7×Δt, and the distance between them is 5×Δt, which truly reflects their sampling time difference.
[0087] Subsequently, these located data points are connected sequentially with a polyline to form a complete waveform curve. Since the connections only occur between actual existing sampling points, and the horizontal axis is stretched according to the true time difference, the final waveform accurately reproduces the original signal in terms of period, frequency, and phase variation trends. It is worth noting that this method is explicitly different from existing methods that fill blank indices with invalid values. Existing methods not only significantly increase storage overhead but also mislead subsequent analysts into misjudging signal density. This solution achieves an efficient, accurate, and highly interpretable waveform reconstruction path by preserving the sparse structure and accurately mapping time differences.
[0088] Furthermore, the carrier frequency information at the current sampling moment is assigned to the composite data unit corresponding to the previous sampling point. Firstly, during data acquisition, each sampling moment not only records the amplitude information of the current signal (such as the values of channels A, B, and C), but also simultaneously measures and acquires the corresponding carrier frequency value. However, the period length represented by this carrier frequency value does not apply to the current sampling instant, but rather reflects the signal periodic characteristics from the previous sampling point to the current sampling point.
[0089] Therefore, when constructing the composite data unit, the system does not directly assign the carrier frequency measured at the current moment to the data structure of the current sampling point. Instead, it uses it as a supplement to update the carrier frequency field in the composite data unit of the previous sampling point. That is, when the (i+1)th sampling point is acquired, its measured carrier frequency value is backfilled into the composite data unit corresponding to the i-th sampling point, forming a complete [carrier frequency, A, B, C] structure.
[0090] This operation can be completed in real time during the data storage stage, or it can be performed centrally during the preprocessing stage before waveform reconstruction. It is suitable for various embedded acquisition devices and host computer analysis systems.
[0091] This method achieves precise mapping between the carrier frequency and the signal period by properly aligning the carrier frequency information in the time dimension. This approach corrects the timing misalignment problem caused by traditional synchronization assignment and fundamentally avoids index calculation deviations and waveform distortion caused by mismatched reference periods.
[0092] Figure 2 The overall processing flow is demonstrated, including carrier frequency and data acquisition, waveform reconstruction, and waveform plotting. Specifically, carrier frequency information is recorded simultaneously with data acquisition, and both are compressed into a single byte. Before opening the waveform, data reconstruction is performed based on the carrier frequency, ultimately integrating it into a well-structured data structure.
[0093] The carrier frequency recovery algorithm is the key to this embodiment. Traditional oscilloscopes plot all points in the array at a fixed period. There are two approaches to improving this: one is to directly convert the data to absolute time and adjust the plotting method so that the recovered waveform is presented in the form of (absolute time, numerical value). However, this method involves significant modifications, and because the carrier and non-carrier waveforms are opened in the same software, it significantly reduces plotting efficiency. Therefore, this patent adopts the second approach, which still assumes a fixed waveform period and converts the current value into an index value within that period.
[0094] In this process, it is crucial to address the error problem. Since the carrier frequency is always an integer, the calculated period interval is often a decimal, and the period corresponding to different carrier frequencies may contain multiple decimal places, making it difficult to determine a suitable common period. Simply rounding will introduce accumulated errors, leading to timing distortion.
[0095] Furthermore, correctly handling decimal precision in carrier frequency conversion requires a thorough analysis of business requirements. The waveform being analyzed typically contains tens of thousands of data points; therefore, the periodic precision of individual points has a limited impact on the overall result. The key is to avoid accumulated errors. Based on this, a "merging and rounding method" can be used. This involves summing the values of all previous points and rounding them once when calculating the index of each point. This method controls the absolute error at each point, ensuring the overall physical consistency of the waveform, and is easy to implement. Demonstration has shown that the impact of this processing method on the analysis results is negligible.
[0096] In index calculation, if the period is fixed, the index sequence is a series of consecutive integers such as 1, 2, 3, 4, 5, etc. For dynamic carrier frequencies, to reflect the interval changes, the average carrier frequency needs to be appropriately reduced, for example, set to 0.1 to 0.2 times the original value, with the expected index sequence being 1, 6, 12, 17, 25. The index calculation formula for each point is: (cumulative period time + current carrier frequency corresponding period time) / average carrier frequency, rounded down. In practical applications, to improve calculation efficiency and prevent numerical overflow, only the remainder of the cumulative period time is retained, and the index calculation is adjusted to: cumulative index + (cumulative decimal part + current carrier frequency corresponding period time / average carrier frequency) rounded down, followed by updating the cumulative decimal part.
[0097] Through the above processing, the final waveform data obtained is an increasing array with a fixed period.
[0098] In addition, it should be noted that since the carrier frequency information corresponds to the current period, the time and sampling point need to be shifted backward by one point.
[0099] In summary, the waveforms drawn using the above method avoid deviations and improve the accuracy of the drawing.
[0100] Based on the above method embodiments, this application also provides a waveform reconstruction device based on dynamic sampling frequency, see [link to relevant documentation]. Figure 3 As shown, it includes: The data acquisition module 310 is used to acquire raw signal data at multiple sampling times and synchronously record the carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude. The normalization module 320 is used to calculate the local period time corresponding to each sampling point based on the carrier frequency information in each composite data unit, and to normalize the local period time based on the preset average reference period to obtain the normalized time increment. The index generation module 330 is used to accumulate the normalized time increment in a sequential manner. In each step, the current increment is added to the fractional part of the previous accumulation and then rounded to generate the integer index value of the current sampling point, while retaining the new fractional part for subsequent calculations. The waveform reconstruction module 340 is used to rearrange and fill the composite data units according to the integer index value to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, so as to reconstruct the waveform.
[0101] In one feasible implementation, the data acquisition module 310 is specifically used for: Acquire raw signal data at multiple sampling times and synchronously record the carrier frequency information at the corresponding time during each acquisition; The carrier frequency information corresponding to each sampling point is packaged with the multi-channel signal amplitude into a fixed-length data frame, and the carrier frequency information is encoded into one byte to generate a composite data unit. Composite data units are stored in a non-volatile storage medium in the order of acquisition.
[0102] In one feasible implementation, the normalization module 320 is specifically used for: The carrier frequency value in each composite data unit is converted into the corresponding period time, and the local period time of that sampling point is calculated. The local periodic time is normalized by dividing it by the preset average reference period to obtain a dimensionless time scaling factor, which is then used to obtain the normalized time increment.
[0103] In one feasible implementation, the normalization module 320 is further configured to: The preset multiple of the system operating frequency corresponding to the period is determined as the average reference period; The local periodic time is normalized by dividing it by the average reference period to obtain a dimensionless time scaling factor, which is then used to obtain the normalized time increment.
[0104] In one feasible implementation, the index generation module 330 is specifically used for: Initialize the cumulative decimal part to zero; For the current sampling point, add its normalized time increment to the cumulative decimal part retained after the iteration of the previous sampling point to obtain the intermediate sum; Round the middle value down to generate the integer index value of the current sampling point; Subtract the integer part from the sum of the middle values to obtain the new fractional part, and save it for the calculation of the next sampling point of the current sampling point.
[0105] In one feasible implementation, the waveform reconstruction module 340 is specifically used for: Each composite data unit is sorted sequentially according to its corresponding integer index value to generate a sparse index sequence; wherein, the index difference between adjacent valid data points in the sparse index sequence is used to characterize their actual time interval. The sparse index sequence is output, and the waveform display module adjusts the horizontal axis time scale according to the index value and draws the corresponding data points in a line manner to reconstruct the waveform.
[0106] In one feasible implementation, the apparatus further includes: a deletion module, configured to: The carrier frequency information at the current sampling time is assigned to the composite data unit corresponding to the previous sampling point.
[0107] The waveform reconstruction device based on dynamic sampling frequency provided in this application has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the embodiment of the waveform reconstruction device based on dynamic sampling frequency can be referred to the corresponding content in the aforementioned waveform reconstruction method embodiment based on dynamic sampling frequency.
[0108] This application also provides an electronic device, such as... Figure 4 The diagram shows the structure of the electronic device 100, which includes a processor 41 and a memory 40. The memory 40 stores computer-executable instructions that can be executed by the processor 41. The processor 41 executes the computer-executable instructions to implement any of the above-mentioned waveform reconstruction methods based on dynamic sampling frequency.
[0109] exist Figure 4 In the illustrated embodiment, the electronic device further includes a bus 42 and a communication interface 43, wherein the processor 41, the communication interface 43, and the memory 40 are connected via the bus 42.
[0110] The memory 40 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 43 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 42 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 42 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0111] Processor 41 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 41 or by instructions in software form. Processor 41 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory. The processor 41 reads the information in the memory and, in conjunction with its hardware, completes the steps of the waveform reconstruction method based on dynamic sampling frequency in the aforementioned embodiment.
[0112] This application also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the aforementioned waveform reconstruction method based on dynamic sampling frequency. For specific implementation details, please refer to the foregoing method embodiments, which will not be repeated here.
[0113] The waveform reconstruction method, apparatus, electronic device, and computer program product based on dynamic sampling frequency provided in this application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0114] Unless otherwise specifically stated, the relative steps, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application.
[0115] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, 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 portion 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 described in 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.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A waveform reconstruction method based on dynamic sampling frequency, characterized in that, include: The system acquires raw signal data at multiple sampling times and synchronously records the carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude. The local period time corresponding to each sampling point is calculated based on the carrier frequency information in each composite data unit, and the local period time is normalized based on the preset average reference period to obtain the normalized time increment. The normalized time increment is accumulated sequentially. At each step, the current increment is added to the fractional part of the previous accumulation and then rounded to generate the integer index value of the current sampling point, while the new fractional part is retained for subsequent calculations. The composite data units are rearranged according to the integer index value to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, so as to reconstruct the waveform.
2. The waveform reconstruction method based on dynamic sampling frequency according to claim 1, characterized in that, The system acquires raw signal data from multiple sampling times and synchronously records the carrier frequency information at each sampling time, generating a composite data unit containing carrier frequency information and signal amplitude, including: Acquire raw signal data at multiple sampling times and synchronously record the carrier frequency information at the corresponding time during each acquisition; The carrier frequency information corresponding to each sampling point is packaged with the multi-channel signal amplitude into a fixed-length data frame, and the carrier frequency information is encoded into one byte to generate a composite data unit; The composite data units are stored in a non-volatile storage medium in the order of acquisition.
3. The waveform reconstruction method based on dynamic sampling frequency according to claim 1, characterized in that, The local period time corresponding to each sampling point is calculated based on the carrier frequency information in each composite data unit, and the local period time is normalized based on a preset average reference period to obtain the normalized time increment, including: The carrier frequency value in each composite data unit is converted into the corresponding period time, and the local period time of that sampling point is calculated. The local periodic time is divided by a preset average reference period for normalization to obtain a dimensionless time scaling factor, which is then used to obtain the normalized time increment.
4. The waveform reconstruction method based on dynamic sampling frequency according to claim 3, characterized in that, The local periodic time is normalized by dividing it by a preset average reference period to obtain a dimensionless time scaling factor, and the normalized time increment is obtained, including: The preset multiple of the system operating frequency corresponding to the period is determined as the average reference period; The local periodic time is divided by the average reference period for normalization to obtain a dimensionless time scaling factor, which is then used to obtain the normalized time increment.
5. The waveform reconstruction method based on dynamic sampling frequency according to claim 1, characterized in that, The normalized time increment is accumulated sequentially. At each step, the current increment is added to the fractional part of the previous accumulation, and the result is rounded down to generate the integer index value of the current sampling point. The new fractional part is retained for subsequent calculations. This includes: Initialize the cumulative decimal part to zero; For the current sampling point, add its normalized time increment to the cumulative decimal part retained after the iteration of the previous sampling point to obtain the intermediate sum; The intermediate sum is rounded down to generate the integer index value of the current sampling point; Subtract the integer part from the intermediate sum to obtain a new fractional part, which is then saved for the calculation of the next sampling point of the current sampling point.
6. The waveform reconstruction method based on dynamic sampling frequency according to claim 1, characterized in that, The composite data units are rearranged according to the integer index value to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, for waveform reconstruction, including: Each composite data unit is sorted sequentially according to its corresponding integer index value to generate a sparse index sequence, wherein the index difference between adjacent valid data points in the sparse index series is used to characterize their true relative time interval. The sparse index sequence is output to the waveform display module, which adjusts the horizontal axis time scale according to the difference in index values and draws adjacent data points as lines to reconstruct the waveform.
7. The waveform reconstruction method based on dynamic sampling frequency according to claim 1, characterized in that, The method further includes: The carrier frequency information at the current sampling time is assigned to the composite data unit corresponding to the previous sampling point.
8. A waveform reconstruction device based on dynamic sampling frequency, characterized in that, include: The data acquisition module is used to acquire raw signal data at multiple sampling times and synchronously record the carrier frequency information at the corresponding time during each acquisition, generating a composite data unit containing carrier frequency information and signal amplitude. The normalization module is used to calculate the local period time corresponding to each sampling point based on the carrier frequency information in each composite data unit, and to normalize the local period time based on the preset average reference period to obtain the normalized time increment. The index generation module is used to accumulate the normalized time increment in a sequential manner. In each step, the current increment is added to the fractional part of the previous accumulation and then rounded to generate the integer index value of the current sampling point, while retaining the new fractional part for subsequent calculations. The waveform reconstruction module is used to rearrange the composite data units according to the integer index value to generate a target data sequence with a uniform index step size and a time interval consistent with the actual sampling period, so as to reconstruct the waveform.
9. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the waveform reconstruction method based on dynamic sampling frequency as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the waveform reconstruction method based on dynamic sampling frequency as described in any one of claims 1 to 7.