CN110649913B - Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment - Google Patents

Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment Download PDF

Info

Publication number
CN110649913B
CN110649913B CN201810682406.0A CN201810682406A CN110649913B CN 110649913 B CN110649913 B CN 110649913B CN 201810682406 A CN201810682406 A CN 201810682406A CN 110649913 B CN110649913 B CN 110649913B
Authority
CN
China
Prior art keywords
frequency offset
smoothed
current
variance
estimating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810682406.0A
Other languages
Chinese (zh)
Other versions
CN110649913A (en
Inventor
邓祝明
许百成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Pinecone Electronic Co Ltd
Original Assignee
Beijing Xiaomi Pinecone Electronic Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Pinecone Electronic Co Ltd filed Critical Beijing Xiaomi Pinecone Electronic Co Ltd
Priority to CN201810682406.0A priority Critical patent/CN110649913B/en
Publication of CN110649913A publication Critical patent/CN110649913A/en
Application granted granted Critical
Publication of CN110649913B publication Critical patent/CN110649913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03JTUNING RESONANT CIRCUITS; SELECTING RESONANT CIRCUITS
    • H03J7/00Automatic frequency control; Automatic scanning over a band of frequencies
    • H03J7/02Automatic frequency control
    • H03J7/04Automatic frequency control where the frequency control is accomplished by varying the electrical characteristics of a non-mechanically adjustable element or where the nature of the frequency controlling element is not significant
    • H03J7/045Modification of automatic frequency control sensitivity or linearising automatic frequency control operation; Modification of the working range

Abstract

The disclosure relates to a frequency adjustment method and device for a crystal oscillator, a storage medium and an electronic device. The method comprises the following steps: obtaining current frequency offset estimation; smoothing the current frequency offset estimation to obtain a smoothed frequency offset estimation; smoothing the variance of the current frequency offset estimation to obtain a smoothed frequency offset estimation variance; and determining a frequency offset adjustment amount according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance. Therefore, under different frequency offset estimation conditions, the frequency deviation of the crystal oscillator can be stably and effectively controlled within a small range, and the throughput rate and the performance of the system are improved.

Description

Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method and an apparatus for adjusting a frequency of a crystal oscillator, a storage medium, and an electronic device.
Background
In a wireless terminal, a crystal oscillator is generally used to generate an operation clock of a system, but the output frequency of the crystal oscillator has a certain frequency deviation due to the influence of environmental changes, thereby affecting the receiving performance of the system. For example, frequency deviation may introduce Inter-Carrier Interference (ICI) in an Orthogonal Frequency Division (OFDM) system, which may increase an error rate and reduce a throughput of the system, and thus may seriously affect the performance of the system. Therefore, the clock Frequency of the crystal oscillator output needs to be controlled within a certain range, and in general, the wireless terminal adopts an Automatic Frequency Control (AFC) technology to realize the precise Control of the crystal oscillator Frequency. In particular, the AFC technique precisely controls the output frequency of a crystal oscillator by mainly adjusting a bias voltage of the crystal oscillator. Because there are many factors that affect the accuracy of frequency offset estimation, such as the determination method of frequency offset estimation, the channel conditions (signal-to-noise ratio, multipath, and moving speed), how to adopt an appropriate AFC strategy under various frequency offset estimation conditions to achieve the optimal balance between the adjustment speed and the adjustment stability is a key problem faced by the wireless terminal.
Disclosure of Invention
In order to overcome the problems in the prior art, the present disclosure provides a frequency adjustment method and apparatus for a crystal oscillator, a storage medium, and an electronic device.
In order to achieve the above object, the present disclosure provides a frequency adjustment method for a crystal oscillator, including:
obtaining current frequency offset estimation;
smoothing the current frequency offset estimation to obtain a smoothed frequency offset estimation;
smoothing the variance of the current frequency offset estimation to obtain a smoothed frequency offset estimation variance;
and determining a frequency offset adjustment amount according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance.
Optionally, the current frequency offset estimate is smoothed by the following formula to obtain a smoothed frequency offset estimate:
Figure BDA0001710900830000021
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0001710900830000022
estimating the smoothed frequency offset;
Figure BDA0001710900830000023
estimating the current frequency offset;
Figure BDA0001710900830000024
estimating the frequency deviation after the last smoothing; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
Optionally, the current frequency offset estimate is smoothed by the following formula to obtain a smoothed frequency offset estimate:
Figure BDA0001710900830000025
wherein the content of the first and second substances,
Figure BDA0001710900830000026
estimating the smoothed frequency offset;
Figure BDA0001710900830000027
estimating the ith frequency offset acquired from the preset historical moment to the current moment; and k is the number of frequency offset estimates obtained from the preset historical moment to the current moment.
Optionally, the variance of the current frequency offset estimation is smoothed by the following formula to obtain a smoothed frequency offset estimation variance:
Figure BDA0001710900830000028
wherein the content of the first and second substances,
Figure BDA0001710900830000029
estimating a variance for the smoothed frequency offset;
Figure BDA00017109008300000210
a variance of the current frequency offset estimate;
Figure BDA00017109008300000211
estimating a variance for the most recently smoothed frequency offset;
Figure BDA00017109008300000212
estimating the current frequency offset;
Figure BDA00017109008300000213
estimating the smoothed frequency offset; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
Optionally, the variance of the current frequency offset estimate is smoothed by the following formula, so as to obtain a smoothed frequency offset estimate variance:
Figure BDA0001710900830000031
wherein the content of the first and second substances,
Figure BDA0001710900830000032
estimating a variance for the smoothed frequency offset;
Figure BDA0001710900830000033
the variance of the ith frequency offset estimation obtained from the preset historical moment to the current moment is obtained;
Figure BDA0001710900830000034
estimating the ith frequency offset obtained from the preset historical moment to the current moment;
Figure BDA0001710900830000035
estimating the ith smoothed frequency offset acquired from the preset historical moment to the current moment; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
Optionally, the frequency offset adjustment amount is determined according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance by using the following formula:
Figure BDA0001710900830000036
Figure BDA0001710900830000037
wherein, f adj Adjusting the amount of the frequency offset;
Figure BDA0001710900830000038
estimating the smoothed frequency offset; condA, condB, condC are conditions that affect the value of the frequency offset adjustment;
Figure BDA0001710900830000039
estimating a variance for the smoothed frequency offset; gamma is a preset ratio threshold; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; Δ t is a time interval between the preset historical time and the current time; epsilon is a preset time interval threshold; η is a predetermined number threshold.
Optionally, the method further comprises:
and carrying out frequency offset adjustment on the crystal oscillator according to the frequency offset adjustment quantity.
The present disclosure also provides a frequency adjustment apparatus for a crystal oscillator, including:
an obtaining module, configured to obtain a current frequency offset estimate;
a first smoothing module, configured to perform smoothing processing on the current frequency offset estimate obtained by the obtaining module to obtain a smoothed frequency offset estimate;
a second smoothing module, configured to smooth the variance of the current frequency offset estimation obtained by the obtaining module to obtain a smoothed frequency offset estimation variance;
and the determining module is used for determining the frequency offset adjustment amount according to the smoothed frequency offset estimation obtained by the first smoothing module and the smoothed frequency offset estimation variance obtained by the second smoothing module.
Optionally, the first smoothing module is configured to smooth the current frequency offset estimate obtained by the obtaining module by using the following formula, so as to obtain a smoothed frequency offset estimate:
Figure BDA0001710900830000041
wherein the content of the first and second substances,
Figure BDA0001710900830000042
estimating the smoothed frequency offset;
Figure BDA0001710900830000043
estimating the current frequency offset;
Figure BDA0001710900830000044
estimating the frequency deviation after the last smoothing; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
Optionally, the first smoothing module is configured to smooth the current frequency offset estimate obtained by the obtaining module by using the following formula, so as to obtain a smoothed frequency offset estimate:
Figure BDA0001710900830000045
wherein the content of the first and second substances,
Figure BDA0001710900830000046
estimating the smoothed frequency offset;
Figure BDA0001710900830000047
estimating the ith frequency offset acquired from the preset historical moment to the current moment; and k is the number of frequency offset estimates obtained from the preset historical moment to the current moment.
Optionally, the second smoothing module is configured to smooth the variance of the current frequency offset estimation obtained by the obtaining module by using the following formula, so as to obtain a smoothed frequency offset estimation variance:
Figure BDA0001710900830000051
wherein the content of the first and second substances,
Figure BDA0001710900830000052
estimating a variance for the smoothed frequency offset;
Figure BDA0001710900830000053
a variance of the current frequency offset estimate;
Figure BDA0001710900830000054
estimating variance for the frequency offset after the last smoothing;
Figure BDA0001710900830000055
estimating the current frequency offset;
Figure BDA0001710900830000056
estimating the smoothed frequency offset; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
Optionally, the second sliding mode block is configured to perform smoothing processing on the variance of the current frequency offset estimate obtained by the obtaining module through the following formula, so as to obtain a smoothed frequency offset estimate variance:
Figure BDA0001710900830000057
wherein the content of the first and second substances,
Figure BDA0001710900830000058
estimating a variance for the smoothed frequency offset;
Figure BDA0001710900830000059
the variance of the ith frequency offset estimation obtained from the preset historical moment to the current moment;
Figure BDA00017109008300000510
estimating the ith frequency offset obtained from the preset historical moment to the current moment;
Figure BDA00017109008300000511
estimating the ith smoothed frequency offset acquired from the preset historical moment to the current moment; k is the aboveSetting the number of frequency offset estimates obtained from the historical time to the current time; alpha is a smoothing factor.
Optionally, the determining module is configured to determine a frequency offset adjustment amount according to the smoothed frequency offset estimate obtained by the first flat-sliding module and the smoothed frequency offset estimate variance obtained by the second flat-sliding module by using the following formula:
Figure BDA00017109008300000512
Figure BDA0001710900830000061
wherein f is adj Adjusting the amount of the frequency offset;
Figure BDA0001710900830000062
estimating the smoothed frequency offset; condA, condB, condC are conditions that affect the value of the frequency offset adjustment;
Figure BDA0001710900830000063
estimating a variance for the smoothed frequency offset; gamma is a preset ratio threshold; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; Δ t is a time interval between the preset historical time and the current time; epsilon is a preset time interval threshold; η is a predetermined number threshold.
Optionally, the apparatus further comprises:
and the adjusting module is used for adjusting the frequency offset of the crystal oscillator according to the frequency offset adjustment amount determined by the determining module.
The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the above frequency adjustment method for a crystal oscillator provided by the present disclosure.
The present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the frequency adjustment method for a crystal oscillator provided by the present disclosure.
In the technical scheme, firstly, smoothing is carried out on the obtained current frequency offset estimation and the variance of the current frequency offset estimation so as to obtain a smoothed frequency offset estimation and a smoothed frequency offset estimation variance; and then, determining a frequency offset adjustment amount for adjusting the output frequency of the crystal oscillator according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance. Therefore, under different frequency offset estimation conditions, the frequency deviation of the crystal oscillator can be stably and effectively controlled in a smaller range, and the throughput rate and the performance of the system are improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a flow chart illustrating a method for frequency tuning of a crystal oscillator according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method for frequency tuning of a crystal oscillator according to another exemplary embodiment.
Fig. 3 is a block diagram illustrating a frequency adjustment apparatus for a crystal oscillator according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating a frequency adjustment apparatus for a crystal oscillator according to another exemplary embodiment.
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a flow chart illustrating a method for frequency tuning of a crystal oscillator according to an exemplary embodiment. As shown in fig. 1, the method may include the following steps.
In step 101, a current frequency offset estimate is obtained.
In the present disclosure, the method may be applied to an automatic frequency control system (i.e., AFC system). The current frequency offset estimation may be an estimated value of an instantaneous frequency offset obtained between the user terminal and the base station at the current time. Illustratively, the current frequency offset estimate may be obtained by a differential frequency offset estimation algorithm, a maximum likelihood estimation-based frequency offset estimation algorithm, a least squares-based frequency offset estimation algorithm, or the like. Since the specific way of obtaining the current frequency offset estimate is well known to those skilled in the art, it is not described in detail in this disclosure.
In addition, in order to reduce jitter of the current frequency offset estimation and ensure stationarity of the AFC system and the crystal oscillator signal, so as to improve system performance, after the current frequency offset estimation is obtained in step 101, smoothing processing may be performed on the current frequency offset estimation and a variance of the current frequency offset estimation, respectively. Specifically, the corresponding smoothing processing can be performed by the following step 102 and step 103.
In step 102, the current frequency offset estimation is smoothed to obtain a smoothed frequency offset estimation.
In an embodiment, after obtaining the current frequency estimate, the current frequency offset estimate may be smoothed according to a last smoothed frequency offset estimate, where the AFC system may obtain the current frequency offset estimate according to a fixed period or in real time, and the last smoothed frequency offset estimate may be obtained by smoothing a last obtained instantaneous frequency offset estimate.
Specifically, a corresponding first storage module may be disposed in the AFC system to store the frequency offset estimate after the last smoothing; therefore, after the current frequency offset estimation is obtained each time, the frequency offset estimation after the last smoothing can be read by accessing the first storage module, and then the current frequency offset estimation can be smoothed according to the frequency offset estimation after the last smoothing.
For example, the current frequency offset estimate may be smoothed by the following equation (1), to obtain a smoothed frequency offset estimate:
Figure BDA0001710900830000081
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0001710900830000082
estimating the smoothed frequency offset;
Figure BDA0001710900830000083
estimating the current frequency offset;
Figure BDA0001710900830000084
estimate the frequency offset for the last smoothed frequency offset, and
Figure BDA0001710900830000085
k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
In this disclosure, the preset historical time may be a latest frequency offset adjustment time, may be earlier than the latest frequency offset adjustment time, and may be later than the latest frequency offset adjustment time, which is not specifically limited in this disclosure. The fixed period may be set by a user or may be a default, and is not particularly limited in this disclosure.
In another embodiment, the AFC system may perform smoothing on the current frequency offset estimate obtained in step 101 according to a plurality of frequency offset estimates (i.e., reference frequency offset estimates used for determining the adjustment of the crystal frequency offset) obtained from a preset historical time to the current time.
Specifically, a corresponding second storage module may be provided in the AFC system, so that the AFC system may store the instantaneous frequency offset estimate at the current time in the second storage module after acquiring it each time. Therefore, after the current frequency offset estimation is obtained, the AFC system can read a plurality of frequency offset estimations obtained from the preset historical moment to the current moment by accessing the second storage module, and then smooth frequency offset estimations can be obtained by averaging the plurality of frequency offset estimations, namely, the smoothing operation of the current frequency offset estimation is completed.
Illustratively, the current frequency offset estimate may be smoothed by the following equation (2) to obtain a smoothed frequency offset estimate
Figure BDA0001710900830000091
Figure BDA0001710900830000092
Wherein the content of the first and second substances,
Figure BDA0001710900830000093
and estimating the ith frequency offset acquired from the preset historical moment to the current moment.
Returning to fig. 1, in step 103, the variance of the current frequency offset estimation is smoothed to obtain a smoothed frequency offset estimation variance.
In one embodiment, after obtaining the current frequency offset estimate, the AFC system may first determine a variance of the current frequency offset estimate, and then perform smoothing on the variance of the current frequency offset estimate. Specifically, the AFC system may smooth the variance of the current frequency offset estimate according to the last smoothed frequency offset estimate variance, where the last smoothed frequency offset estimate variance is obtained by smoothing the variance of the last obtained frequency offset estimate. Moreover, a corresponding third storage module can be arranged in the AFC system to store the frequency offset estimation variance after the last smoothing; therefore, after the AFC system obtains the variance of the current frequency offset estimation each time, the third storage module is accessed to read the variance of the frequency offset estimation after the last smoothing, and then the variance of the current frequency offset estimation can be smoothed according to the variance of the frequency offset estimation after the last smoothing.
Illustratively, the variance of the current frequency offset estimate may be smoothed by the following equation (3) to obtain a smoothed frequency offset estimate variance:
Figure BDA0001710900830000101
wherein the content of the first and second substances,
Figure BDA0001710900830000102
estimating a variance for the smoothed frequency offset;
Figure BDA0001710900830000103
a variance of the current frequency offset estimate;
Figure BDA0001710900830000104
the variance is estimated for the most recently smoothed frequency offset, wherein,
Figure BDA0001710900830000105
in another embodiment, after obtaining the current frequency offset estimate, the variance of multiple frequency offset estimates obtained from a preset historical time to the current time may be obtained first, and then, the variance of the current frequency offset estimate may be smoothed according to the variance of the multiple frequency offset estimates.
Specifically, a corresponding fourth storage module may be provided in the AFC system, so that the AFC system may store the variance of the instantaneous frequency offset estimate at the current time in the fourth storage module each time the variance of the instantaneous frequency offset estimate at the current time is obtained. Therefore, after the AFC system obtains the current frequency offset estimate, the variance of the multiple frequency offset estimates obtained from the preset historical time to the current time can be read by accessing the fourth storage module, and then the smoothed frequency offset estimate variance is obtained by averaging the variances of the multiple frequency offset estimates, that is, the smoothing operation on the variance of the current frequency offset estimate is completed.
Illustratively, the variance of the current frequency offset estimate can be smoothed by the following equation (4) to obtain a smoothed frequency offset estimate variance
Figure BDA0001710900830000106
Figure BDA0001710900830000107
Wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0001710900830000108
the variance of the ith frequency offset estimation obtained from the preset historical moment to the current moment;
Figure BDA0001710900830000109
and estimating the ith smoothed frequency offset acquired from the preset historical moment to the current moment.
Returning to fig. 1, in step 104, a frequency offset adjustment amount is determined according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance.
After the smoothed frequency offset estimation is obtained in step 102 and the smoothed frequency offset estimation variance is obtained in step 103, a frequency offset adjustment amount for adjusting the output frequency of the crystal oscillator may be determined according to the two.
Illustratively, the above-described frequency offset adjustment amount may be determined by the following equations (5) and (6):
Figure BDA0001710900830000111
Figure BDA0001710900830000112
wherein f is adj Adjusting the amount of the frequency offset; condA, condB, condC being values affecting the above-mentioned frequency offset adjustmentConditions; gamma is a preset ratio threshold; Δ t is a time interval between the preset historical time and the current time; epsilon is a preset time interval threshold; η is a predetermined number threshold.
In the present disclosure, the condA, condB, condC may be boolean variables, and their values are as follows:
when the square of the smoothed frequency offset estimate and the variance of the smoothed frequency offset estimate are greater than a preset ratio threshold (i.e., when
Figure BDA0001710900830000113
Time), condA can be determined to be true; when the square of the smoothed frequency offset estimate and the variance of the smoothed frequency offset estimate are less than or equal to the preset ratio threshold (i.e., when
Figure BDA0001710900830000114
Time), condA may be determined to be false. When the time interval between the preset history time and the current time is greater than the preset time interval threshold (i.e., when Δ t)>Epsilon), indicating that the time span of the reference frequency offset estimation for determining the crystal oscillator frequency offset adjustment reaches the time requirement for performing the frequency offset adjustment, and at the moment, determining that condB is true; when the time interval between the preset historical time and the current time is less than or equal to the preset time interval threshold (i.e., when Δ t is less than or equal to ∈), it is indicated that the time span of the reference frequency offset estimation for determining the crystal oscillator frequency offset adjustment does not meet the time requirement for performing the frequency offset adjustment, and at this time, it may be determined that condB is false. When the number of frequency offset estimates obtained from the preset historical time to the current time is greater than a preset number threshold (i.e., when k is greater than k)>Eta), indicating that the number of reference frequency offset estimations for determining the crystal oscillator frequency offset adjustment meets the number requirement for performing the frequency offset adjustment, and at this time, determining condC as true; when the number of frequency offset estimates obtained from the preset historical time to the current time is less than or equal to the preset number threshold (i.e., when k is less than or equal to η), it indicates that the number of reference frequency offset estimates used for determining the frequency offset adjustment of the crystal oscillator does not meet the number requirement for performing the frequency offset adjustment, and at this time, it may be determined that condC is false.
When condA, condB, condC are true simultaneously, i.e. when condA&&condB&&When condC is true, the frequency offset adjustment f adj Is the smoothed frequency offset estimate determined in step 102
Figure BDA0001710900830000121
At this time, the frequency offset adjustment may be performed on the crystal oscillator according to the frequency offset adjustment amount (i.e., the following step 105 is performed); otherwise, the frequency offset adjustment f adj The value of (2) is zero, and at the moment, frequency offset adjustment of the crystal oscillator is not needed.
In addition, the smoothing factor, the preset ratio threshold, the preset time interval threshold and the preset number threshold may be values set by a user, or may be default empirical values, which are not specifically limited in this disclosure. In one embodiment, the user may determine the preset number threshold according to the signal-to-noise ratio, which generally decreases with the increase of the signal-to-noise ratio, and in the Narrow-Band Internet of Things (NB-IoT), the preset number threshold η may be determined according to the following equation (7):
Figure BDA0001710900830000122
where r is the signal-to-noise ratio.
In addition, the value range of the smoothing factor α may be (0,1)]And, the smoothing factor α may be set by the user according to the actual situation, or may be default (for example,
Figure BDA0001710900830000131
) And is not particularly limited in this disclosure.
In the technical scheme, firstly, smoothing is carried out on the obtained current frequency offset estimation and the variance of the current frequency offset estimation so as to obtain a smoothed frequency offset estimation and a smoothed frequency offset estimation variance; and then, determining a frequency offset adjustment amount for adjusting the output frequency of the crystal oscillator according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance. Therefore, under different frequency offset estimation conditions, the frequency deviation of the crystal oscillator can be stably and effectively controlled in a smaller range, and the throughput rate and the performance of the system are improved.
Fig. 2 is a flow chart illustrating a method for frequency tuning of a crystal oscillator according to another exemplary embodiment. As shown in fig. 2, the above method may further include the following steps.
In step 105, the frequency offset of the crystal oscillator is adjusted according to the frequency offset adjustment amount.
In this disclosure, after the frequency offset adjustment amount is obtained in step 104, the frequency offset adjustment amount may be converted into a bias voltage signal of a crystal oscillator, and the crystal oscillator is controlled to adjust an output frequency, thereby adjusting an operating clock of the AFC system.
Fig. 3 is a block diagram illustrating a frequency adjustment apparatus for a crystal oscillator according to an exemplary embodiment. Referring to fig. 3, the apparatus 300 may include: an obtaining module 301, configured to obtain a current frequency offset estimate; a first smoothing module 302, configured to smooth the current frequency offset estimate obtained by the obtaining module 301 to obtain a smoothed frequency offset estimate; a second sliding mode block 303, configured to smooth the variance of the current frequency offset estimation obtained by the obtaining module 302, to obtain a smoothed frequency offset estimation variance; a determining module 304, configured to determine a frequency offset adjustment amount according to the smoothed frequency offset estimation of the first smoothing module 301 and the smoothed frequency offset estimation variance obtained by the second smoothing module 302.
Optionally, the first smoothing module 302 may be configured to perform smoothing processing on the current frequency offset estimate obtained by the obtaining module 301 by using equation (1) above to obtain a smoothed frequency offset estimate.
Optionally, the first smoothing module 302 may be configured to smooth the current frequency offset estimate obtained by the obtaining module 301 by using equation (2) above to obtain a smoothed frequency offset estimate.
Optionally, the second smoothing module 303 may be configured to smooth the variance of the current frequency offset estimate obtained by the obtaining module 302 through the above equation (3), so as to obtain a smoothed frequency offset estimate variance.
Optionally, the second smoothing module 303 may be configured to smooth the variance of the current frequency offset estimate obtained by the obtaining module 301 through the above equation (4), so as to obtain a smoothed frequency offset estimate variance.
Optionally, the determining module 304 may be configured to determine a frequency offset adjustment amount according to the smoothed frequency offset estimate obtained by the first smoothing module 302 and the smoothed frequency offset estimate variance obtained by the second smoothing module 303 through the above equations (5) and (6).
Fig. 4 is a block diagram illustrating a frequency adjustment apparatus for a crystal oscillator according to another exemplary embodiment. Referring to fig. 4, the apparatus 300 may further include: an adjusting module 305, configured to perform frequency offset adjustment on the crystal oscillator according to the frequency offset adjustment amount determined by the determining module 304.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present disclosure also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above-described frequency adjustment method for a crystal oscillator.
Fig. 5 is a block diagram illustrating an electronic device 500 according to an exemplary embodiment, where the electronic device 500 may be provided as a frequency adjustment apparatus for a crystal oscillator. As shown in fig. 5, the electronic device 500 may include: a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input/output (I/O) interface 504, and a communications component 505.
The processor 501 is configured to control the overall operation of the electronic device 500, so as to complete all or part of the steps in the frequency adjustment method for a crystal oscillator. The memory 502 is used to store various types of data to support operations at the electronic device 500, such as instructions for any application or method operating on the electronic device 500, as well as application-related data, such as audio, video, smoothing factors, preset historical time, preset time interval thresholds, preset quantity thresholds, preset ratio thresholds, last smoothed frequency offset estimate variance, each acquired frequency offset estimate, and so forth. Based on this, the processor 501 may perform the above step 102, step 103 and step 104 by using the last smoothed frequency offset estimate, the last smoothed frequency offset estimate variance, the frequency offset estimate obtained each time, and the like in the Memory 502, where the Memory 502 may be implemented by any type of volatile or nonvolatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically Erasable Programmable Read-Only Memory (EEPROM), erasable Programmable Read-Only Memory (EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia component 503 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 502 or transmitted through the communication component 505. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 504 provides an interface between the processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near Field Communication (NFC for short), 2G, 3G or 4G, or a combination of one or more of them, and thus the corresponding Communication component 505 may include: wi-Fi module, bluetooth module, NFC module.
In addition, it should be noted that the processor 501 may also be configured to execute the functions of the adjusting module, and since the functions of the adjusting module are described above, the descriptions of the adjusting module are omitted in this disclosure.
In an exemplary embodiment, the electronic Device 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the frequency adjustment method for a crystal oscillator described above.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions, which when executed by a processor, implement the steps of the above-described frequency adjustment method for a crystal oscillator. For example, the computer readable storage medium may be the memory 502 described above that includes program instructions that are executable by the processor 501 of the electronic device 500 to perform the frequency adjustment method for a crystal oscillator described above.
The electronic device 500 of this embodiment may perform smoothing processing on the obtained current frequency offset estimate and the variance of the current frequency offset estimate to obtain a smoothed frequency offset estimate and a smoothed frequency offset estimate variance; and then, determining a frequency offset adjustment amount for adjusting the output frequency of the crystal oscillator according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance. Therefore, under different frequency offset estimation conditions, the frequency deviation of the crystal oscillator can be stably and effectively controlled within a small range, and the throughput rate and the performance of the system are improved.
The preferred embodiments of the present disclosure are described in detail above with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details in the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. To avoid unnecessary repetition, the disclosure does not separately describe various possible combinations.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (14)

1. A frequency adjustment method for a crystal oscillator, comprising:
obtaining current frequency offset estimation;
smoothing the current frequency offset estimation to obtain a smoothed frequency offset estimation;
smoothing the variance of the current frequency offset estimation to obtain a smoothed frequency offset estimation variance;
determining a frequency offset adjustment amount according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance;
wherein, the frequency offset adjustment amount is determined according to the smoothed frequency offset estimation and the smoothed frequency offset estimation variance by the following formula:
Figure FDA0003872948280000011
Figure FDA0003872948280000012
wherein, f adj Adjusting the amount of the frequency offset;
Figure FDA0003872948280000013
estimating the smoothed frequency offset; condA, condB, condC as an effectThe value condition of the frequency offset adjustment quantity;
Figure FDA0003872948280000014
estimating a variance for the smoothed frequency offset; gamma is a preset ratio threshold; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; Δ t is a time interval between the preset historical time and the current time; epsilon is a preset time interval threshold; η is a predetermined number threshold.
2. The method of claim 1, wherein the current frequency offset estimate is smoothed by the following equation to obtain a smoothed frequency offset estimate:
Figure FDA0003872948280000021
wherein the content of the first and second substances,
Figure FDA0003872948280000022
estimating the smoothed frequency offset;
Figure FDA0003872948280000023
estimating the current frequency offset;
Figure FDA0003872948280000024
estimating the frequency deviation after the last smoothing; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
3. The method of claim 1, wherein the current frequency offset estimate is smoothed by the following equation to obtain a smoothed frequency offset estimate:
Figure FDA0003872948280000025
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003872948280000026
estimating the smoothed frequency offset;
Figure FDA0003872948280000027
estimating the ith frequency offset acquired from the preset historical moment to the current moment; and k is the number of frequency offset estimates obtained from the preset historical moment to the current moment.
4. The method of claim 1, wherein the variance of the current frequency offset estimate is smoothed by the following formula to obtain a smoothed frequency offset estimate variance:
Figure FDA0003872948280000028
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003872948280000029
estimating a variance for the smoothed frequency offset;
Figure FDA00038729482800000210
a variance of the current frequency offset estimate;
Figure FDA00038729482800000211
estimating variance for the frequency offset after the last smoothing;
Figure FDA00038729482800000212
estimating the current frequency offset;
Figure FDA00038729482800000213
estimating the smoothed frequency offset; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
5. The method of claim 1, wherein the variance of the current frequency offset estimate is smoothed by the following formula to obtain a smoothed frequency offset estimate variance:
Figure FDA0003872948280000031
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003872948280000032
estimating a variance for the smoothed frequency offset;
Figure FDA0003872948280000033
the variance of the ith frequency offset estimation obtained from the preset historical moment to the current moment;
Figure FDA0003872948280000034
estimating the ith frequency offset obtained from the preset historical moment to the current moment;
Figure FDA0003872948280000035
estimating the ith smoothed frequency offset acquired from the preset historical moment to the current moment; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
6. The method according to any one of claims 1-5, further comprising:
and carrying out frequency offset adjustment on the crystal oscillator according to the frequency offset adjustment quantity.
7. A frequency adjustment device for a crystal oscillator, comprising:
an obtaining module, configured to obtain a current frequency offset estimate;
a first smoothing module, configured to perform smoothing processing on the current frequency offset estimate obtained by the obtaining module to obtain a smoothed frequency offset estimate;
a second smoothing module, configured to smooth the variance of the current frequency offset estimation obtained by the obtaining module to obtain a smoothed frequency offset estimation variance;
a determining module, configured to determine a frequency offset adjustment amount according to the smoothed frequency offset estimation obtained by the first smoothing module and the smoothed frequency offset estimation variance obtained by the second smoothing module;
the determining module is configured to determine a frequency offset adjustment amount according to the smoothed frequency offset estimation obtained by the first smoothing module and the smoothed frequency offset estimation variance obtained by the second smoothing module by using the following formula:
Figure FDA0003872948280000041
Figure FDA0003872948280000042
wherein f is adj Adjusting the amount of the frequency offset;
Figure FDA0003872948280000043
estimating the smoothed frequency offset; condA, condB and condC are conditions for influencing the value of the frequency offset adjustment quantity;
Figure FDA0003872948280000044
estimating a variance for the smoothed frequency offset; gamma is a preset ratio threshold; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; Δ t is a time interval between the preset historical time and the current time; epsilon is a preset time interval threshold; η is a predetermined number threshold.
8. The apparatus according to claim 7, wherein the first smoothing module is configured to smooth the current frequency offset estimate obtained by the obtaining module by using the following formula to obtain a smoothed frequency offset estimate:
Figure FDA0003872948280000045
wherein the content of the first and second substances,
Figure FDA0003872948280000046
estimating the smoothed frequency offset;
Figure FDA0003872948280000047
estimating the current frequency offset;
Figure FDA0003872948280000048
estimating the frequency deviation after the last smoothing; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
9. The apparatus according to claim 7, wherein the first smoothing module is configured to smooth the current frequency offset estimate obtained by the obtaining module by using the following formula to obtain a smoothed frequency offset estimate:
Figure FDA0003872948280000051
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003872948280000052
estimating the smoothed frequency offset;
Figure FDA0003872948280000053
for the ith frequency obtained from the preset historical time to the current timeEstimating deviation; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment.
10. The apparatus according to claim 7, wherein the second smoothing module is configured to smooth the variance of the current frequency offset estimate obtained by the obtaining module by using the following formula to obtain a smoothed frequency offset estimate variance:
Figure FDA0003872948280000054
wherein the content of the first and second substances,
Figure FDA0003872948280000055
estimating a variance for the smoothed frequency offset;
Figure FDA0003872948280000056
a variance of the current frequency offset estimate;
Figure FDA0003872948280000057
estimating a variance for the most recently smoothed frequency offset;
Figure FDA0003872948280000058
estimating the current frequency offset;
Figure FDA0003872948280000059
estimating the smoothed frequency offset; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
11. The apparatus according to claim 7, wherein the second smoothing module is configured to smooth the variance of the current frequency offset estimate obtained by the obtaining module by using the following formula to obtain a smoothed frequency offset estimate variance:
Figure FDA00038729482800000510
wherein the content of the first and second substances,
Figure FDA00038729482800000511
estimating a variance for the smoothed frequency offset;
Figure FDA00038729482800000512
the variance of the ith frequency offset estimation obtained from the preset historical moment to the current moment;
Figure FDA00038729482800000513
estimating the ith frequency offset obtained from the preset historical moment to the current moment;
Figure FDA00038729482800000514
estimating the ith smoothed frequency offset obtained from the preset historical moment to the current moment; k is the number of frequency offset estimates obtained from the preset historical moment to the current moment; alpha is a smoothing factor.
12. The apparatus according to any one of claims 7-11, further comprising:
and the adjusting module is used for adjusting the frequency offset of the crystal oscillator according to the frequency offset adjusting quantity determined by the determining module.
13. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
14. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1-6.
CN201810682406.0A 2018-06-27 2018-06-27 Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment Active CN110649913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810682406.0A CN110649913B (en) 2018-06-27 2018-06-27 Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810682406.0A CN110649913B (en) 2018-06-27 2018-06-27 Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110649913A CN110649913A (en) 2020-01-03
CN110649913B true CN110649913B (en) 2022-11-18

Family

ID=68989153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810682406.0A Active CN110649913B (en) 2018-06-27 2018-06-27 Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110649913B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111884964B (en) * 2020-06-29 2021-05-04 上海航天电子通讯设备研究所 Frequency synchronization system adapting to VDE multi-modulation system
CN113325919B (en) * 2021-06-24 2024-01-23 新华三技术有限公司 Clock compensation method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716788A (en) * 2004-06-28 2006-01-04 中兴通讯股份有限公司 Method and device for correcting frequency deviation
CN101527583A (en) * 2009-04-17 2009-09-09 中山大学 WCDMA downlink channel parameter estimation method
CN101989968A (en) * 2009-07-31 2011-03-23 联芯科技有限公司 Frequency offset estimation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8660197B2 (en) * 2009-03-06 2014-02-25 Telefonaktiebolaget L M Ericsson (Publ) Method of and equipment for compensating carrier frequency offset in an orthogonal frequency division multiplexing wireless radio transmission system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716788A (en) * 2004-06-28 2006-01-04 中兴通讯股份有限公司 Method and device for correcting frequency deviation
CN101527583A (en) * 2009-04-17 2009-09-09 中山大学 WCDMA downlink channel parameter estimation method
CN101989968A (en) * 2009-07-31 2011-03-23 联芯科技有限公司 Frequency offset estimation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GPS信号校准晶振信号频率源误差在线修正方法;宁玉磊等;《中国测试》;20160430(第04期);全文 *
On the Efficient Estimation of the Frequency-Offset of a Noisy Sinusoid;S. Hineline等;《 Conference Record of the Thirty-Ninth Asilomar Conference onSignals, Systems and Computers, 2005》;20060313;全文 *

Also Published As

Publication number Publication date
CN110649913A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
US10802472B2 (en) Method and apparatus for controlling motor vibration
CN111355678B (en) Automatic gain control method, automatic gain control device, storage medium and electronic equipment
CN110649913B (en) Frequency adjustment method and device for crystal oscillator, storage medium and electronic equipment
US8666946B2 (en) Incremental quantile tracking of multiple record types
CN111628949B (en) Frequency offset estimation method and device, storage medium and computer equipment
CN112135341A (en) Gain parameter adjusting method, device and equipment
US8429215B2 (en) Adaptive filter for channel estimation with adaptive step-size
KR20210053327A (en) Frequency offset estimation and compensation method, apparatus, communication equipment and computer readable storage medium
TW202110147A (en) Channel estimation system and method for minimizing time domain mean square error
CN111181875B (en) Bandwidth adjusting method and device
US9231810B2 (en) Carrier frequency offset calibration method
US11490339B1 (en) Method for determining pilot power, communication device, and storage medium
WO2023040225A1 (en) Frequency offset estimation method and apparatus, electronic device, and computer-readable storage medium
CN114301743B (en) Frequency offset estimation method and device, storage medium and terminal
CN111198673A (en) Word length adjusting method, device, equipment and storage medium
CN110972253A (en) Time-frequency offset estimation method, device, communication equipment and storage medium
CN112865753B (en) Filter coefficient adjusting method and device, storage medium and filter
CN110572299B (en) Equipment testing method, system, device, network node, terminal and storage medium
CN108173608B (en) Method, apparatus and storage medium for obtaining power estimation value and electronic device
CN110311871B (en) Channel average time delay estimation method, device and storage medium
CN108259396B (en) Method, apparatus and storage medium for parameter estimation
CN114726689B (en) Signal estimation method and device
KR102420971B1 (en) Systems and methods for signal processing using power spectral density shape
CN114701451B (en) RSSI value calibration method and device, intelligent equipment and storage medium
CN111768329B (en) Method and device for collecting execution time of kernel, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100085 unit C, building C, lin66, Zhufang Road, Qinghe, Haidian District, Beijing

Applicant after: Beijing Xiaomi pinecone Electronic Co.,Ltd.

Address before: 100085 Beijing city Haidian District Qinghe Shun Yip things Park Building 3 unit A

Applicant before: BEIJING PINECONE ELECTRONICS Co.,Ltd.

GR01 Patent grant
GR01 Patent grant