Improved fourier fitting method, device and system applied to signal analysis
By optimizing the bias parameters using a Fourier fitting model and a trust region algorithm, and updating the fitting parameters using the least squares method, the problem of low efficiency in the Fourier fitting method is solved, achieving efficient and accurate signal analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN ZHONGQI BIOLOGICAL MEDICAL ELECTRONICS
- Filing Date
- 2022-12-30
- Publication Date
- 2026-05-01
AI Technical Summary
Among existing signal analysis methods, Fourier fitting is inefficient, computationally intensive and complex, and fails to effectively integrate algorithms, resulting in actual operating efficiency that is difficult to achieve as expected.
A Fourier fitting model is adopted, and the bias parameter and period parameter are iteratively optimized through the trust region algorithm. The fitting parameters are updated by combining the least squares method, and the objective function is optimized to improve the fitting accuracy and efficiency.
It significantly reduces computational load and time, improves operational efficiency, possesses good practicality and fitting accuracy, and reduces sensitivity to outliers.
Smart Images

Figure CN115982543B_ABST
Abstract
Description
An improved Fourier fitting method, apparatus, and system for signal analysis. Technical Field
[0001] This invention relates to the field of signal analysis technology, and in particular to a Fourier fitting method, apparatus and system for signal analysis. Background Technology
[0002] With the development of technology, acquiring signals through equipment and digitally analyzing these signals to obtain the desired results has become an indispensable method in many fields. For example, in the medical field, discrete blood pressure signal peak points are collected, and then the peak points are fitted to obtain a continuous curve, thereby obtaining information such as diastolic and systolic blood pressure.
[0003] Currently, many methods exist for fitting discrete points, such as Fourier fitting and Gaussian fitting. Current research mainly focuses on improving these theoretical fitting methods to better suit practical applications. For example, Chinese patent CN105044041A discloses a method for peak location detection of fiber-optic surface plasmon resonance signals based on Gaussian fitting. Given a Gaussian fitting expression with a known number of peaks, it uses the trust region method to find the optimal solution, which is the Gaussian fitting coefficient. Chinese patent application CN109840367A discloses a method and system for fitting fuel costs of thermal power units. Its pre-established piecewise linear optimal fitting optimization model is abstracted into a mathematical form; the trust region algorithm is used to optimize the abstracted mathematical form to obtain the endpoints of the thermal power unit's power generation intervals and the fuel costs at those endpoints.
[0004] However, existing improvements typically use another method to optimize the calculation of all coefficients in the fitting formula. This method seems complex, but it is actually just a stacking of several algorithms. It does not produce any actual fusion or improvement. Furthermore, the optimization of all coefficients, coupled with the stacking of too many complex algorithms, makes the calculation process very time-consuming, and its efficiency is difficult to meet the expected standards in actual operation. Summary of the Invention
[0005] In view of this, it is necessary to provide a Fourier fitting method, apparatus and system for signal analysis to solve the problem of low efficiency of the fitting methods used in signal analysis in the prior art.
[0006] To achieve the above-mentioned technical objectives, the present invention adopts the following technical solution:
[0007] In a first aspect, the present invention provides a Fourier fitting method for signal analysis, comprising:
[0008] Acquire the target signal, and obtain multiple scatter points to be fitted based on the target signal;
[0009] A Fourier fitting model is established based on the scatter points to be fitted. The Fourier fitting model includes multiple fitting parameters, including a period parameter.
[0010] A deviation parameter is established, and an optimization objective function is established based on the Fourier fitting model using the deviation parameter and the period parameter as independent variables. The deviation parameter is used to characterize the difference between the fitting result of the Fourier fitting model and the actual fitting result.
[0011] Based on the optimization objective function, the bias parameters are iteratively optimized using the trust region algorithm, and the fitting parameters are updated based on the optimized bias parameters in each iteration, ultimately obtaining multiple final fitting parameters;
[0012] Based on the Fourier fitting model containing the final fitting parameters, multiple scatter points to be fitted are fitted to obtain the final fitting result, and the signal analysis result is obtained based on the final fitting result.
[0013] Furthermore, based on the optimization objective function, the bias parameters are iteratively optimized using a trust region algorithm, and the fitting parameters are updated based on the optimized bias parameters at each iteration, ultimately yielding multiple final fitting parameters, including:
[0014] Based on the aforementioned deviation coefficient, an improved trust region iteration strategy is established;
[0015] Based on the optimization objective function, the bias parameter is iteratively optimized using the trust region algorithm and in accordance with the improved trust region iteration strategy.
[0016] In each iteration, the fitting parameters in the optimization objective function are updated using the least squares method based on the optimized deviation parameters.
[0017] The fitting parameters updated in the last iteration are the final fitting parameters.
[0018] Furthermore, the improved trust region iteration strategy includes:
[0019] Obtain the historical iteration deviation coefficient, and determine whether to continue iterating based on the numerical change of the historical iteration deviation coefficient;
[0020] At each iteration, based on the updated fitting parameters and the scatter points to be fitted, a descent coefficient is obtained, and the descent coefficient is used to determine whether to continue the iteration.
[0021] Furthermore, the step of obtaining the historical iteration deviation coefficient and determining whether to continue iteration based on the numerical change of the historical iteration deviation coefficient includes:
[0022] If sign(bias) k-1 -bias k-2 )+sign(bias k -bias k-1 If ) = 0, then the iteration ends;
[0023] In the formula, sign() is the sign function, the subscript k represents the iteration number, and bias... k Let bias represent the bias parameter obtained in the k-th iteration. k-2 bias k-1 and bias k All of these are the historical iteration deviation coefficients.
[0024] Furthermore, the step of obtaining a descent coefficient based on the updated fitting parameters and the scatter points to be fitted, and determining whether to continue iteration based on the descent coefficient, includes:
[0025] Based on the updated fitting parameters, the fitting result of the Fourier fitting model and the mean square error between the scatter points to be fitted are obtained.
[0026] The mean square error is saved to the cache queue;
[0027] When the length of the cache queue reaches the preset length, the descent coefficient is obtained based on the cache queue, and it is determined whether to continue iterating based on the descent coefficient.
[0028] Furthermore, the step of obtaining the descent coefficient based on the cache queue and determining whether to continue iteration based on the descent coefficient includes:
[0029] Perform the calculation:
[0030]
[0031]
[0032] f(i) = Error_slope * (ii) max )+Line_normal max
[0033]
[0034] In the formula, Line represents the cache queue, L is the length of the cache queue, and i is the index of the element in the cache queue. iRepresents the i-th element in the cache queue, Line_normal i Line_normal is the weight coefficient corresponding to the i-th element in the cache queue. max Represents all Line_normal i The maximum value in Line_normal min Represents all Line_normal i The minimum value in, i max Represents all Line_normal i The index corresponding to the maximum value in the index, i min Represents all Line_normal i The index corresponding to the minimum value in the table, where Error_slope and Error_index are both descent coefficients;
[0035] The iteration ends when 0 > Error_slope > -0.1 and Error_index <= 1e-2.
[0036] Furthermore, the optimization objective function includes:
[0037]
[0038] In the formula, bias is the deviation parameter, w is the period parameter, i is the Fourier fitting order, N is the total number of scatter points to be fitted, and x i y i These are the x and y coordinates of the i-th scatter point to be fitted, respectively, and a0 is the fitting parameter. i b i The fitting parameters are those corresponding to the i-th scatter point to be fitted.
[0039] Secondly, the present invention also provides a Fourier fitting device for signal analysis, comprising:
[0040] The signal acquisition module is used to acquire the target signal and obtain multiple scatter points to be fitted based on the target signal;
[0041] The model building module is used to build a Fourier fitting model based on the scatter points to be fitted. The Fourier fitting model includes multiple fitting parameters, including a period parameter.
[0042] An optimization startup module is used to establish a deviation parameter, and to establish an optimization objective function based on the Fourier fitting model using the deviation parameter and the period parameter as independent variables, wherein the deviation parameter is used to characterize the difference between the fitting result of the Fourier fitting model and the actual fitting result;
[0043] The iterative optimization module is used to iteratively optimize the deviation parameters according to the optimization objective function using a trust region algorithm, and update the fitting parameters based on the optimized deviation parameters in each iteration, so as to obtain multiple final fitting parameters.
[0044] The fitting analysis module is used to fit multiple scatter points to be fitted according to the Fourier fitting model containing the final fitting parameters to obtain a final fitting result, and to obtain a signal analysis result based on the final fitting result.
[0045] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein,
[0046] Memory, used to store programs;
[0047] The processor, coupled to the memory, executes the program stored in the memory to implement the steps in the Fourier fitting method applied to signal analysis in any of the above implementations.
[0048] Fourthly, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps of the Fourier fitting method applied to signal analysis in any of the above implementations.
[0049] This invention provides a Fourier fitting method, apparatus, and system for signal analysis. First, a target signal is acquired, and multiple scatter points to be fitted are obtained based on the target signal. Then, a Fourier fitting model is established based on the scatter points, including multiple fitting parameters, such as a period parameter. Next, a deviation parameter is established, and an optimization objective function is established based on the Fourier fitting model using the deviation parameter and the period parameter as independent variables. The deviation parameter characterizes the difference between the fitting result of the Fourier fitting model and the actual fitting result. Finally, based on the optimization objective function, the deviation parameter is iteratively optimized using a trust region algorithm, and the fitting parameters are updated based on the optimized deviation parameter in each iteration, ultimately obtaining multiple final fitting parameters. Then, based on the Fourier fitting model containing the final fitting parameters, the multiple scatter points to be fitted are fitted to obtain the final fitting result, and the signal analysis result is obtained based on the final fitting result. Compared to existing technologies, this invention utilizes the inherent characteristics of fitting, sets only two unknowns, significantly reduces computational load and time, and calculates only a single variable using the trust region algorithm, controlling the number of iterations using parameters after each iteration, greatly improving runtime and efficiency, and possessing excellent practicality. Attached Figure Description
[0050] Figure 1 is a flowchart of an embodiment of the Fourier fitting method for signal analysis provided by the present invention;
[0051] Figure 2 is a comparison of the fitting results of an embodiment of the Fourier fitting method for signal analysis provided by the present invention with the fitting results of other prior art.
[0052] Figure 3 is a schematic diagram of an embodiment of the Fourier fitting device for signal analysis provided by the present invention.
[0053] Figure 4 is a schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation
[0054] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0055] In the description of this application, "multiple" means two or more, unless otherwise expressly and specifically defined.
[0056] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0057] This invention uses only the deviation coefficient and periodic parameter as unknown parameters for iterative solution, greatly reducing the computational load and increasing the computational speed. Furthermore, this invention also uses the deviation coefficient as one of the conditions for reducing the step size during trust region algorithm optimization. By controlling the number of iterations through the updated fitting coefficients after each iteration, the iteration strategy is optimized, which not only reduces the computational speed but also improves the trend prediction characteristics of the fitting itself, reduces sensitivity to outliers, and makes the fitting results more accurate.
[0058] Before describing specific embodiments, some algorithms used in this invention will be explained first. It is understood that Fourier fitting, least squares method, trust region algorithm, Taylor expansion, Doggleg method, etc., mentioned below are all existing technologies. Due to space limitations, the meaning of some characters in the formulas is not specifically explained later. These unexplained characters represent parts of the algorithms that this invention has not improved, or substitutions of subscripts, the meaning of which can be understood by those skilled in the art.
[0059] 1. Solve for the fitting parameters in the Fourier fitting model:
[0060] One form of the Fourier fitting formula (i.e., the Fourier fitting model in this embodiment) is as follows:
[0061]
[0062] Let X = [a0, a1, b1, a2, b2, ..., a m ,b m ],Y=[f(x1),f(x2),…,f(x m If ), then the above formula can be expressed as:
[0063] AX = Y
[0064] The rules for using the least squares method must be met:
[0065] X = (A T A) -1 A T Y
[0066] The optimal solution X, i.e., the fitting parameters a0 and a2, can be obtained using the above formula. i b i , where i is the Fourier fitting order.
[0067] 2. Trust Region Algorithm:
[0068] Trust region algorithms transform the process of minimizing f(x, y) into a one-dimensional step size calculation s. k The problem. Among them... By continuously calculating the step size, new x and y values are obtained through iteration. The function m... k (p) represents the function f(x, y) at the point f(x). k ,y k After Taylor expansion, an approximate function is obtained, which is its three terms after expansion, as follows:
[0069] st‖p‖≤Δ k Δ k >0
[0070] In the formula, Δ k >0 is the trust region radius; s k This is a solution to the above equation, denoted as the trial step; g k p is the gradient; p is the independent variable, i.e., the displacement, and also the step size s. k Another notation used during computation.
[0071] It is a first-order gradient. It is a second-order Hession matrix.
[0072] For the above equation, the following also exists:
[0073]
[0074] At this point, how to solve for s? k This becomes a subproblem in calculating the optimal solution, at which point the Doglg method is needed:
[0075] For this subproblem, there exists a globally optimal solution:
[0076] p B =-B -1 g
[0077] At this time, m k The global optimal solution along the negative gradient direction can be expressed as:
[0078]
[0079] In the above formula, p B p U There are two scenarios: outside the trust region and inside the trust region. Here, we can set a limiting condition:
[0080]
[0081] get After (which is equivalent to a trial step), we can directly give the ratio:
[0082]
[0083] Where Δf k =f k -f(x k +s k ), where Δm is the actual decrease in the k-th iteration. k =f k -m(s k ), where r is the predicted decrease in the k-th iteration. This ratio measures how well the quadratic model approximates the objective function. k The closer the value is to 1, the better.
[0084] 3. Steps of the trust region algorithm:
[0085] Given an initial point x0, initialize the trust region radius h0 = ||g0|| and begin iteration.
[0086] Calculate the corresponding g when the calculation reaches the k-th iteration.k With B k .
[0087] Solve the trust region model and use the Doggleg method to find s k Calculate r k .
[0088] If 0 <r k If the value is less than or equal to 0.25, it indicates that the trial step is too large, and the trust region radius should be reduced. In this case:
[0089]
[0090] If r k >=0.75, and s k =h k+1 This indicates that the edge of the trust region has been reached after this trial step, and the step size is relatively small. Therefore, the radius of the trust region can be appropriately increased. At this point:
[0091]
[0092] If 0.25 <= r k If the value is less than or equal to 0.75, the current trust region radius is maintained. In this case:
[0093]
[0094] If r k If the value is less than or equal to 0, it indicates that the function value is starting to rise (i.e., it is not in the direction of finding the minimum point). In this case, the iteration should not continue.
[0095]
[0096] In the above formula, the subscript k represents the iteration number, and h k+1 Let s represent the radius of the trust region at the (k+1)th iteration. k Let x represent the step size obtained in the k-th iteration. k+1 Similarly, the point that was moved in the (k+1)th iteration can be used as the output value of the trust region iteration.
[0097] Based on the above methods, the present invention provides a Fourier fitting method, apparatus, device and storage medium for signal analysis, which are described below.
[0098] Referring to Figure 1, a specific embodiment of the present invention discloses a Fourier fitting method for signal analysis, comprising:
[0099] S101. Obtain the target signal and obtain multiple scatter points to be fitted based on the target signal;
[0100] S102. Establish a Fourier fitting model based on the scatter points to be fitted. The Fourier fitting model includes multiple fitting parameters, including a period parameter.
[0101] S103. Establish a deviation parameter, and use the deviation parameter and the period parameter as independent variables to establish an optimization objective function based on the Fourier fitting model, wherein the deviation parameter is used to characterize the difference between the fitting result of the Fourier fitting model and the actual fitting result.
[0102] S104. Based on the optimization objective function, the deviation parameters are iteratively optimized using the trust region algorithm, and the fitting parameters are updated based on the optimized deviation parameters in each iteration, finally obtaining multiple final fitting parameters;
[0103] S105. According to the Fourier fitting model including the final fitting parameters, fit multiple scatter points to be fitted to obtain the final fitting result, and obtain the signal analysis result based on the final fitting result.
[0104] Compared to existing technologies, this invention utilizes the inherent characteristics of fitting, sets only two unknowns, significantly reduces computational load and time, and calculates only a single variable using the trust region algorithm, controlling the number of iterations using parameters after each iteration, greatly improving runtime and efficiency, and possessing excellent practicality.
[0105] Step S101 can be implemented using any existing means, and its specific implementation methods differ in different fields. The embodiments in this paper all use blood pressure signal measurement as an example to illustrate each step. Specifically, in a preferred embodiment, pulse wave pressure signal (i.e., target signal) is acquired by deflation blood pressure measurement, and the signal peak points (i.e., multiple scatter points to be fitted) are obtained using the difference method.
[0106] Furthermore, as a preferred embodiment, in step S102 of this embodiment, based on the aforementioned multiple signal peak points, a Fourier fitting model as described above is established, where w, a0, and a... i b i All of these are the fitting parameters, and w is the periodic parameter among the fitting parameters.
[0107] In a preferred embodiment, the optimization objective function established in step S103 is:
[0108]
[0109] In the formula, bias is the deviation parameter, w is the period parameter, i is the Fourier fitting order (also the i-th scatter point to be fitted), N is the total number of scatter points to be fitted, and x i y i These are the x and y coordinates of the i-th scatter point to be fitted, respectively, and a0 is the fitting parameter. i b i Let be the fitting parameters corresponding to the i-th scatter point to be fitted. It can be seen that the above formula contains a Fourier fitting model and the fitting parameters within that model. This optimization objective function is mainly used for subsequent optimization using the trust region. In this embodiment, the optimization objective function utilizes the inherent characteristics of fitting, setting only two unknowns, significantly reducing computational load and time.
[0110] Furthermore, in a preferred embodiment, step S104, which involves iteratively optimizing the deviation parameters using a trust region algorithm based on the optimization objective function, and updating the fitting parameters based on the optimized deviation parameters at each iteration to ultimately obtain multiple final fitting parameters, specifically includes:
[0111] Based on the aforementioned deviation coefficient, an improved trust region iteration strategy is established;
[0112] Based on the optimization objective function, the bias parameter is iteratively optimized using the trust region algorithm and in accordance with the improved trust region iteration strategy.
[0113] In each iteration, the fitting parameters in the optimization objective function are updated using the least squares method based on the optimized deviation parameters.
[0114] The fitting parameters updated in the last iteration are the final fitting parameters.
[0115] In this embodiment, only a single variable, namely the deviation parameter, is calculated using the trust region algorithm in each iteration. The least squares method is used to calculate the fitting parameters other than the periodic function, and the updated parameters are used as the parameters for the next iteration. This allows the algorithm to have the advantages of both the trust region algorithm and the least squares method. It can improve the trend prediction characteristics of the fitting itself and reduce the sensitivity to outliers while ensuring the minimization of the mean square error.
[0116] Furthermore, in a preferred embodiment, the improved trust region iteration strategy established by the above process specifically includes:
[0117] Obtain the historical iteration deviation coefficient, and determine whether to continue iterating based on the numerical change of the historical iteration deviation coefficient;
[0118] At each iteration, based on the updated fitting parameters and the scatter points to be fitted, a descent coefficient is obtained, and the descent coefficient is used to determine whether to continue the iteration.
[0119] This embodiment optimizes the trust region criterion by using the deviation coefficient as one of the conditions for step size reduction, thereby reducing the iteration time and the mean square error after fitting.
[0120] Specifically, in a preferred embodiment, the above steps: obtaining historical iteration deviation coefficients and determining whether to continue iteration based on the numerical change status of the historical iteration deviation coefficients, specifically include:
[0121] If sign(bias) k-1 -bias k-2 )+sign(bias k -bias k-1 If ) = 0, then the iteration ends;
[0122] In the formula, sign() is the sign function, the subscript k represents the iteration number, and bias... k Let bias represent the bias parameter obtained in the k-th iteration. k-2 bias k-1 and bias k All of these are the historical iteration deviation coefficients. Clearly, the above conditions can only be applied when the number of iterations is greater than two, and these conditions represent an improvement on existing trust region iteration methods. In this embodiment, in addition to the above rules, existing iteration conditions must still be followed when performing trust region iteration.
[0123] In a preferred embodiment, the above steps—obtaining a descent coefficient based on the updated fitting parameters and the scatter points to be fitted, and determining whether to continue iteration based on the descent coefficient—specifically include:
[0124] Based on the updated fitting parameters, the fitting result of the Fourier fitting model and the mean square error between the scatter points to be fitted are obtained.
[0125] The mean square error is saved to the cache queue;
[0126] When the length of the cache queue reaches the preset length, the descent coefficient is obtained based on the cache queue, and it is determined whether to continue iterating based on the descent coefficient.
[0127] Furthermore, in a preferred embodiment, the above steps: obtaining the descent coefficient based on the cache queue, and determining whether to continue iteration based on the descent coefficient, specifically include:
[0128] Perform the calculation:
[0129]
[0130]
[0131] f(i) = Error_slope * (ii) max )+Line_normal max
[0132]
[0133] In the formula, Line represents the cache queue, L is the length of the cache queue, and i is the index of the element in the cache queue. i Represents the i-th element in the cache queue, Line_normal i Line_normal is the weight coefficient corresponding to the i-th element in the cache queue. max Represents all Line_normal i The maximum value in Line_normal min Represents all Line_normal i The minimum value in, i max Represents all Line_normal i The index corresponding to the maximum value in the index, i min Represents all Line_normal i The index corresponding to the minimum value in the table, where Error_slope and Error_index are both descent coefficients;
[0134] The iteration ends when 0 > Error_slope > -0.1 and Error_index <= 1e-2.
[0135] The present invention also provides a more specific embodiment to more clearly illustrate step S104 above:
[0136] First, an initial value of bias, bias0, is given. Then, the initial value of w, w0, and other initial parameters a are obtained by using the least squares Fourier fit method. 00 a i0 b i0 wait.
[0137] Then it proceeds to the iteration, using the Dogleg method to calculate s. k At this point, the optimized w k bias k (that is, subtract the corresponding s) kSubstitute these parameters back into the least squares Fourier fit to update the Fourier fit parameters a for the k-th iteration. 0k a ik b ik wait.
[0138] After all Fourier fitting parameters are updated, the mean squared error between the fitted function and the coordinates of the scatter plot to be fitted is recalculated and saved to the cache queue Line. When the length of Line reaches L (i.e., the preset length), meaning the number of values in Line reaches L, the decreasing trend of the values in Line is calculated and represented by a decreasing coefficient. The decision to stop the iteration is based on the decreasing coefficient. Substituting the final fitted parameters into the Fourier fitting model yields the final model used for fitting.
[0139] Then, step S105 can be performed: according to the Fourier fitting model including the final fitting parameters, multiple scatter points to be fitted are fitted to obtain the final fitting result, and the signal analysis result is obtained based on the final fitting result. The method for obtaining the signal analysis result based on the final fitting result can be flexibly implemented according to the actual problem. For example, in this embodiment, the maximum value MAX_B of the fitted curve can be obtained using the coefficient method, and the diastolic blood pressure DBP, systolic blood pressure SBP, and mean blood pressure MBP can be obtained on both sides of the maximum value using the coefficient method.
[0140] As shown in Figure 2, the fitting result obtained using the method of this embodiment (i.e., using "trust region + least squares + Fourier fitting") is compared with the fitting results of the prior art using the three methods of "trust region + Fourier fitting" and "least squares + Fourier fitting":
[0141] Table 1 Comparison of Fitting Results
[0142]
[0143]
[0144] As can be seen from Table 1 and Figure 2, although the "least squares + Fourier fitting" method is fast, its accuracy is poor, making it difficult to apply in practice. The "trust region + Fourier fitting" method, on the other hand, has a large data processing volume and excessively long computation time. In contrast, the method in this embodiment yields the highest accuracy, and its computation speed is also satisfactory compared to existing trust region algorithms.
[0145] The advantages of this embodiment are as follows:
[0146] 1. The greatest advantage of this embodiment is that it combines the trust region algorithm with the linear least squares method, which greatly reduces the overall convergence time and significantly improves the fitting accuracy.
[0147] 2. The judgment rules of the trust region in the fitting algorithm have been optimized, further shortening the iteration time.
[0148] 3. Reduce the number of parameters to be solved in the iteration, and at the same time, based on the characteristics of the two algorithms, make the whole algorithm globally optimal when finding the global minimum.
[0149] 4. The method proposed in this embodiment adopts an iterative update strategy and uses a linear method to solve other parameters, which has strong robustness to outliers. Compared with the simple linear least squares method, trust region method and nonlinear least squares method, it has a very high ability to distinguish outliers.
[0150] 5. This embodiment adds a bias coefficient to improve the judgment rule of the trust region and speed up the convergence speed of the trust region (by about 10% faster iteration speed).
[0151] 6. This embodiment provides a calculation method for determining the end of the convergence process, that is, when 0>Error_slope>-0.1 and Error_index<=1e-2 (the threshold can be set as needed), the trust region iteration ends, reducing the iteration time.
[0152] To better implement the Fourier fitting method for signal analysis in this embodiment of the invention, based on the Fourier fitting method for signal analysis, please refer to Figure 3. Figure 3 is a structural schematic diagram of an embodiment of the Fourier fitting device for signal analysis provided by this invention. This embodiment of the invention provides a Fourier fitting device 300 for signal analysis, comprising:
[0153] The signal acquisition module 310 is used to acquire the target signal and obtain multiple scatter points to be fitted based on the target signal;
[0154] The model building module 320 is used to build a Fourier fitting model based on the scatter points to be fitted. The Fourier fitting model includes multiple fitting parameters, including a period parameter.
[0155] The optimization startup module 330 is used to establish a deviation parameter and, with the deviation parameter and the period parameter as independent variables, establish an optimization objective function based on the Fourier fitting model, wherein the deviation parameter is used to characterize the difference between the fitting result of the Fourier fitting model and the actual fitting result.
[0156] The iterative optimization module 340 is used to iteratively optimize the deviation parameters according to the optimization objective function using a trust region algorithm, and update the fitting parameters based on the optimized deviation parameters in each iteration, so as to obtain multiple final fitting parameters.
[0157] The fitting analysis module 350 is used to fit multiple scatter points to be fitted according to the Fourier fitting model containing the final fitting parameters to obtain a final fitting result, and to obtain a signal analysis result based on the final fitting result.
[0158] It should be noted that the corresponding device 300 provided in the above embodiments can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding content in the above method embodiments, and will not be repeated here.
[0159] Please refer to Figure 4, which is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Based on the above-described Fourier fitting method for signal analysis, the present invention also provides a Fourier fitting device 400 for signal analysis, i.e., the aforementioned electronic device. The Fourier fitting device 400 for signal analysis can be a computing device such as a mobile terminal, desktop computer, laptop, handheld computer, or server. The Fourier fitting device 400 for signal analysis includes a processor 410, a memory 420, and a display 430. Figure 4 only shows some components of the Fourier fitting device for signal analysis; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead.
[0160] In some embodiments, memory 420 may be an internal storage unit of the Fourier fitting device 400 for signal analysis, such as a hard disk or memory of the Fourier fitting device 400. In other embodiments, memory 420 may be an external storage device of the Fourier fitting device 400 for signal analysis, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the Fourier fitting device 400 for signal analysis. Furthermore, memory 420 may include both internal storage units and external storage devices of the Fourier fitting device 400 for signal analysis. Memory 420 is used to store application software and various types of data installed on the Fourier fitting device 400 for signal analysis, such as program code installed on the Fourier fitting device 400 for signal analysis. Memory 420 may also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 420 stores a Fourier fitting program 440 for signal analysis, which can be executed by the processor 410 to implement the Fourier fitting method for signal analysis according to the embodiments of this application.
[0161] In some embodiments, processor 410 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 420 or process data, such as performing Fourier fitting methods applied to signal analysis.
[0162] In some embodiments, display 430 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 430 is used to display information from the Fourier fitting device 400 used for signal analysis and to display a user interface for visualization. Components 410-430 of the Fourier fitting device 400 used for signal analysis communicate with each other via a system bus.
[0163] In one embodiment, when the processor 410 executes the Fourier fitting program 440 for signal analysis stored in the memory 420, the steps in the Fourier fitting method for signal analysis described above are implemented.
[0164] This embodiment also provides a computer-readable storage medium storing a Fourier fitting program for signal analysis, which, when executed by a processor, can implement the steps in the above embodiments.
[0165] This invention provides a Fourier fitting method, apparatus, and system for signal analysis. First, a target signal is acquired, and multiple scatter points to be fitted are obtained based on the target signal. Then, a Fourier fitting model is established based on the scatter points, including multiple fitting parameters, such as a period parameter. Next, a deviation parameter is established, and an optimization objective function is established based on the Fourier fitting model using the deviation parameter and the period parameter as independent variables. The deviation parameter characterizes the difference between the fitting result of the Fourier fitting model and the actual fitting result. Finally, based on the optimization objective function, the deviation parameter is iteratively optimized using a trust region algorithm, and the fitting parameters are updated based on the optimized deviation parameter in each iteration, ultimately obtaining multiple final fitting parameters. Then, based on the Fourier fitting model containing the final fitting parameters, the multiple scatter points to be fitted are fitted to obtain the final fitting result, and the signal analysis result is obtained based on the final fitting result. Compared to existing technologies, this invention utilizes the inherent characteristics of fitting, sets only two unknowns, significantly reduces computational load and time, and calculates only a single variable using the trust region algorithm, controlling the number of iterations using parameters after each iteration, greatly improving runtime and efficiency, and possessing excellent practicality.
[0166] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A Fourier fitting method applied to signal analysis, characterized in that, include: A target signal is acquired, and multiple scatter points to be fitted are obtained based on the target signal; a Fourier fitting model is established based on the scatter points to be fitted, the Fourier fitting model including multiple fitting parameters, including a period parameter; a deviation parameter is established, and an optimization objective function is established based on the Fourier fitting model using the deviation parameter and the period parameter as independent variables, wherein the deviation parameter is used to characterize the difference between the fitting result of the Fourier fitting model and the actual fitting result; wherein the optimization objective function includes: In the formula, bias is the deviation parameter, w is the period parameter, i is the Fourier fitting order, N is the total number of scatter points to be fitted, and x i y i These are the x and y coordinates of the i-th scatter point to be fitted, respectively, and a0 is the fitting parameter. i b i The fitting parameters are defined as follows: The bias parameters are iteratively optimized using a trust region algorithm based on the objective function, and the fitting parameters are updated based on the optimized bias parameters in each iteration, resulting in multiple final fitting parameters. The multiple scatter points are fitted using a Fourier fitting model containing the final fitting parameters to obtain the final fitting result, and the signal analysis result is obtained based on the final fitting result.
2. The Fourier fitting method for signal analysis according to claim 1, characterized in that, The process involves iteratively optimizing the deviation parameters using a trust-region algorithm based on the objective function, and updating the fitting parameters based on the optimized deviation parameters in each iteration to obtain multiple final fitting parameters. This includes: establishing an improved trust-region iteration strategy based on the deviation parameters; iteratively optimizing the deviation parameters using the trust-region algorithm according to the improved trust-region iteration strategy based on the objective function; and updating the fitting parameters in the objective function using the least squares method in each iteration based on the optimized deviation parameters. The fitting parameters updated in the last iteration are the final fitting parameters.
3. The Fourier fitting method for signal analysis according to claim 2, characterized in that, The improved trust region iteration strategy includes: obtaining historical iteration deviation coefficients, and determining whether to continue iteration based on the numerical change state of the historical iteration deviation coefficients; in each iteration, obtaining a descent coefficient based on the scatter points to be fitted according to the updated fitting parameters, and determining whether to continue iteration based on the descent coefficient.
4. The Fourier fitting method for signal analysis according to claim 3, characterized in that, The step of obtaining the historical iteration deviation coefficient and determining whether to continue iteration based on the numerical change of the historical iteration deviation coefficient includes: if The iteration ends when the value of the variable is equal to the value of the variable; in the formula, sign() is the sign function, the subscript k represents the iteration number, and bias is the bias function. k Let bias represent the bias parameter obtained in the k-th iteration. k-2 bias k-1 and bias k All of these are the historical iteration deviation coefficients.
5. The Fourier fitting method for signal analysis according to claim 3, characterized in that, The step of obtaining a descent coefficient based on the updated fitting parameters and the scatter points to be fitted, and determining whether to continue iteration based on the descent coefficient, includes: obtaining the mean square error between the fitting result of the Fourier fitting model and the scatter points to be fitted based on the updated fitting parameters; saving the mean square error to a cache queue; when the length of the cache queue reaches a preset length, obtaining the descent coefficient based on the cache queue, and determining whether to continue iteration based on the descent coefficient.
6. The Fourier fitting method for signal analysis according to claim 5, characterized in that, The step of obtaining the descent coefficient based on the cache queue and determining whether to continue iteration based on the descent coefficient includes: performing calculations: In the formula, Line represents the cache queue, L is the length of the cache queue, and i is the index of the element in the cache queue. i Represents the i-th element in the cache queue, Line_normal i Line_normal is the weight coefficient corresponding to the i-th element in the cache queue. max Represents all Line_normal i The maximum value in Line_normal min Represents all Line_normal i The minimum value in, i max Represents all Line_normal i The index corresponding to the maximum value in the index, i min Represents all Line_normal i The minimum value in the algorithm corresponds to the index of the minimum value. Error_slope and Error_index are both descent coefficients. The iteration ends when 0 > Error_slope > -0.1 and Error_index <= 1e-2.
7. A Fourier fitting device for signal analysis, characterized in that, include: The signal acquisition module is used to acquire the target signal and obtain multiple scatter points to be fitted based on the target signal; The model building module is used to build a Fourier fitting model based on the scatter points to be fitted. The Fourier fitting model includes multiple fitting parameters, including a period parameter. The optimization initiation module is used to build a deviation parameter and, with the deviation parameter and the period parameter as independent variables, build an optimization objective function based on the Fourier fitting model. The deviation parameter is used to characterize the difference between the fitting result of the Fourier fitting model and the actual fitting result. An iterative optimization module is used to iteratively optimize the deviation parameters according to the optimization objective function using a trust region algorithm, and update the fitting parameters based on the optimized deviation parameters in each iteration, ultimately obtaining multiple final fitting parameters; wherein, the optimization objective function includes: In the formula, bias is the deviation parameter, w is the period parameter, i is the Fourier fitting order, N is the total number of scatter points to be fitted, and x i y i These are the x and y coordinates of the i-th scatter point to be fitted, respectively, and a0 is the fitting parameter. i b i The fitting parameters are the parameters corresponding to the i-th scatter point to be fitted; the fitting analysis module is used to fit multiple scatter points to be fitted according to the Fourier fitting model containing the final fitting parameters to obtain the final fitting result, and to obtain the signal analysis result according to the final fitting result.
8. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory is used to store a program; and the processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the Fourier fitting method for signal analysis as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store computer-readable programs or instructions, which, when executed by a processor, are capable of implementing the steps in the Fourier fitting method for signal analysis as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Optical fiber type surface plasmon resonance signal peak positioning detection method based on Gaussian fitting
CN105044041A
A fitting method and system for power generation fuel cost of a thermal power generating unit
CN109840367A
Earthquake quality factor acquisition method, system and device and storage medium
CN119335592A
System, method and computer program for monitoring health of a person
FI20215426A1