Quartz crystal oscillator static temperature frequency characteristic modeling method based on intelligent least square
By optimizing parameters using intelligent least squares and particle swarm optimization, the problem of quartz crystal oscillator static temperature-frequency characteristic model being susceptible to abnormal data interference was solved, achieving higher robustness and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (EAST CHINA)
- Filing Date
- 2023-03-23
- Publication Date
- 2026-07-21
AI Technical Summary
Traditional polynomial models of the static temperature-frequency characteristics of quartz crystal oscillators are susceptible to interference from anomalous data, resulting in insufficient model accuracy and robustness.
A modeling method based on intelligent least squares is adopted. By identifying outlier data and reducing its weight, and combining it with particle swarm optimization algorithm to optimize model parameters, the robustness and accuracy of the model are improved.
This effectively reduces the impact of outlier data on the model, improving the robustness and accuracy of the static temperature-frequency characteristic model of quartz crystal oscillators.
Smart Images

Figure CN116205186B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic science and technology, and relates to a method for modeling the static temperature-frequency characteristics of quartz crystal oscillators based on the intelligent least squares method. Background Technology
[0002] A quartz crystal oscillator is a crystal oscillator made with a quartz wafer as its core. It serves as the frequency source for many electronic communication systems, playing a crucial role in ensuring system clock accuracy. Due to its inherent structure, the frequency of a quartz crystal oscillator is susceptible to various factors such as temperature, aging, and noise, with temperature being the most significant factor affecting its frequency stability. The frequency of a quartz crystal changes with temperature; the relationship between temperature and frequency is known as its temperature-frequency characteristic. Establishing a temperature-frequency characteristic model can be used for temperature compensation studies of crystal oscillators, which is beneficial for improving their stability and lifespan.
[0003] Traditional models of the static temperature-frequency characteristics of quartz crystal oscillators often employ polynomial modeling based on the classical least squares method. While this model offers advantages such as simple structure and clear physical meaning, its drawback is that it considers the influence of all data points, making it highly susceptible to interference from outliers and thus reducing the model's accuracy. In practical applications, the generation of outliers is inevitable; therefore, researching how to reduce the impact of outliers and improve the robustness of the model is of great significance. Summary of the Invention
[0004] This invention addresses the vulnerability of traditional polynomial models of quartz crystal oscillator static temperature-frequency characteristics to outlier data. It provides a modeling method for quartz crystal oscillator static temperature-frequency characteristics based on intelligent least squares. This method identifies outliers in the experimental data, reduces their weight, and obtains optimal model parameters, thereby mitigating the impact of outliers on the model and improving its robustness and accuracy.
[0005] To achieve the above objectives, this invention provides a method for modeling the static temperature-frequency characteristics of quartz crystal oscillators based on the intelligent least squares method, which includes the following steps:
[0006] (a) Collect the temperature and frequency dataset D of the quartz crystal oscillator under the condition of slow temperature change, i.e. static change. Create the temperature data in dataset D as dataset X, and create the corresponding frequency deviation data as dataset Y.
[0007] (ii) Using dataset X as the independent variable and dataset Y as the dependent variable, a polynomial model is established using the classical least squares method, and the model parameter matrix β0 is obtained by solving the model.
[0008] (III) Designing a robust optimization objective function using a weighted strategy To suppress the influence of outliers in the modeling data, where β is the model parameter to be optimized, and δ... i Let i = 1, 2, 3, ..., m, representing the prediction residual of the i-th data set in D, and w i It is the weight coefficient of the i-th group.
[0009] (iv) Using the parameter matrix β0 as the initial position, the objective function J(β) is optimized using the particle swarm optimization algorithm to obtain the optimal model parameter matrix β. r .
[0010] (v) Using dataset X and optimal parameter matrix β r The predicted output value is calculated. Plot the prediction results and analyze the performance of the intelligent least squares model.
[0011] Furthermore, in step (i), the dataset X created from dataset D is an m×5 matrix, where m represents the m-th temperature frequency data set contained in dataset D. Dataset X is represented as follows:
[0012]
[0013] In the formula, x i ,i=1,2,3,...,m, represent the temperature values in the i-th data group in dataset D.
[0014] Accordingly, the dataset Y created from dataset D is an m×1 matrix, and dataset Y is represented as:
[0015]
[0016] In the formula, y i ,i=1,2,3,...,m, represent the frequency deviation values in the i-th group of data in dataset D.
[0017] Furthermore, in step (ii), with dataset X as the independent variable and dataset Y as the dependent variable, a multinomial model is established based on the classical least squares method using formula (3). The model can be expressed as:
[0018] y = a4x 4 +a3x 3 +a2x 2 +a1x 1 +a0 (3)
[0019] In the formula, x represents the model input, y represents the model output, and a4, a3, a2, a1, a0 are the coefficients of the polynomial model. All coefficients constitute the parameter matrix in formula (4).
[0020]
[0021] The parameter matrix β0 is calculated using the classical least squares method, and its expression is shown in formula (5):
[0022] β0=[X T X] -1 X T Y (5)
[0023] Furthermore, in step (iii), the calculation is performed using formula (6), the expression of which is as follows:
[0024]
[0025] in Indicates y i The estimated value is calculated using formula (7).
[0026]
[0027] The average residual was further calculated using formula (8).
[0028]
[0029] The residual deviation index p is constructed using formula (9). i This is used to measure the degree of anomaly of the corresponding data point. Formula (9) is expressed as:
[0030]
[0031] In the residual deviation index p i Based on this, the weighting coefficient w is established according to formula (10). i Formula (10) is expressed as:
[0032]
[0033] M and N are empirical thresholds, which can generally be set to M = 0.2 and N = 1.
[0034] Furthermore, in step (iv), the objective function is minimized using an intelligent optimization algorithm—the particle swarm optimization algorithm. (i.e., the fitness function), where β is the model parameter to be optimized, and δ i Let i = 1, 2, 3, ..., m, representing the prediction residual of the i-th data set in D, and w i These are the weight coefficients of the i-th data set. The specific steps for optimizing parameter β using the particle swarm optimization algorithm are as follows:
[0035] (1) Initialize the particle swarm positions based on the parameter matrix β0, and denote the positions of all particle swarms as follows:
[0036] {β0, β1, ..., β K-1}, where K is the number of particles, β1, ..., β K-1 Other particle positions are randomly assigned;
[0037] (2) Calculate the fitness functions {J(β0), J(β1), ..., J(β2)} for all particles. K-1 )};
[0038] (3) Calculate the global optimum β of the particle based on the fitness function. g and local optimum β p ;
[0039] (4) Update the particle position according to formulas (11) and (12);
[0040] v k =αv k +c1r1(β g -β k )+c2r2(β p -β k ),k=0,1,…,K-1 (11)
[0041] β k =β k +v k ,k=0,1,…,K-1 (12)
[0042] In formula (11) v k Let α represent the moving speed of the k-th particle, α be the inertia weight (usually set to 0.9), c1 and c2 be learning factors (usually ranging from 0.1 to 2), and r1 and r2 be random factors in the interval (0,1).
[0043] (5) Return to step (2) and repeat the calculation until the maximum number of iterations is reached. The optimal parameter matrix β can then be obtained. r Its expression is shown in (13):
[0044]
[0045] Furthermore, in step (v), the new output dataset is calculated using formula (14). The calculation formula (14) is expressed as follows:
[0046] Attached Figure Description
[0047] Figure 1 This is a flowchart of the method for modeling the static temperature-frequency characteristics of quartz crystal oscillators based on intelligent least squares as described in this invention;
[0048] Figure 2 This is a diagram illustrating the effect of the intelligent least squares model in the presence of outliers, as described in an embodiment of the present invention. Figure 3 This is a diagram illustrating the effect of the classical least squares model in the case of outliers, as described in an embodiment of the present invention. Detailed Implementation
[0049] The present invention will now be described in detail through exemplary embodiments. However, it should be understood that, without further description, the structures and features of one embodiment may be advantageously incorporated into other embodiments.
[0050] See Figure 1 This invention discloses a method for modeling the static temperature-frequency characteristics of a quartz crystal oscillator based on the intelligent least squares method, comprising the following steps:
[0051] (a) Collect the temperature and frequency dataset D of the quartz crystal oscillator under the condition of slow temperature change, i.e. static change. Create the temperature data in dataset D as dataset X, and create the corresponding frequency deviation data as dataset Y.
[0052] Dataset X, created from dataset D, is an m×5 matrix, where m represents the m-th temperature frequency data set in dataset D. Dataset X is represented as follows:
[0053]
[0054] In the formula, x i ,i=1,2,3,...,m, represent the temperature values in the i-th data group in dataset D.
[0055] Accordingly, the dataset Y created from dataset D is an m×1 matrix, and dataset Y is represented as:
[0056]
[0057] In the formula, y i ,i=1,2,3,...,m, represent the frequency deviation values in the i-th group of data in dataset D.
[0058] (ii) Using dataset X as the independent variable and dataset Y as the dependent variable, a multinomial model is established based on the classical least squares method using formula (3). The model can be expressed as:
[0059] y = a4x 4 +a3x 3 +a2x 2 +a1x 1 +a0 (3)
[0060] In the formula, x represents the model input, y represents the model output, and a4, a3, a2, a1, a0 are the coefficients of the polynomial model. All coefficients constitute the parameter matrix in formula (4).
[0061]
[0062] The parameter matrix β0 is calculated using the classical least squares method, and its expression is shown in formula (5):
[0063] β0=[X T X] -1 X T Y (5)
[0064] (III) Calculation is performed using formula (6), the expression of which is as follows:
[0065]
[0066] in Indicates y i The estimated value is calculated using formula (7).
[0067]
[0068] The average residual was further calculated using formula (8).
[0069]
[0070] The residual deviation index p is constructed using formula (9). i This is used to measure the degree of anomaly of the corresponding data point. Formula (9) is expressed as:
[0071]
[0072] In the residual deviation index p i Based on this, the weighting coefficient w is established according to formula (10). i Formula (10) is expressed as:
[0073]
[0074] M and N are empirical thresholds, which can generally be set to M = 0.2 and N = 1.
[0075] (iv) Solving the minimization objective function using an intelligent optimization algorithm—Particle Swarm Optimization. (i.e., the fitness function), where β is the model parameter to be optimized, and δ i Let i = 1, 2, 3, ..., m, representing the prediction residual of the i-th data set in D, and w iThese are the weight coefficients of the i-th data set. The specific steps for optimizing parameter β using the particle swarm optimization algorithm are as follows:
[0076] (1) Initialize the particle swarm positions based on the parameter matrix β0, and denote the positions of all particle swarms as {β0, β1, ..., β0, β1, ..., β2, ... ...2, ..., β2, ..., β2, ..., β2, ..., β2, ..., β K-1}, where K is the number of particles, β1, ..., β K-1 Other particle positions are randomly assigned;
[0077] (2) Calculate the fitness functions {J(β0), J(β1), ..., J(β2)} for all particles. K-1 )};
[0078] (3) Calculate the global optimum β of the particle based on the fitness function. g and local optimum β p ;
[0079] (4) Update the particle position according to formulas (11) and (12);
[0080] v k =αv k +c1r1(β g -β k )+c2r2(β p -β k ),k=0,1,…,K-1 (11)
[0081] β k =β k +v k ,k=0,1,…,K-1 (12)
[0082] In formula (11) v k Let α represent the moving speed of the k-th particle, α be the inertia weight (usually set to 0.9), c1 and c2 be learning factors (usually ranging from 0.1 to 2), and r1 and r2 be random factors in the interval (0,1).
[0083] (5) Return to step (2) and repeat the calculation until the maximum number of iterations is reached. The optimal parameter matrix β can then be obtained. r Its expression is shown in (13):
[0084]
[0085] (v) Calculate the new output dataset using formula (14) The calculation formula (14) is expressed as follows:
[0086]
[0087] In the above method, steps (i) to (ii) are the classical least squares modeling stage, and steps (iii) to (v) are the intelligent least squares modeling stage.
[0088] The intelligent least squares modeling method of this invention divides static data into independent and dependent variables. Then, based on the traditional least squares method, a model is established to obtain initial model parameters. On this basis, a weighted strategy is used to design a robust optimization objective function, and the model parameters are optimized using the particle swarm optimization algorithm in intelligent optimization algorithms to achieve intelligent least squares modeling. Finally, the intelligent least squares model is used to estimate the relationship between temperature and frequency. This invention can identify outliers in experimental data and reduce their impact on the model by decreasing their weight, effectively improving the robustness and accuracy of the obtained temperature-frequency characteristic model.
[0089] To more clearly illustrate the effects of the present invention on improving model robustness and accuracy, the following detailed description of the intelligent least squares modeling method of the present invention is provided in conjunction with specific embodiments.
[0090] Example: A crystal oscillator with a working frequency of 19.2MHz is a commonly used clock element. This type of crystal oscillator is often used in computers, communication equipment, consumer electronics, automotive electronic systems, etc., and features high precision, stability, and reliability. It plays an important role in ensuring the clock synchronization and high precision of electronic systems and the normal operation of electronic systems. The temperature-frequency characteristic data of this type of crystal oscillator were collected in a laboratory by slowly changing its temperature.
[0091] In this implementation, a dataset containing outliers was selected from the aforementioned crystal oscillator temperature-frequency characteristic data. Intelligent least squares modeling was performed on this dataset using the steps described above, and the specific model results are as follows. Figure 2 As shown. Simultaneously, a static temperature-frequency characteristic model is established using the classical least squares method, and its effect is as follows. Figure 3 As shown.
[0092] Depend on Figure 2 and Figure 3 The comparison shows that the quartz crystal oscillator static temperature-frequency characteristic modeling method based on intelligent least squares proposed in this invention can effectively improve the robustness and accuracy of the quartz crystal oscillator static temperature-frequency data model.
[0093] The embodiments described above are merely illustrative of the present invention and are not intended to limit the scope of protection of the present invention. Any simple modifications and variations made by those skilled in the art within the scope of the technical solutions described in the present invention should be included within the scope of the above-mentioned patent applications.
Claims
1. A method for modeling the static temperature-frequency characteristics of a quartz crystal oscillator based on intelligent least squares, comprising the following steps: (a) Collect temperature and frequency deviation data of quartz crystal oscillators under static temperature change conditions to form dataset D. Create dataset X from the temperature data in dataset D and create dataset Y from the corresponding frequency deviation data. (ii) Using dataset X as the independent variable and dataset Y as the dependent variable, a polynomial model is established using the classical least squares method, and the model parameter matrix is obtained by solving the model. ; (III) Designing a robust optimization objective function using a weighted strategy To suppress the influence of outliers in the modeling data, among which These are the model parameters to be optimized. , representing the prediction residual of the i-th data group in D. These are the weighting coefficients for the i-th data set; the prediction residuals are calculated using formula (6): (6) in, , represents the frequency deviation value in the i-th data group in dataset D. express The estimated value is calculated using formula (7): (7) in, , represents the temperature value in the i-th data group in dataset D; The average residual was further calculated using formula (8). : (8) The residual deviation index is constructed using formula (9). , used to measure the degree of anomaly of the corresponding data point, is expressed by formula (9): (9) In residual deviation index Based on this, weight coefficients are established according to formula (10). Formula (10) is expressed as: (10) Where M and N are empirical thresholds, set as M=0.2 and N=1; (iv) Using parameter matrices As the initial position, the particle swarm optimization algorithm is used to optimize the objective function. Optimization is performed to obtain the optimal model parameter matrix. ; (v) Using dataset X and the optimal parameter matrix The predicted output value is calculated. The prediction results were plotted, and the performance of the intelligent least squares model was analyzed.
2. The method for modeling the static temperature-frequency characteristics of quartz crystal oscillators based on intelligent least squares method as described in claim 1, characterized in that, In step (one), the dataset X created from dataset D is an m×5 matrix; dataset X is represented as follows: (1) In the formula, , represents the temperature value in the i-th data group in dataset D; Accordingly, the dataset Y created from dataset D is an m×1 matrix, and dataset Y is represented as: (2) In the formula, , represents the frequency deviation value in the i-th group of data in dataset D.
3. The method for modeling the static temperature-frequency characteristics of quartz crystal oscillators based on intelligent least squares method as described in claim 2, characterized in that, In step (ii), using dataset X as the independent variable and dataset Y as the dependent variable, a multinomial model is established based on the classical least squares method. The model can be expressed as: (3) In the formula, x represents the model input and y represents the model output. The coefficients are the polynomial model coefficients, and all coefficients constitute the parameter matrix in formula (4): (4) Parameter matrix The expression obtained by classical least squares method is shown in formula (5): (5)。 4. The method for modeling the static temperature-frequency characteristics of quartz crystal oscillators based on intelligent least squares method as described in claim 3, characterized in that, In step (iv), the objective function is minimized using the particle swarm optimization algorithm. The objective function is also the fitness function, where These are the model parameters to be optimized. , representing the prediction residual of the i-th data group in D. These are the weight coefficients of the i-th data set; the parameters are optimized using the particle swarm optimization algorithm. The specific steps are as follows: (1) Using the parameter matrix Initialize the particle swarm positions based on the basic structure, and denote the positions of all particle swarms as follows: Where K is the number of particles. Other particle positions are randomly assigned; (2) Calculate the fitness function for all particles. ; (3) Calculate the global optimum of the particle based on the fitness function. and local optimum ; (4) Update the particle position according to formulas (11) and (12): (11) (12) In formula (11) This represents the velocity of the k-th particle. The inertia weight is set to 0.
9. , It is the learning factor, with a value range of [0.1, 2]. , It is a random factor in the interval (0,1); (5) Return to step (2) and repeat the calculation until the maximum number of iterations is reached to obtain the optimal parameter matrix. Its expression is shown in (13): (13)。 5. The method for modeling the static temperature-frequency characteristics of a quartz crystal oscillator based on intelligent least squares as described in claim 4, characterized in that, In step (5), the new output dataset is calculated using formula (14). The calculation is expressed as follows using formula (14): (14)。