Differential Spectrum-Driven Short-Time Fourier Window Length Dynamic Adjustment Method, Device, and Storage Medium
Through the differential spectrum-driven short-time Fourier window length dynamic adjustment method, the calculation complexity is reduced, the adaptive window length dynamic adjustment is realized, the existing ASTFT algorithm has solved the problem of high computational complexity, and provided efficient time-frequency analysis results.
Patent Information
- Application Number
- CN202510494672.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The existing adaptive short-time Fourier transform algorithm has high computational complexity during window parameter optimization and can only select windows from a limited set of windows, resulting in limited time-frequency analysis effects.
Through the differential spectrum-driven method, the short-time Fourier window length is dynamically adjusted, the frequency change is indirectly estimated using local amplitude spectrum changes, the calculation complexity is reduced, and the window length is adaptively selected to generate time-frequency analysis results.
Efficient and accurate time-frequency analysis at low computing costs can be realized, and the fast-changing and stable parts of the signal can be identified to ensure the quality of time-frequency representation.
Smart Images

Figure CN120011795B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of signal processing, and in particular, to a method, device, and storage medium for dynamically adjusting the short-time Fourier window length driven by a differential spectrum. Background Art
[0002] Time-frequency analysis (TFR) can transform a one-dimensional time-domain signal into a two-dimensional time-frequency domain signal. Currently, time-frequency analysis has been widely applied in multiple signal processing scenarios such as biological coding sequence recognition, seismic electric signal analysis, fault detection, and interference monitoring. However, the result of time-frequency analysis is limited by the Heisenberg uncertainty principle. It is impossible to achieve the best in both the time-domain resolution and the frequency-domain resolution of the signal simultaneously. The price of improving the time-domain resolution is the decrease in the frequency-domain resolution, and vice versa.
[0003] To simultaneously consider both the time-domain resolution and the frequency-domain resolution and make a better compromise between them, many time-frequency analysis methods have been proposed one after another. Among them, the short-time Fourier transform (STFT), as a simple and effective linear time-frequency analysis tool, has received long-term attention. However, due to its fixed time-frequency resolution, the traditional short-time Fourier transform has limitations in processing non-stationary signals. To overcome this limitation, optimizing the window length to improve the performance of the short-time Fourier transform has become a research hotspot, and numerous scholars have proposed the adaptive short-time Fourier transform (ASTFT) for this problem.
[0004] The adaptive short-time Fourier transform can flexibly adapt to the local time-frequency characteristics of the signal by dynamically adjusting the window size and provide a better time-frequency representation. However, the current ASTFT algorithms still have the following disadvantages: Most methods can only select a relatively appropriate window from a limited set of windows. In addition, the computational complexity is relatively high during the process of optimizing the window parameters. Summary of the Invention
[0005] Based on this, it is necessary to provide a differential spectrum-driven short-time Fourier window length dynamic adjustment method with low complexity and capable of adaptively adjusting the transformation window length for the above technical problems. The method includes: determining an initial value of the adaptive window length; performing a transformation on the first frame of the signal to be analyzed based on the adaptive window length to obtain the amplitude spectrum corresponding to the first frame; performing a transformation on the second frame of the signal to be analyzed based on the adaptive window length to obtain the amplitude spectrum corresponding to the second frame, where there is a preset ratio of overlap between the second frame and the first frame; 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, and updating the adaptive window length based on the differential spectrum; sequentially performing transformations on 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 latest transformed frames, where 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.
[0006] In one embodiment, the 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: respectively normalizing 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; 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.
[0007] In one embodiment, the 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 the frequency change threshold, and updating the adaptive window length based on the magnitude relationship.
[0008] In one embodiment, the updating the adaptive window length based on the magnitude relationship includes: decreasing the adaptive window length when the maximum value is greater than the frequency change threshold; increasing the adaptive window length when the maximum value is less than the frequency change threshold; and not changing the adaptive window length when the maximum value is equal to the frequency change threshold.
[0009] In one embodiment, before updating the adaptive window length again according to the differential spectrum between the two latest transformed frames, it includes: obtaining the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame; calculating the differential spectrum between the two latest transformed frames based on the amplitude spectrum of the current transformed frame and the amplitude spectrum of the previous frame.
[0010] In one embodiment, determining the initial value of the adaptive window length includes: obtaining the sampling rate and the sweep rate of the time-frequency analysis;
[0011] Determining the initial value of the adaptive window length based on the following formula,
[0012] ;
[0013] wherein, represents the sweep rate, represents the sampling rate, represents the window function length;
[0014] Selecting a value that meets the window function length range as the initial value of the adaptive window length.
[0015] This application also provides a differential spectrum-driven short-time Fourier window length dynamic adjustment device. The device includes: a determination module for determining the initial value of the adaptive window length; a first transformation module for transforming the first frame of the signal to be analyzed based on the adaptive window length to obtain the amplitude spectrum corresponding to the first frame; a second transformation module for transforming the second frame of the signal to be analyzed based on the adaptive window length to obtain the amplitude spectrum corresponding to the second frame, wherein there is a preset proportion of overlap between the second frame and the first frame; an update module for 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, and updating the adaptive window length based on the differential spectrum; a third transformation module for 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 latest transformed frames, wherein there is the preset proportion of overlap between adjacent frames; a generation module for generating a time-frequency analysis result when all frames of the signal to be analyzed are transformed.
[0016] In one embodiment, the update module is further configured to: respectively perform normalization processing on 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 the differential spectrum between the second frame and the first frame.
[0017] In one embodiment, the update module is further configured 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.
[0018] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method according to the above embodiments are implemented.
[0019] The short-time Fourier window length dynamic adjustment method driven by differential spectrum provided by the present 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 algorithms required for direct frequency estimation, and making the whole process more simple and efficient. By evaluating the amplitude difference between adjacent time points in the form of differential spectrum, the fast-changing part and the relatively stable part in the signal can be effectively identified, so as to dynamically select an appropriate window length for each time point. In addition, the method proposed in this paper allows a certain range of selection freedom near the optimal window length, ensuring the quality of time-frequency representation while reducing the computational burden. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required to be used in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0021] Figure 1 It is a schematic flowchart of the short-time Fourier window length dynamic adjustment method driven by differential spectrum in an embodiment;
[0022] Figure 2 It is a time-amplitude schematic diagram of the short-time Fourier transform;
[0023] Figure 3 (a) is one of the time-frequency schematic diagrams of the short-time Fourier transform;
[0024] Figure 3 (b) is another time-frequency schematic diagram of the short-time Fourier transform;
[0025] Figure 4 It is a schematic flowchart of the adaptive short-time Fourier transform in a specific embodiment;
[0026] Figure 5 It is a schematic flowchart of the window length adaptive adjustment in a specific embodiment;
[0027] Figure 6 It is a schematic diagram of the LFM signal in a specific embodiment;
[0028] Figure 7 It is a module schematic diagram of the short-time Fourier window length dynamic adjustment device driven by differential spectrum in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to 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.
[0030] The Fourier Transform (FT) can transform a signal from the time domain to the frequency domain, and visually display the frequency components and corresponding amplitude magnitudes of the signal through a spectrogram. It is an effective tool for spectral analysis of stationary signals. However, the limitations of FT are obvious. The transformed signal will completely lose the information in the time dimension. Therefore, it is not suitable for the analysis of non-stationary signals. Time-Frequency Representation (TFR) overcomes the deficiencies of FT, transforms the one-dimensional time-domain signal into a two-dimensional time-frequency domain signal, and the energy concentration is usually improved compared with the time domain and the frequency domain. Moreover, the obtained time-frequency diagram contains information on the variation of the signal amplitude and the instantaneous frequency (IF) with time. At present, TFR has been widely used in many signal processing scenarios such as biological coding sequence recognition, seismoelectric signal analysis, fault detection, and interference monitoring. However, the results of time-frequency analysis are limited by the Heisenberg uncertainty principle. It is impossible to achieve the best in both the time-domain resolution and the frequency-domain resolution of the signal at the same time. The price of improving the time-domain resolution is the decrease of the frequency-domain resolution, and vice versa.
[0031] To simultaneously consider the time-domain resolution and the frequency-domain resolution and make a better compromise between them, many time-frequency analysis methods have been proposed successively. Among them, the Short Time Fourier Transform (STFT), as a simple and effective linear time-frequency analysis tool, has received much attention for a long time. By introducing a sliding time window function, STFT decomposes a non-stationary signal into multiple shorter signal segments that can be regarded as locally stationary, performs Fourier transform on each segment, and integrates the transformation results at different times to obtain a time-frequency spectrum, thereby realizing the description of signal characteristics. The length of the time window function is a key parameter determining 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 and the higher the frequency resolution. Traditional STFT generally selects a suitable fixed window function according to experience or window length selection criteria to analyze the entire signal segment. However, the frequency variation of non-stationary signals may vary significantly at different times, and the fixed-length window function will lead to the deterioration of the local time-frequency resolution of the signal. In time-frequency analysis methods, the selection of parameters should be dynamically adjusted according to the characteristics of the signal. Due to its fixed time-frequency resolution, traditional STFT has limitations in processing non-stationary signals. To overcome this limitation, optimizing the window length to improve the performance of STFT has become a research hotspot, and many scholars have proposed the Adaptive Short Time Fourier Transform (ASTFT) for this problem.
[0032] ASTFT flexibly adapts to the local time-frequency characteristics of the signal by dynamically adjusting the window size, providing a better time-frequency representation. Existing ASTFT algorithms can generally be divided into two categories: algorithms based on window length selection criteria and algorithms based on the Instantaneous Frequency Gradient (IFG). The former selects a suitable window length at each 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, current ASTFT algorithms have made progress in improving TFR performance but have two drawbacks: 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 relatively high during the process of optimizing window parameters.
[0033] Based on this, this application proposes a novel adaptive short-time Fourier transform algorithm, introducing a window length adjustment mechanism based on the differential spectrum, realizing flexible adaptation to the local time-frequency characteristics of the signal, reducing the complexity and having a good time-frequency analysis effect.
[0034] To more clearly explain the differential spectrum-driven dynamic adjustment method of the short-time Fourier window length provided in this application, the theoretical background is first introduced:
[0035] The STFT (Short-Time Fourier Transform) is defined as the joint distribution of a signal in time and frequency and can be specifically expressed as:
[0036] Equation 1:
[0037]
[0038] In Equation 1, represents the signal to be analyzed, represents the window function, which is usually a real symmetric function centered at and whose amplitude gradually decays as the distance from the central time point increases and becomes 0 at , where is the length of the window function, which determines the trade-off between time resolution and frequency resolution, e is the natural constant, j represents the imaginary unit. When the window function is fixed, at a specific moment , what Equation 1 calculates is the Fourier transform of the signal within the time range, corresponding to a local spectrum of the signal near . During the duration of the signal, by moving the window function along the time axis, a series of local spectra can be obtained, and these spectra together constitute the time-frequency spectrogram of the signal varying with time. A schematic diagram of the STFT transformation is as shown in Figure 2 .
[0039] In actual time-frequency analysis of a signal, it is usually first necessary to convert the continuous signal into a discrete signal for digital processing with the aid of computing devices. The discrete form of the STFT is defined as follows:
[0040] Equation 2:
[0041] ;
[0042] In the formula, is the signal to be analyzed, is the discrete window function, represents the time index, i.e., the window number variable, is the frequency index used to identify different frequency components, is the moving step between two adjacent windows, represents the number of sampling points or the window length within each window. is the total number of windows, which is jointly determined by the signal length, the window length, and the degree of overlap between windows.
[0043] When calculating the discrete form of the STFT, the Fast Fourier Transformer (FFT) technology can be used to significantly improve the calculation efficiency. As can be seen from Equation 2, the results of the STFT are affected by multiple factors such as the type of window function, the length of the window function, the window shift step, and the number of FFT points. Among them, the selection of the window function length is particularly crucial, which will directly affect the trade-off between time and frequency resolution. Assuming the sampling rate is , then for the time-frequency diagram obtained based on Equation 2, the frequency resolution and the time resolution can be expressed as follows:
[0044] Equation 3:
[0045] ;
[0046] Equation 4:
[0047] ;
[0048] As can be seen from Equation 3 and Equation 4, the time resolution and the frequency resolution are a pair of conflicting quantities. As shown in Figure 3 , 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 increases, decreases while increases. At this time, the frequency resolution becomes better while the time resolution becomes worse, and vice versa. Therefore, it is crucial to select an appropriate window length when performing time-frequency analysis on a signal.
[0049] In the ASTFT (Adaptive Short-Time Fourier Transform) technology, the introduced window function is no longer fixed. It can adaptively adjust 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:
[0050] Equation 5:
[0051] ;
[0052] In Equation 5, represents the ASTFT result at the time index and the frequency index , is the window length. represents the discrete window function that is adaptively adjusted.
[0053] On the one hand, It can be selected from the window function set according to time-frequency aggregation measurement criteria such as information entropy, time-frequency local energy, and logarithmic window energy. Among them.
[0054] On the other hand, The optimal window at the corresponding moment can also be directly estimated according to 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 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:
[0055] Formula 6:
[0056] ;
[0057] In Formula 6, and are the time index and frequency index respectively, is a preset threshold for distinguishing "fast" and "slow" frequency changes.
[0058] Assume that the signal to be analyzed is a non-stationary signal, and its mathematical expression is:
[0059] Formula 7:
[0060] ;
[0061] In Formula 7, represents the amplitude of the signal, represents the phase of the signal, and its magnitude changes with time.
[0062] The signal The instantaneous frequency is defined as:
[0063] Formula 8:
[0064] ;
[0065] Formula 8 is an arbitrary smooth and differentiable function of time , and its derivative is bounded.
[0066] Near any time , perform a second-order Taylor expansion on the phase , and approximate it as:
[0067] Formula 9:
[0068] ;
[0069] Among them, Formula 10:
[0070] ;
[0071] Formula 11:
[0072] ;
[0073] Therefore, the signal at can be approximately expressed as:
[0074] Formula 12:
[0075] ;
[0076] Formula 12 is in the form of a Linear Frequency Modulation (LFM) signal.
[0077] Substituting Formula 10 and Formula 11 into Formula 8, we get:
[0078] Formula 13:
[0079] ;
[0080] In Formula 13, represents the instantaneous frequency at time is the instantaneous frequency change rate at time. It is easy to see that the frequency changes linearly with time near .
[0081] In summary, according to the local characteristics of the signal, any complex non-stationary signal can be converted into a combination of a series of simple linear frequency modulation signals by piecewise linearization, which can be expressed as:
[0082] Formula 14:
[0083] ;
[0084] In Formula 14, represents the window function used to intercept the th segment of the signal.
[0085] Essentially, STFT completes time-frequency analysis by applying the window function to the signal to be analyzed at each moment and performing FFT, and then combining the results of these multiple FFTs to form the 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 the traditional STFT. If the window function depends on the signal characteristics and is dynamically adjusted accordingly, it is the ASTFT.
[0086] In the prior art, most ASTFT methods rely on the 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, when selecting the window length within a certain range near the optimal window length, the resulting time-frequency representation (TFR) will not deteriorate significantly, so accurate frequency estimation is not necessary.
[0087] Based on this, as Figure 1 shown, the present application provides a differential-spectrum-driven short-time Fourier window length dynamic adjustment method. It can be understood that this 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:
[0088] 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 subsequent adaptive adjustment is performed according to the differential spectra of the latest two adjacent frames.
[0089] Step 120, performing a transformation on the first frame of the signal to be analyzed based on the adaptive window length to obtain the amplitude spectrum corresponding to the first frame; wherein, this transformation is an FFT transformation (Fourier transformation).
[0090] Step 130, performing a transformation on the second frame of the signal to be analyzed based on the adaptive window length to obtain the 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 performing the transformation of the second frame, the transformation window overlaps 50% with the transformation window of the first frame.
[0091] Step 140, 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, and updating the adaptive window length based on the differential spectrum;
[0092] Step 150, performing transformations on 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 frames of the latest transformation, wherein there is the preset ratio of overlap between adjacent frames;
[0093] For each new frame transformation, a new frame of amplitude spectrum will be obtained, and thus the differential spectrum between the new frame and its previous frame can be obtained. Based on this differential spectrum, the adaptive window length is automatically adjusted in real time, and when performing the transformation on the next frame, the adjusted adaptive window length is used.
[0094] 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.
[0095] 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 the frequency change threshold, and updating the adaptive window length based on the magnitude relationship.
[0096] In one embodiment, updating the adaptive window length based on the magnitude relationship includes: reducing the adaptive window length when the maximum value is greater than the frequency change threshold; increasing the adaptive window length when the maximum value is less than the frequency change threshold; and not changing the adaptive window length when the maximum value is equal to the frequency change threshold.
[0097] In practical applications, considering the possible errors during measurement, the maximum value can be regarded as equal within a certain range near the frequency change threshold, greater than the upper limit of this range, and less than the lower limit of this range.
[0098] In one embodiment, before updating the adaptive window length again according to the differential spectrum between the two frames of the latest transformation, it includes: obtaining the amplitude spectrum of the current transformation frame and the amplitude spectrum of the previous frame; calculating the differential spectrum between the two frames of the latest transformation based on the amplitude spectrum of the current transformation frame and the amplitude spectrum of the previous frame.
[0099] Step 160, when all the frame transformations of the signal to be analyzed are completed, generating a time-frequency analysis result.
[0100] 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 the segment corresponding to each transformation window.
[0101] Exemplarily, please refer to Figure 4 , set an initial value of the adaptive window length, that is, the initial preset window length , set the adjacent window overlap ratio to 50%, set the frequency change threshold , used to judge whether the frequency change is significant, and define the window length change amount control coefficient to adjust the change degree of the new window length.
[0102] Use the initial preset window length Perform FFT on the first received signal segment to obtain the amplitude spectrum .
[0103] Use the same window length again , but the window overlaps the previous one by 50%, and perform FFT on the next second signal segment to obtain the amplitude spectrum .
[0104] Calculate and 's differential spectrum .
[0105] Detect the maximum value of the differential spectrum , if , it indicates that the frequency has a significant change, and the new window length can be reduced to improve the time resolution. If , it indicates that the frequency is relatively stable, and can be increased to improve the frequency resolution.
[0106] Use the updated new window length , and continue to perform the FFT operation in the way that the previous window overlaps by 50%, and repeat the process of obtaining the amplitude spectrum and the differential spectrum, as well as updating the adaptive window length.
[0107] After the processing is completed, combine the FFT results of all segments to obtain the TFR (time-frequency analysis) result of the signal to be analyzed.
[0108] Figure 5 It can also be referred to , the following formula shows the basic principle and mathematical model of the window length adaptive adjustment method proposed in this application.
[0109] Formula 15:
[0110] ;
[0111] Wherein, represents the k-th signal segment, represents the (k + 1)-th signal segment, represents 's differential spectrum between and
[0112] Formula 16:
[0113] ;
[0114] represents 's maximum value of the differential spectrum between and
[0115] Formula 17:
[0116] ;
[0117] represents the change in window length.
[0118] Formula 18:
[0119] ;
[0120] represents the updated adaptive window length.
[0121] It should be noted that in Formula 15, the values involved in taking the difference are the normalized values of the amplitude spectrum, which helps to eliminate the influence brought by different signal strengths and makes the comparison more accurate. Formula 16 extracts the maximum value of the difference spectrum as the characteristic parameter, simplifying the complex frequency change evaluation process. When actually estimating the change in window length , it is necessary to set a memory window of appropriate size based on Formula 17, introduce the memory effect to adjust the window length change, so as to effectively suppress the violent fluctuation of the window length caused by factors such as noise, and ensure the stability and consistency of the time-frequency representation.
[0122] For the determination of the window function and the initial window length, generally speaking, the signal to be analyzed is usually unknown, and relative to the window length, the influence of the window function on the TFR is smaller. Therefore, in this application, the Hanning window function is selected because it has smaller spectral leakage and volatility and higher frequency selectivity. The expression of the Hanning window function coefficients is:
[0123] Formula 19:
[0124] ;
[0125] where is the sample index, is the length of the window function.
[0126] The LFM signal is one of the simplest non-stationary signals. In the form of Formula 12, its mathematical expression can be written as:
[0127] Formula 20:
[0128] ;
[0129] where is the initial phase, is the initial frequency, is the frequency change rate, represents the signal amplitude, and exp is the natural exponential function. Substituting Formula 20 into Formula 8 gives the instantaneous frequency:
[0130] Formula 21:
[0131] ;
[0132] represents the instantaneous frequency.
[0133] According to Formula 21, the bandwidth of the LFM signal increases linearly with time. When the signal duration is the covered frequency range is , as Figure 6 shown.
[0134] Ideally, the goal of time-frequency analysis is to obtain the variation of the instantaneous frequency with time. However, in practice, the STFT estimates the local spectral variation near each determined moment. For the LFM signal, using a window function with a length of for windowing and assuming the sampling frequency is , then:
[0135] Formula 22:
[0136] ;
[0137] represents the frequency range, and the number of sampling points within the frequency range can be expressed as:
[0138] Formula 23:
[0139] ;
[0140] To make the actual estimation as close as possible to the ideal situation, it is necessary to satisfy:
[0141] Formula 24:
[0142] ;
[0143] Substituting Formula 24 into Formula 23, the relationship between the window function length and the sampling rate , the frequency sweep rate can be obtained:
[0144] ;
[0145] Considering that the local characteristics of any non-stationary signal near any moment can be approximated as a linear frequency modulation signal, according to Formula 25, first, the frequency change rate near the initial moment of the signal needs to be estimated. Taking as the fixed window length of the window function to perform an STFT once to obtain a relatively rough time-frequency diagram, where,
[0146] Formula 26:
[0147] ;
[0148] Extract the curve of frequency varying with time from the time-frequency diagram:
[0149] Formula 27:
[0150] ;
[0151] Denote the time-frequency diagram, perform a linear fitting on this curve near the initial moment, and calculate the slope to obtain the approximate frequency change rate .
[0152] Actually, the selection of the initial window length does not need to be particularly accurate. The calculated by Formula 26 can be directly used as the initial window length, and the algorithm proposed in this application will finally adaptively adjust to the appropriate window length. However, it is more appropriate to determine the initial window length according to Formula 25, which can accelerate the adaptive process and improve the time-frequency analysis quality near the initial moment. That is to say, 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; selecting a value that meets the window function length range as the initial value of the adaptive window length.
[0153] Regarding the determination of the threshold T:
[0154] The logarithmic window energy criterion optimizes the window length selection problem in STFT by defining a time-frequency concentration metric, and its mathematical expression is as follows:
[0155] Formula 28:
[0156] ;
[0157] Wherein, is the energy of the window function with window length , and its specific calculation formula is:
[0158] Formula 29:
[0159] ;
[0160] According to Formula 28, the that makes obtain the minimum value is considered the optimal window length, that is,
[0161] Formula 30:
[0162] ;
[0163] Wherein Represents the candidate values of the window length.
[0164] According to Equation 21, for any given chirp signal, its frequency changes linearly with time, that is, the magnitude of the frequency change rate is a constant, which means that at any moment of the signal, the optimal window length selected for STFT should be the same. Therefore, when using STFT to process chirp signals, it is very appropriate to adopt the above logarithmic window energy criterion to select the optimal window length.
[0165] To further determine the threshold required for the method of this application, a large number of chirp signals with different sweep rates were generated, and first, based on the logarithmic window energy criterion, the optimal window length was estimated according to Equations 28 to 30. . Subsequently, the adaptive window length adjustment method proposed in this paper was adopted, and at different thresholds the corresponding window lengths were obtained. Assume that when is within 20% above and below , that is, it satisfies:
[0166] Equation 31:
[0167] ;
[0168] then the selected window length is considered appropriate. After a large number of simulation experiments, it was found that when the threshold is set to 0.5, the requirements of most cases can be met, and thus an appropriate window length applicable to STFT can be obtained.
[0169] The above 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 an appropriate window length for Fourier transform at each moment, and can obtain better time-frequency analysis results.
[0170] After simulation verification, by combining the indirect estimation of the local amplitude spectrum change and the flexible window length selection mechanism, the finally 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 scheme design.
[0171] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0172] Based on the same inventive concept, an embodiment of the present application further 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 described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the differential-spectrum-driven short-time Fourier window length dynamic adjustment device provided below can refer to the limitations on the differential-spectrum-driven short-time Fourier window length dynamic adjustment device in the above text, and will not be repeated here.
[0173] In an exemplary embodiment, as Figure 7 shown, a differential-spectrum-driven short-time Fourier window length dynamic adjustment device is provided, and the device includes:
[0174] A determination module 710, configured to determine an initial value of an adaptive window length;
[0175] A first transformation module 720, configured 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;
[0176] A second transformation module 730, 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, where there is a preset proportion of overlap between the second frame and the first frame;
[0177] An update module 740, 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;
[0178] A third transformation module 750 is configured to sequentially perform transformations on the remaining frames of the signal to be analyzed based on the updated adaptive window length. After each transformation, the adaptive window length is updated again according to the differential spectrum between the two most recently transformed frames, where there is a preset proportion of overlap between adjacent frames.
[0179] A generation module 760 is configured to generate a time-frequency analysis result when the transformation of all frames of the signal to be analyzed is completed.
[0180] In one embodiment, the update module 740 is further configured to: respectively perform normalization processing on 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 the differential spectrum between the second frame and the first frame.
[0181] In one embodiment, the update module 740 is further configured to: extract the maximum value of the differential spectrum;
[0182] Compare the magnitude relationship between the maximum value and the frequency change threshold, and update the adaptive window length based on the magnitude relationship.
[0183] Each module in the above time-frequency analysis device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.
[0184] 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 method embodiments are implemented.
[0185] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. 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 methods. Among them, any reference to a 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), magnetoresistive 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. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0186] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered to be within the scope recorded in the present application.
[0187] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for dynamically adjusting the short-time Fourier window length driven by differential spectra, characterized in that 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, where there is a preset proportion of overlap 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, determining a differential spectrum between the second frame and the first frame, and updating the adaptive window length based on the differential spectrum; Successively 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, where there is the preset proportion of overlap between adjacent frames; Generating a time-frequency analysis result when all frames of the signal to be analyzed have been transformed; The 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; The 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.
2. The method according to claim 1, wherein The updating the adaptive window length based on the magnitude relationship includes: Reducing the adaptive window length when the maximum value is greater than the frequency change threshold; Increasing the adaptive window length when the maximum value is less than the frequency change threshold; Not changing the adaptive window length when the maximum value is equal to the frequency change threshold.
3. The method according to claim 1, characterized in that, Before updating the adaptive window length 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; 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.
4. The method according to claim 1, wherein The 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 the following formula, ; Among them, represents the sweep rate, represents the sampling rate, represents the window function length; Selecting a value that meets the window function length range as the initial value of the adaptive window length.
5. A short-time Fourier window length dynamic adjustment device driven by differential spectrum, characterized in that, The apparatus includes: A determination module for determining an initial value of the adaptive window length; A first transformation module for 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; A second transformation module for 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, where there is a preset proportion of overlap between the second frame and the first frame; An update module, configured to determine a difference 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 difference spectrum; A third transformation module, configured to sequentially transform the remaining frames of the signal to be analyzed based on the updated adaptive window length, and after each transformation, update the adaptive window length again according to the difference spectrum between the two latest transformed frames, wherein there is a preset ratio of overlap between adjacent frames; A generation module, configured to generate a time-frequency analysis result when all the frames of the signal to be analyzed are transformed; The update module is further configured 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 the difference spectrum between the second frame and the first frame; The update module is further configured to: Extract the maximum value of the difference 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.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Switch cabinet voiceprint fault detection method based on feature transformation
CN117373484A