Differential spectrum driven short-time Fourier window length dynamic adjustment method and device and storage medium
Through the dynamic adjustment method of short-time Fourier window length driven by differential spectrum, the problems of high computational complexity of the ASTFT algorithm and limited window selection are solved, and the dynamic adjustment of adaptive window length is realized, which improves the efficiency and quality of time-frequency analysis.
Patent Information
- Application Number
- CN202510494672.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The existing adaptive short-time Fourier transform (ASTFT) algorithm has high computational complexity during window parameter optimization, and can only select appropriate windows from a limited set of windows.
A differential spectrum-driven short-time Fourier window length dynamic adjustment method is proposed. By determining the initial value of the adaptive window length and updating the window length based on the differential spectrum between adjacent frames, the window length is realized.
It reduces the computational complexity, improves the efficiency of time-frequency analysis, can effectively adapt to the local time-frequency characteristics of the signal, and provides better time-frequency representation.
Smart Images

Figure CN120011795A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to a method, device and storage medium for dynamically adjusting the length of a short-time Fourier window driven by a differential spectrum. Background Art Time-Frequency Representation (TFR) can transform a one-dimensional time domain signal into a two-dimensional time-frequency domain signal. At present, time-frequency analysis has been widely used in many signal processing scenarios such as biological coding sequence recognition, seismic electrical signal analysis, fault detection, interference monitoring, etc. However, the results of time-frequency analysis are limited by the Heisenberg uncertainty principle. The time domain resolution and frequency domain resolution of the signal cannot be optimized at the same time. The cost of improving the time domain resolution is the decrease of the frequency domain resolution, and vice versa.
[0002] In order to take into account both time domain resolution and frequency domain resolution and make a good compromise between the two, many time-frequency analysis methods have been proposed. Among them, the Short Time Fourier Transform (STFT) has long attracted much attention as a simple and effective linear time-frequency analysis tool. However, due to its fixed time-frequency resolution, the traditional Short Time Fourier Transform has limitations when processing non-stationary signals. In order to overcome this limitation, optimizing the window length to improve the performance of the Short Time Fourier Transform has become a research hotspot. Many scholars have proposed the Adaptive Short Time Fourier Transform (ASTFT) to address this problem.
[0003] Adaptive short-time Fourier transform can flexibly adapt to the local time-frequency characteristics of the signal by dynamically adjusting the window size, providing better time-frequency representation. However, the current ASTFT algorithm still has the following disadvantages: most methods can only select relatively suitable windows from a limited set of windows. In addition, the computational complexity is high in the process of optimizing window parameters. Summary of the invention
[0004] Based on this, it is necessary to provide a short-time Fourier window length dynamic adjustment method driven by a differential spectrum with low complexity and capable of adaptively adjusting the transformation window length in response to the above technical problems. The method includes: determining an initial value of the adaptive window length; transforming a first frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the first frame; transforming a second frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the second frame, wherein there is a preset ratio of overlap between the second frame and the first frame; determining a differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, and updating the adaptive window length based on the differential spectrum; transforming the remaining frames of the signal to be analyzed in sequence based on the updated adaptive window length, and after each transformation, updating the adaptive window length again according to the differential spectrum between the two most recently transformed frames, wherein there is the preset ratio of overlap between adjacent frames; generating a time-frequency analysis result when all frames of the signal to be analyzed are transformed.
[0005] In one embodiment, determining the differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame includes: normalizing the amplitude spectrum of the second frame and the amplitude spectrum of the first frame, respectively, to obtain a second standard value corresponding to the second frame and a first standard value corresponding to the first frame; calculating the difference between the second standard value and the first standard value, to obtain the differential spectrum between the second frame and the first frame.
[0006] In one embodiment, updating the adaptive window length based on the differential spectrum includes: extracting the maximum value of the differential spectrum; comparing the magnitude relationship between the maximum value and a frequency change threshold, and updating the adaptive window length based on the magnitude relationship.
[0007] In one embodiment, the updating of the adaptive window length based on the size relationship includes: when the maximum value is greater than the frequency change threshold, reducing the adaptive window length; when the maximum value is less than the frequency change threshold, increasing the adaptive window length; when the maximum value is equal to the frequency change threshold, not changing the adaptive window length.
[0008] In one embodiment, before the adaptive window length is updated again according to the differential spectrum between the two most recently transformed frames, it includes: obtaining the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame; and calculating the differential spectrum between the two most recently transformed frames based on the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame.
[0009] In one embodiment, the determining the initial value of the adaptive window length includes: obtaining a sampling rate and a frequency sweep rate of a time-frequency analysis; The initial value of the adaptive window length is determined based on the following formula: ; in, represents the sweep rate, represents the sampling rate, Indicates the length of the window function; A value that meets the range of the window function length is selected as the initial value of the adaptive window length.
[0010] The present application also provides a short-time Fourier window length dynamic adjustment device driven by a differential spectrum, the device comprising: a determination module, used to determine an initial value of an adaptive window length; a first transformation module, used to transform a first frame of a signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the first frame; a second transformation module, used to transform a second frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the second frame, wherein there is a preset ratio of overlap between the second frame and the first frame; an update module, used to determine a differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, and update the adaptive window length based on the differential spectrum; a third transformation module, used to transform the remaining frames of the signal to be analyzed in sequence based on the updated adaptive window length, and after each transformation, update the adaptive window length again according to the differential spectrum between the two frames of the latest transformation, wherein there is the preset ratio of overlap between adjacent frames; a generation module, used to generate a time-frequency analysis result when all frames of the signal to be analyzed are transformed.
[0011] In one embodiment, the update module is also used to: normalize the amplitude spectrum of the second frame and the amplitude spectrum of the first frame respectively to obtain a second standard value corresponding to the second frame and a first standard value corresponding to the first frame; calculate the difference between the second standard value and the first standard value to obtain a differential spectrum between the second frame and the first frame.
[0012] In one embodiment, the updating module is further used to: extract the maximum value of the differential spectrum; compare the magnitude relationship between the maximum value and the frequency change threshold, and update the adaptive window length based on the magnitude relationship.
[0013] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method of the above-mentioned embodiment are implemented.
[0014] The differential spectrum-driven short-time Fourier window length dynamic adjustment method provided in this application uses the change of the local amplitude spectrum of the signal as an indication of frequency change, avoiding the high computational cost and complex algorithm required for direct frequency estimation, making the entire process simpler and more efficient. By evaluating the amplitude difference between adjacent time points in the form of a differential spectrum, the rapidly changing part and the relatively stable part of the signal can be effectively identified, thereby dynamically selecting the appropriate window length for each time point. In addition, the method proposed in this article allows a certain range of freedom of choice near the optimal window length, which reduces the computational burden while ensuring the quality of the time-frequency representation. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 Schematic diagram of a process of a short-time Fourier window length dynamic adjustment method driven by differential spectrum in an embodiment; Figure 2 It is a time amplitude diagram of short-time Fourier transform; Figure 3 (a) is a time-frequency diagram of short-time Fourier transform; Figure 3 (b) is a second time-frequency diagram of short-time Fourier transform; Figure 4 A schematic diagram of a process of adaptive short-time Fourier transform in a specific implementation manner; Figure 5 A schematic diagram of a process of adaptively adjusting the window length in a specific implementation manner; Figure 6 is a schematic diagram of an LFM signal in a specific implementation manner; Figure 7 The module diagram of a short-time Fourier window length dynamic adjustment device driven by differential spectrum in one embodiment. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] Fourier Transform (FT) can transform a signal from the time domain to the frequency domain, and intuitively display the frequency components and corresponding amplitudes of the signal through the spectrum diagram. It is an effective tool for spectrum analysis of stationary signals. However, the limitations of FT are obvious. The transformed signal will completely lose information in the time dimension, so it is not suitable for the analysis of non-stationary signals. Time-Frequency Representation (TFR) overcomes the shortcomings of FT and transforms the one-dimensional time domain signal into a two-dimensional time-frequency domain signal. The energy concentration is usually improved compared with the time domain and frequency domain, and the transformed time-frequency diagram contains information about the signal amplitude and instantaneous frequency (IF) changing with time. At present, TFR has been widely used in many signal processing scenarios such as biological coding sequence recognition, seismic electrical signal analysis, fault detection, interference monitoring, etc. However, the results of time-frequency analysis are limited by the Heisenberg uncertainty principle. The time domain resolution and frequency domain resolution of the signal cannot be optimized at the same time. The cost of improving the time domain resolution is the decrease of the frequency domain resolution, and vice versa.
[0019] In order to take into account both time domain resolution and frequency domain resolution and make a good compromise between the two, many time-frequency analysis methods have been proposed. Among them, the short-time Fourier transform (STFT) has long been a focus of attention as a simple and effective linear time-frequency analysis tool. STFT decomposes a non-stationary signal into multiple shorter signal segments that can be regarded as locally stationary by introducing a sliding time window function, performs Fourier transform on each segment, integrates the transform results at different times to obtain the time-frequency spectrum, and achieves the description of signal characteristics. The length of the time window function is a key parameter that determines the performance of STFT. The shorter the window length, the higher the time resolution but the lower the frequency resolution. The longer the window length, the lower the time resolution but the higher the frequency resolution. Traditional STFT generally selects a suitable fixed window function to analyze the entire signal based on experience or window length selection criteria. However, the frequency changes of non-stationary signals at different times may vary significantly. A fixed-length window function will lead to a deterioration of the local time-frequency resolution of the signal. In the time-frequency analysis method, the selection of parameters should be dynamically adjusted according to the characteristics of the signal. Traditional STFT has limitations in processing non-stationary signals due to its fixed time-frequency resolution. In order to overcome this limitation, optimizing the window length to improve the performance of STFT has become a research hotspot. Many scholars have proposed Adaptive Short Time Fourier Transform (ASTFT) to address this problem.
[0020] ASTFT dynamically adjusts the window size to flexibly adapt to the local time-frequency characteristics of the signal and provide better time-frequency representation. The existing ASTFT algorithms are generally divided into two categories: algorithms based on window length selection criteria and algorithms based on instantaneous frequency gradient (IFG). The former selects the appropriate window length moment by moment through a certain optimization criterion. The latter dynamically adjusts the window size by analyzing the instantaneous frequency of the signal and its rate of change. However, the current ASTFT algorithm has made progress in improving TFR performance, but there are two disadvantages: the first is that most methods can only select relatively suitable windows from a limited set of windows; the second is that the computational complexity is high in the process of optimizing window parameters.
[0021] Based on this, the present application proposes a novel adaptive short-time Fourier transform algorithm, which introduces a window length adjustment mechanism based on differential spectrum to achieve flexible adaptation to the local time-frequency characteristics of the signal, reduce the complexity and achieve better time-frequency analysis effect.
[0022] In order to more clearly explain the differential spectrum driven short-time Fourier window length dynamic adjustment method provided in this application, the theoretical background is first introduced: STFT (Short Time Fourier Transform) is defined as the signal In time and frequency The joint distribution on can be expressed in the following form: Formula 1: In formula 1, Indicates the signal to be analyzed. represents the window function, which is usually is a real symmetric function centered at time point , and its amplitude gradually decays with the increase of the distance from the central time point. becomes 0, where is the length of the window function, which determines the trade-off between time resolution and frequency resolution. e is a natural constant, j Represents the imaginary unit. When the window function Fixed time, at a specific moment , Formula 1 calculates The Fourier transform of the signal in the time range corresponds to A local spectrum of the signal near the position. During the duration of the signal, by moving the window function on the time axis, a series of local spectra can be obtained, which together constitute the time-frequency spectrum of the signal changing over time. The schematic diagram of STFT transformation is shown in Figure 2 shown.
[0023] In fact, when performing time-frequency analysis on a signal, it is usually necessary to first convert the continuous signal Convert to discrete signal , so that it can be digitized with the help of computing equipment, the discrete form of STFT is defined as follows: Formula 2: ; In the formula, is the signal to be analyzed, is a discrete window function, Represents the time index, that is, the window number variable, is the frequency index, which is used to identify different frequency components. is the moving step between two adjacent windows, Represents the number of sampling points in each window or the window length. is the total number of windows, which is determined by the signal length, window length, and the degree of overlap between windows.
[0024] When calculating the discrete form of STFT, the Fast Fourier Transformer (FFT) technology can be used to significantly improve the calculation efficiency. As can be seen from Formula 2, the result of STFT will be affected by many factors such as the window function type, window function length, window moving step, and FFT point number. Among them, the choice of window function length is particularly critical, which will directly affect the trade-off between time and frequency resolution. Assuming the sampling rate is , then the frequency resolution and time resolution of the time-frequency diagram obtained based on formula 2 can be expressed as: Formula 3: ; Formula 4: ; From formula 3 and formula 4, we can know that the time resolution and frequency resolution is a pair of contradictory quantities, such as Figure 3 As shown, Figure 3 (a) shows the time-frequency spectrum when a short window is selected. Figure 3 (b) shows the time-frequency spectrum when a long window is selected. When increasing, Reduce As the window length increases, the frequency resolution becomes better and the time resolution becomes worse, and vice versa. Therefore, it is very important to choose the appropriate window length when performing time-frequency analysis on the signal.
[0025] The window function introduced in ASTFT (Adaptive Short-Time Fourier Transform) technology is no longer fixed. It can be adaptively adjusted according to the local dynamic characteristics of the signal to better adapt to the time-frequency characteristics of the signal. The general expression of the discrete form of ASTFT is: Formula 5: ; In formula 5, Indicates the time index and frequency index The ASTFT results at is the window length. Represents an adaptively adjusted discrete window function.
[0026] on the one hand, The window function set can be selected based on the time-frequency aggregation measurement criteria such as information entropy, time-frequency local energy, logarithmic window energy, etc. Select from.
[0027] on the other hand, The optimal window at the corresponding moment can also be directly estimated based on the local frequency change of the signal at each moment. The simplest principle is to select a window function with a smaller window length when the local frequency change rate of the signal is large, and select a window function with a larger window length when the frequency change rate is small. At this time, the window function can be expressed as: Formula 6: ; In formula 6, and are time index and frequency index respectively, It is a preset threshold used to distinguish between "fast" and "slow" frequency changes.
[0028] Assume that the signal to be analyzed It is a non-stationary signal, and its mathematical expression is: Formula 7: ; In formula 7, represents the amplitude of the signal, Represents the phase of a signal, whose magnitude varies over time.
[0029] Signal The instantaneous frequency Defined as: Formula 8: ; Formula 8 is about time Any smooth differentiable function of , whose derivative is bounded.
[0030] At any time Nearby, phase Perform a second-order Taylor expansion and approximate it as: Formula 9: ; Where, Formula 10: ; Formula 11: ; Therefore, the signal exist The vicinity can be approximately expressed as: Formula 12: ; Equation 12 is in the form of a Linear Frequency Modulation (LFM) signal.
[0031] Substituting Formula 10 and Formula 11 into Formula 8, we can obtain: Formula 13: ; In formula 13, express The instantaneous frequency at time, yes The instantaneous frequency change rate at the moment Nearby frequencies vary linearly with time.
[0032] In summary, according to the local characteristics of the signal, any complex non-stationary signal can be transformed into Converted into a series of simple linear frequency modulation signals The combination can be expressed as: Formula 14: ; In formula 14, Represents the signal used to intercept The window function of the segment.
[0033] Essentially, STFT completes time-frequency analysis by applying a window function to the signal to be analyzed moment by moment and performing FFT, and then combining the results of these multiple FFTs to form TFR. According to the characteristics of the selected window function, the STFT algorithm can be simply divided into two categories: if the window function is fixed and independent of the signal itself, it is a traditional STFT; if the window function depends on the signal characteristics and is dynamically adjusted accordingly, it is ASTFT.
[0034] In the prior art, most ASTFT methods rely on direct estimation of frequency-related variables. These methods usually require the application of a series of additional algorithms to accurately estimate the local frequency characteristics of the signal, which undoubtedly increases the computational complexity and implementation difficulty of ASTFT. However, in actual operation, a certain range of fluctuations is allowed when selecting the window length at each moment, and it is not necessary to find the absolute optimal window length. In fact, if the window length is selected within a certain range near the optimal window length, the resulting time-frequency representation (TFR) will not be significantly degraded, so accurate frequency estimation is not necessary.
[0035] Based on this, Figure 1 As shown, the present application provides a differential spectrum driven short-time Fourier window length dynamic adjustment method. It can be understood that the method can be applied to a terminal, a server, or a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps: Step 110, determining an initial value of the adaptive window length; the initial value of the adaptive window length is set to a preset value, and is subsequently adaptively adjusted according to the differential spectrum of the latest two adjacent frames.
[0036] Step 120, transforming the first frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the first frame; wherein the transformation is an FFT transformation (Fourier transform).
[0037] Step 130, transform the second frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the second frame, wherein there is a preset ratio of overlap between the second frame and the first frame; exemplarily, the overlap ratio can be 50%, which means that when the second frame is transformed, the transformation window overlaps the transformation window of the first frame by 50%.
[0038] Step 140, determining a differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, and updating the adaptive window length based on the differential spectrum; Step 150, sequentially transforming the remaining frames of the signal to be analyzed based on the updated adaptive window length, and after each transformation, updating the adaptive window length again according to the differential spectrum between the two most recently transformed frames, wherein there is an overlap of the preset ratio between adjacent frames; Each time a new frame is transformed, a new frame amplitude spectrum is obtained, and then a differential spectrum between the new frame and the previous frame can be obtained. Based on the differential spectrum, the adaptive window length is automatically adjusted in real time, and when the next frame is transformed, the adjusted adaptive window length is used.
[0039] In one embodiment, determining the differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame includes: normalizing the amplitude spectrum of the second frame and the amplitude spectrum of the first frame, respectively, to obtain a second standard value corresponding to the second frame and a first standard value corresponding to the first frame; calculating the difference between the second standard value and the first standard value, to obtain the differential spectrum between the second frame and the first frame.
[0040] In one embodiment, updating the adaptive window length based on the differential spectrum includes: extracting the maximum value of the differential spectrum; comparing the magnitude relationship between the maximum value and a frequency change threshold, and updating the adaptive window length based on the magnitude relationship.
[0041] In one embodiment, the updating of the adaptive window length based on the size relationship includes: when the maximum value is greater than the frequency change threshold, reducing the adaptive window length; when the maximum value is less than the frequency change threshold, increasing the adaptive window length; when the maximum value is equal to the frequency change threshold, not changing the adaptive window length.
[0042] In practical applications, taking into account possible errors in measurement, the maximum value within a certain range near the frequency change threshold can be considered equal, exceeding the upper limit of the range can be considered greater than, and being less than the lower limit of the range can be considered less than.
[0043] In one embodiment, before the adaptive window length is updated again according to the differential spectrum between the two most recently transformed frames, it includes: obtaining the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame; and calculating the differential spectrum between the two most recently transformed frames based on the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame.
[0044] Step 160: When all frames of the signal to be analyzed are transformed, a time-frequency analysis result is generated.
[0045] It should be noted that when receiving a signal, what is actually received is a whole segment of the signal to be analyzed. Each frame in the above method steps refers to a segment corresponding to each transformation window.
[0046] For example, see Figure 4 , set an initial value of the adaptive window length, that is, the initial preset window length , the overlap ratio of adjacent windows is set to 50%, and the frequency change threshold is set , used to determine whether the frequency change is significant and define the window length change control coefficient To adjust the degree of change of the new window length.
[0047] Use the initial preset window length Perform FFT on the first received signal to obtain the amplitude spectrum .
[0048] Use the same window length again , but the window overlaps with the previous one by 50%, and the FFT of the next second signal is performed to obtain the amplitude spectrum .
[0049] calculate and The difference spectrum .
[0050] Detection difference spectrum The maximum value of ,like , indicating that the frequency has changed significantly, which can reduce the length of the new window To improve the time resolution, if , indicating that the frequency is relatively stable and can be increased To improve frequency resolution.
[0051] Use the updated new window length , and continue to perform the FFT operation with a 50% overlap with the previous window, and repeat the process of obtaining the amplitude spectrum and the difference spectrum, and updating the adaptive window length.
[0052] After the processing is completed, the FFT results of all fragments are combined to obtain the TFR (time-frequency analysis) result of the signal to be analyzed.
[0053] See also Figure 5 , the following formula shows the basic principle and mathematical model of the window length adaptive adjustment method proposed in this application.
[0054] Formula 15: ; in, represents the kth segment signal, represents the k+1th segment signal, express of The difference spectrum between .
[0055] Formula 16: ; express of The maximum value of the difference spectrum between .
[0056] Formula 17: ; Indicates the change in window length.
[0057] Formula 18: ; Represents the updated adaptive window length.
[0058] It should be noted that the difference in formula 15 is the normalized value of the amplitude spectrum, which helps to eliminate the impact of different signal strengths and makes the comparison more accurate. Formula 16 extracts the maximum value of the differential spectrum as the characteristic parameter, which simplifies the complex frequency change evaluation process. When the time-frequency representation is quantized, it is necessary to set a memory window of appropriate size based on Formula 17 and introduce the memory effect to adjust the window length change, thereby effectively suppressing the drastic fluctuation of the window length caused by factors such as noise and ensuring the stability and consistency of the time-frequency representation.
[0059] Regarding the determination of the window function and the initial window length, in general, the signal to be analyzed is usually unknown, and the window function has a smaller impact on TFR than the window length. Therefore, in this application, the Hanning window function is selected because it has smaller spectrum leakage and volatility and higher frequency selectivity. The expression of the Hanning window function coefficient is: Formula 19: ; In the formula, is the sample index, is the length of the window function.
[0060] The LFM signal is one of the simplest non-stationary signals, as shown in Formula 12. Its mathematical expression can be written as: Formula 20: ; In the formula, is the initial phase, is the initial frequency, is the rate of change of frequency, represents the signal amplitude, and exp is the natural exponential function. Substituting Formula 20 into Formula 8 yields the instantaneous frequency: Formula 21: ; Represents the instantaneous frequency.
[0061] According to Equation 21, the bandwidth of the LFM signal increases linearly with time. The frequency range covered is ,like Figure 6 shown.
[0062] Ideally, the goal of time-frequency analysis is to obtain the change of instantaneous frequency over time. However, in practice, STFT estimates the change of local spectrum near each certain moment. For LFM signals, the length of The window function is used for windowing, and the sampling frequency is assumed to be ,but: Formula 22: ; Represents the frequency range. The number of sampling points within the frequency range can be expressed as: Formula 23: ; In order to make the actual estimate as close as possible to the ideal situation, it is necessary to satisfy: Formula 24: ; Substituting Formula 24 into Formula 23, we can get the window function length and sampling rate , sweep rate The relationship between: ; Considering that the local characteristics of any non-stationary signal near any time can be approximated as a linear frequency modulation signal, according to formula 25, we must first estimate the frequency change rate near the initial time of the signal. A relatively rough time-frequency diagram is obtained by performing an STFT with a fixed window length as a window function, where Formula 26: ; Extract the frequency versus time curve from the time-frequency plot: Formula 27: ; Represents a time-frequency graph. A linear fit is performed on the curve near the initial time. The slope is calculated to obtain the approximate frequency change rate. .
[0063] In fact, the selection of the initial window length does not need to be particularly accurate, and the value calculated by formula 26 can be directly used. As the initial window length, the algorithm proposed in this application will eventually adaptively adjust to a suitable window length. However, it is more appropriate to determine the initial window length according to formula 25, which can speed up the adaptive process and improve the quality of time-frequency analysis near the initial moment. That is, in one embodiment, the step of determining the initial value of the adaptive window length includes: obtaining the sampling rate and sweep rate of the time-frequency analysis; determining the initial value of the adaptive window length based on formula 25; and selecting a value that meets the range of the window function length as the initial value of the adaptive window length.
[0064] For the determination of the threshold T: The logarithmic window energy criterion optimizes the window length selection problem in STFT by defining a time-frequency aggregation measure, and its mathematical expression is as follows: Formula 28: ; in, The window length is The energy of the window function is calculated as follows: Formula 29: ; According to formula 28, Get the minimum value is considered to be the optimal window length, that is, Formula 30: ; in Represents candidate values for the window length.
[0065] According to formula 21, for any given linear frequency modulation signal, its frequency changes linearly with time, that is, the frequency change rate is a constant, which means that at any time of the signal, the optimal window length selected for STFT should be the same. Therefore, when using STFT to process linear frequency modulation signals, it is very appropriate to adopt the above logarithmic window energy criterion to select the optimal window length.
[0066] In order to further determine the threshold required by the method of the present application, a large number of linear frequency modulation signals with different sweep rates were generated, and the optimal window length was first estimated according to Formulas 28 to 30 based on the logarithmic window energy criterion. Then, the adaptive window length adjustment method proposed in this paper is used to adjust the window length at different thresholds. The corresponding window length is obtained . Assume that exist When it is within the range of 20% above or below, it satisfies: Formula 31: ; The selected window length is considered appropriate. After a large number of simulation experiments, it is found that when the threshold is set to 0.5, it can meet the needs of most cases, thereby obtaining a suitable window length for STFT.
[0067] The above-mentioned differential spectrum driven short-time Fourier window length dynamic adjustment method adaptively adjusts the window length based on the low-complexity STFT window length of the differential spectrum, indirectly estimates the frequency change by analyzing the change of the local signal amplitude spectrum, rather than directly performing complex frequency estimation, and selects the appropriate window length for Fourier transform at each moment, which can obtain better time-frequency analysis results.
[0068] After simulation verification, by combining the indirect estimation of local amplitude spectrum changes with a flexible window length selection mechanism, the final combined time-frequency diagram can accurately reflect the time-frequency characteristics of the original signal. Compared with the traditional STFT algorithm and some ASTFT algorithms, the algorithm proposed in this paper can obtain fine local time-frequency characteristics of the signal under the condition of consuming very little computing resources, demonstrating the feasibility of subsequent real-time ASTFT solution design.
[0069] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0070] Based on the same inventive concept, the embodiment of the present application also provides a differential spectrum driven short-time Fourier window length dynamic adjustment device for implementing the differential spectrum driven short-time Fourier window length dynamic adjustment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more differential spectrum driven short-time Fourier window length dynamic adjustment devices provided below can refer to the limitations of the differential spectrum driven short-time Fourier window length dynamic adjustment device above, and will not be repeated here.
[0071] In an exemplary embodiment, Figure 7 As shown, a short-time Fourier window length dynamic adjustment device driven by differential spectrum is provided, and the device comprises: A determination module 710, configured to determine an initial value of an adaptive window length; A first transformation module 720, configured to transform a first frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the first frame; A second transformation module 730 is used to transform a second frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the second frame, wherein there is a preset ratio of overlap between the second frame and the first frame; An updating module 740 is used to determine a differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, and update the adaptive window length based on the differential spectrum; A third transformation module 750 is used to transform the remaining frames of the signal to be analyzed in sequence based on the updated adaptive window length, and after each transformation, update the adaptive window length again according to the differential spectrum between the two most recently transformed frames, wherein there is an overlap of the preset ratio between adjacent frames; The generating module 760 is used to generate a time-frequency analysis result when all frame transformations of the signal to be analyzed are completed.
[0072] In one embodiment, the updating module 740 is further used to: respectively normalize the amplitude spectrum of the second frame and the amplitude spectrum of the first frame to obtain a second standard value corresponding to the second frame and a first standard value corresponding to the first frame; calculate the difference between the second standard value and the first standard value to obtain a differential spectrum between the second frame and the first frame.
[0073] In one embodiment, the updating module 740 is further used to: extract the maximum value of the differential spectrum; The maximum value is compared with the frequency change threshold value, and the adaptive window length is updated based on the relationship.
[0074] Each module in the above-mentioned time-frequency analysis device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0075] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0076] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0077] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0078] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A short-time Fourier window length dynamic adjustment method driven by differential spectrum, characterized in that: The method comprises: Determine the initial value of the adaptive window length; Transforming a first frame of the signal to be analyzed based on the adaptive window length, obtaining an amplitude spectrum corresponding to the first frame; Transforming a second frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the second frame, wherein there is a preset ratio of overlap between the second frame and the first frame; Determine a differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, and update the adaptive window length based on the differential spectrum; Transforming the remaining frames of the signal to be analyzed in sequence based on the updated adaptive window length, and after each transformation, updating the adaptive window length again according to the differential spectrum between the two most recently transformed frames, wherein there is an overlap of the preset ratio between adjacent frames; When all frame transformations of the signal to be analyzed are completed, a time-frequency analysis result is generated.
2. The method according to claim 1, characterized in that The determining, based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, a differential spectrum between the second frame and the first frame, comprises: Normalizing the amplitude spectrum of the second frame and the amplitude spectrum of the first frame respectively to obtain a second standard value corresponding to the second frame and a first standard value corresponding to the first frame; The difference between the second standard value and the first standard value is calculated to obtain a differential spectrum between the second frame and the first frame.
3. The method according to claim 2, characterized in that The updating of the adaptive window length based on the differential spectrum comprises: extracting the maximum value of the difference spectrum; The maximum value is compared with a frequency change threshold value, and the adaptive window length is updated based on the relationship.
4. The method according to claim 3, characterized in that The updating of the adaptive window length based on the size relationship includes: When the maximum value is greater than the frequency change threshold, reducing the adaptive window length; When the maximum value is less than the frequency change threshold, increasing the adaptive window length; When the maximum value is equal to the frequency change threshold, the adaptive window length is not changed.
5. The method according to claim 1, characterized in that: Before the adaptive window length is updated again according to the differential spectrum between the two frames of the latest transformation, the method comprises: Get the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame; Based on the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame, a differential spectrum between the two most recently transformed frames is calculated.
6. The method according to claim 1, characterized in that The step of determining an initial value of the adaptive window length comprises: Get the sampling rate and sweep rate for time-frequency analysis; The initial value of the adaptive window length is determined based on the following formula: ; in, represents the sweep rate, represents the sampling rate, Indicates the length of the window function; A value that meets the range of the window function length is selected as the initial value of the adaptive window length.
7. A short-time Fourier window length dynamic adjustment device driven by differential spectrum, characterized in that: The device comprises: A determination module, used to determine an initial value of the adaptive window length; A first transformation module, configured to transform a first frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the first frame; A second transformation module, configured to transform a second frame of the signal to be analyzed based on the adaptive window length to obtain an amplitude spectrum corresponding to the second frame, wherein there is a preset ratio of overlap between the second frame and the first frame; An updating module, configured to determine a differential spectrum between the second frame and the first frame based on the amplitude spectrum corresponding to the second frame and the amplitude spectrum corresponding to the first frame, and update the adaptive window length based on the differential spectrum; A third transformation module is used to transform the remaining frames of the signal to be analyzed in sequence based on the updated adaptive window length, and after each transformation, the adaptive window length is updated again according to the differential spectrum between the two most recently transformed frames, wherein there is an overlap of the preset ratio between adjacent frames; The generating module is used to generate the time-frequency analysis result when all the frame transformations of the signal to be analyzed are completed.
8. The device according to claim 7, characterized in that The update module is further used for: Normalizing the amplitude spectrum of the second frame and the amplitude spectrum of the first frame respectively to obtain a second standard value corresponding to the second frame and a first standard value corresponding to the first frame; The difference between the second standard value and the first standard value is calculated to obtain a differential spectrum between the second frame and the first frame.
9. The device according to claim 8, characterized in that The update module is further used for: extracting the maximum value of the difference spectrum; The maximum value is compared with a frequency change threshold value, and the adaptive window length is updated based on the relationship.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Synchronous phasor measurement method based on self-adoption variable window
CN102680785A
Expressway audio vehicle detection device and method thereof
CN102682765A
Ultrasonic echo signal online preprocessing method based on singular spectrum analysis
CN106226407A
Signal analysis method and device based on refined Fourier transform
CN108982964A
Improved synchronous extraction time-frequency analysis method based on adaptive window length
CN113553901A