Specific implementation mode
In being described below, for illustration and not for limitation, it is proposed that such as tool of particular system structure, technology etc
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention can also be realized in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
It is possible, firstly, to understand ground, under the application scenarios such as Internet of Things, it is simple that communication module is mostly based on FSK/GFSK etc.
The radio frequency chip of modulation system is realized, such as Bluetooth chip, 2.4G proprietary protocols chip, Sub-GHz proprietary protocol chips etc..For
The good communication quality of guarantee usually requires that frequency deviation of the radio frequency chip in its operating temperature range is no more than ± 50PPM.This
Outside, it is contemplated that crystal temperature drift characteristic, at normal temperatures frequency deviation to control within ± 10PPM, that is out most of low cost is brilliant
The specification of body.
In order to make it easy to understand, Fig. 1 shows the block diagram of radio-frequency module core, core is usually by radio frequency core
The reference clock circuit of piece, main control chip (such as CPU or MCU) and periphery is constituted, in portioned product, radio frequency chip and master
Control chip, which can integrate, is deployed to single SoC chip.For radio frequency chip, it is generally operational in hundreds of megahertzs
(MHz) it arrives in the frequency of several Gigahertzs (GHz), and usually requires a reference clock frequency, then pass through frequency synthesizer
(such as phaselocked loop) synthesizes required working frequency.The related work principle of radio-frequency module is illustrated in conjunction with Fig. 1:It receives
The high-frequency signal that access RX is received obtains baseband signal (ABB+ADC/DAC) by frequency mixer (RX Mixer), then passes through tune
Modulator-demodulator (Modem) is demodulated, and baseband signal is obtained;And transmitting path TX then will be through the modulated baseband signals of Modem
High-frequency signal is obtained by frequency mixer (TX Mixer).It is end-to-end to ensure good communication quality in the above-mentioned course of work
The rf frequency deviation of reception/transmitting should control in a certain range.
For the rf frequency of radio-frequency module, usually obtained by the formula of PLL:
FRF=Fref*(N+Nfrac)
Wherein, FRFFor rf frequency, FrefFor reference clock frequency, N is integral multiple frequency, NfracIt is decimal frequency.By
Above formula is as it can be seen that rf frequency bias source is two, when reference clock frequency departure itself, second is that the deviation of multiple, multiple
Deviation can be ignored by increasing the digit progress of decimal frequency multiplication to be reduced to, therefore in embodiments of the present invention, institute
The frequency offset correction being related to is exactly to carry out deviation calibration to the reference clock circuit in radio-frequency module in fact.
According to the modulating characteristic of FSK/GFSK, after modulation, the frequency for the information and date 0 that the frequencies of data 1 includes
Including information it is exactly the opposite, and under the scene of no frequency deviation, after modulation, the frequency values of data 1 and the frequency values phase of data 0
0 is added as, under the scene for having frequency deviation, after modulation, the frequency values of data 1 add up to frequency deviation with the frequency values of data 0.Therefore,
As long as the time long enough that 10101010 sequences are averaged can remove interference and the grass of signal by the means being averaged
The influence come, the result of calculating are to be mixed the deviation of clock.
Fig. 2 shows the implementation process of the frequency offset correction method of radio-frequency module provided in an embodiment of the present invention, the flow
Executive agent is the radio-frequency module of pending frequency offset correction.To the implementation process, details are as follows:
In S201, reception state is entered according to the control instruction of host computer and runs on offset estimation pattern.
In embodiments of the present invention, radio-frequency module is established with host computer connect first, by the calibration software pair on host computer
Either CPU is configured so that MCU or CPU, which controls corresponding radio-frequency module, enters reception shape the MCU of each radio-frequency module
State, and radio-frequency module is made to run on offset estimation pattern.
It is possible to further which the radio-frequency module of multiple pending frequency offset corrections is connect simultaneously with host computer by jig,
So, the scheme referred to based on the embodiment of the present invention, so that it may to realize there are multiple radio-frequency modules at the same time in synchronization
Frequency offset correction is carried out, production efficiency is improved.
In S202, the reference radiofrequency signal emitted by the referrer module of frequency offset correction is received, is penetrated according to the reference
The frequency deviation of the radio-frequency module is calculated in frequency signal, and the frequency deviation based on the radio-frequency module determines calibration value.
Wherein, referrer module is that have passed through the radio-frequency module of frequency offset correction.This programme implementation before, select and wait for into
The identical uniformity module of radio-frequency module model of row frequency offset correction as with reference to module, and passes through the instrument such as frequency spectrograph or frequency meter
Device carries out frequency offset correction to it, with ensure the referrer module can launch close to ideal frequency (such as frequency deviation ± 1PPM with
It is interior) rf frequency reference radiofrequency signal.During for the practical frequency offset correction of radio-frequency module, in advance by referrer module
Connect with host computer, by host computer calibration software to the MCU of referrer module either CPU configure so that MCU or
CPU controls referrer module enters emission state, and the signal launched is to refer to radiofrequency signal.
Specifically, PC control referrer module is sent out with the broadcast mode emitted frame by frame with reference to radiofrequency signal, to realize
It is broadcasted simultaneously with reference to radiofrequency signal to multiple radio-frequency modules.The format for emitting data frame can be as shown in Figure 3, wherein Access
The radio-frequency module that the parts Address are configured to pending frequency offset correction may filter that the special code of reception, and the parts PDU are for sending
It is suitble to the sequence data of offset estimation.For example, for FSK/GFSK, which is the 1010101010 of connection.
It is automatic to calculate after radio-frequency module receives the reference radiofrequency signal from referrer module by RF cable or antenna
Go out the frequency deviation of radio-frequency module, and the frequency deviation based on radio-frequency module, calibration value is calculated using corresponding calibrating mode.
In S203, the calibration value is written to the calibration register of the radio-frequency module, completes frequency offset correction.
After the calibration register of radio-frequency module is written in calibration value, corresponding calibration value in calibration register is carried out
Update, to realize the frequency offset correction to radio-frequency module.
As an embodiment of the present invention, finally obtained calibration value can be stored in its and non-volatile deposited by radio-frequency module
In reservoir, in order to directly get calibration value from nonvolatile memory during follow-up operation, frequency offset correction is improved
Efficiency.
What the embodiment of the present invention had been subjected to that the radio-frequency module of accurate calibration launched based on one preferably refers to radio frequency
Signal so that radio-frequency module is under the premise of connecting host computer, it is no longer necessary to by particular instrument, you can to realize frequency deviation automatically
Estimation and calibration, to greatly improve production efficiency, significantly reduce calibration cost.
In order to solve the problems, such as to cannot achieve calibration in the case where frequency deviation is excessive, further, as shown in figure 4, S202
It may be accomplished by:
S401, receive the referrer module transmitting first refer to radiofrequency signal, radiofrequency signal are referred to according to described first
The first frequency deviation of the radio-frequency module is calculated.
After radio-frequency module is firstly received the first reference radiofrequency signal from referrer module by RF cable or antenna,
The automatic frequency deviation for calculating radio-frequency module.
S402 obtains the calibration if first frequency deviation is less than default frequency deviation threshold value based on first frequency offset calculation
Value.
If being less than default frequency deviation threshold value with reference to calculated first frequency deviation of radiofrequency signal according to first, corresponding school is used
Calibration value is calculated in quasi- mode.
S403 notifies the host computer, so that described if first frequency deviation is greater than or equal to the default frequency deviation threshold value
Host computer indicates that the referrer module transmitting presets the second of frequency deviation and refers to radiofrequency signal.
If being not less than default frequency deviation threshold value with reference to calculated first frequency deviation of radiofrequency signal according to first, radio-frequency module will
The situation active reporting is to host computer, and for host computer after getting the information, control referrer module sends out one with fixed frequency deviation
Second refers to radiofrequency signal, meanwhile, it notifies the frequency deviation value of the second reference radiofrequency signal to give the radio-frequency module.
S403 receives described second and refers to radiofrequency signal, and receives the frequency for the default frequency deviation that the host computer issues
Bias.
The second frequency deviation of the radio-frequency module is calculated according to described second with reference to radiofrequency signal by S404.
S405, if second frequency deviation is less than the default frequency deviation threshold value, based on second frequency deviation and with described default
The frequency deviation value of frequency deviation is compensation, determines the calibration value.
Radio-frequency module calculates the second frequency after receiving second with reference to radiofrequency signal, according to second with reference to radiofrequency signal
Partially, if second frequency deviation is less than default frequency deviation threshold value, corresponding calibrating mode may be used and go to determine calibration value, and in school
During the determination of quasi- value, compensated by the frequency deviation value that host computer is issued.And if referring to radiofrequency signal meter according to second
The second frequency deviation is calculated still less than default frequency deviation threshold value, then returns and notifies the operation of host computer in execution S403 and its subsequently to S405
Operation, send out another at this point, host computer can control referrer module and carry the second of fixed frequency deviation and refer to radiofrequency signal, until
Radio-frequency module calculates the second frequency deviation with reference to radiofrequency signal according to second received and is less than default frequency deviation threshold value.
The adaptive tune with reference to radiofrequency signal may be implemented in the case where frequency deviation is larger in embodiment based on shown in Fig. 4
It is whole, to ensure that calibration range can cover the frequency offset estimation result of radio-frequency module.
Frequency offset correction mode is mentioned above, in embodiments of the present invention, the mode of calibration is divided into two kinds:
The first is reference clock frequency in direct adjustment radio-frequency module, that is, by adjusting the clock tunable load in Fig. 1
Capacitance changes reference clock frequency.Specifically, for the crystal oscillator in radio-frequency module, equivalent circuit such as Fig. 5 institutes
Show, corresponding series resonance frequency fsFor:
And parallel resonance frequency fpFor:
In general, can on crystal oscillator shunt capacitance CL, i.e., tunable load capacitance mentioned hereinabove is practical to make
The frequency of oscillation of work is between fsAnd fpBetween:
Therefore, by tunable load capacitance CLIt is finely adjusted, the frequency of oscillation fr that can be changedr。
Here, tunable load capacitance CLN bit switches capacitor array mode as shown in FIG. 6 can be used, at this point, CL=Cm+
2Cm+…+2(n-1)Cm。
It, can be according to obtained frequency offset estimation result, to tunable load electricity when carrying out calibration calculating by first way
Hold CLIt is finely adjusted, until frequency deviation meets design requirement, i.e. frequency deviation is less than default frequency deviation threshold value, at this point, the value of switch arrays is
For calibration value.
The mode of second of calibration is adjustment PLL fractional divider values.As described above, what fractional frequency division PLL was exported penetrates
Frequent rate is in reference clock frequency FrefUnder be:
FRF=Fref*(N+Nfrac)
Work as FrefThere are deviation, practical reference clock is Fref,re, then rf frequency become:
FRF,re=Fref,re*(N+Nfrac)
To make FRF,re=FRF, can be by adjusting N+NfracValue realize, i.e.,:
Fref/Fref,re=(N '+N 'frac)/(N+Nfrac)
When carrying out calibration calculating by the second way, N can be changed according to frequency offset estimation resultfrac(when more than 1 or
The case where existing to N carries or borrow when less than 0), until frequency deviation meets design requirement, the obtained fractional frequency division device
Value NFrac, offAs calibration value.When N+N is calculated in configuration work frequencyfrac, add NFrac, off, and be configured in PLL, then
Frequency deviation can be compensated.
By taking GFSK modulation systems as an example, the filtered modulated data waveform of 1010101010 sequences as shown in fig. 7, its
In, what solid line represented is 1010101010 sequence of standard, and what dotted line represented has 1010101010 sequence of frequency deviation.Assuming that synchronizing success
In the data of output for calculate frequency deviation average length be k, then the value of k can be 32,64,128 or 256, it is more long in a word more
It is good, then, it is averaged to obtain frequency deviation f by the way that 1010101010 sequences of synchronous calculating later are cumulative.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process
Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit
It is fixed.
Corresponding to the embodiment of the frequency offset correction method of above concerning radio-frequency module, Fig. 8 is provided in an embodiment of the present invention
The schematic diagram of the frequency offset correction device of radio-frequency module.The frequency offset correction device can be the software list being set in radio-frequency module
The unit of member, hardware cell or software and hardware combining, for realizing the frequency offset correction method of radio-frequency module as described above.In order to
Convenient for explanation, only the parts related to the present invention are shown.
With reference to Fig. 8, which includes:
Initialization unit 81 enters reception state according to the control instruction of host computer and runs on offset estimation pattern.
Frequency deviation estimating unit 82 receives the reference radiofrequency signal emitted by the referrer module of frequency offset correction, according to described
The frequency deviation of the radio-frequency module is calculated with reference to radiofrequency signal, and the frequency deviation based on the radio-frequency module determines calibration value.
The calibration register of the radio-frequency module is written in the calibration value by alignment unit 83, completes frequency offset correction.
Optionally, the frequency deviation estimating unit 82 is specifically used for:
Receive the referrer module transmitting first refers to radiofrequency signal, is calculated with reference to radiofrequency signal according to described first
To the first frequency deviation of the radio-frequency module;
If first frequency deviation is less than default frequency deviation threshold value, the calibration value is obtained based on first frequency offset calculation;
If first frequency deviation is greater than or equal to the default frequency deviation threshold value, the host computer is notified, so that described upper
Machine indicates that the referrer module transmitting presets the second of frequency deviation and refers to radiofrequency signal;
It receives described second and refers to radiofrequency signal, and receive the frequency deviation value for the default frequency deviation that the host computer issues;
The second frequency deviation of the radio-frequency module is calculated with reference to radiofrequency signal according to described second;
If second frequency deviation is less than the default frequency deviation threshold value, based on second frequency deviation and with the default frequency deviation
Frequency deviation value is compensation, determines the calibration value.
Further, the frequency deviation estimating unit 82 is additionally operable to:
If second frequency deviation is greater than or equal to the default frequency deviation threshold value, returns to execute and described notify the host computer
Operation, so that the host computer indicates that the referrer module emits the second of another default frequency deviation and refers to radiofrequency signal.
Optionally, the frequency deviation estimating unit 82 is specifically used for:
Adjustment is associated with the capacitance on the crystal oscillator of the radio-frequency module, until the frequency deviation is less than default frequency deviation threshold
Value, the capacitance are n bit switch capacitor arrays, and the n is the integer more than 1;
The value of n bit switches capacitor array when obtaining the frequency deviation less than the default frequency deviation threshold value, as the school
Quasi- value.
Optionally, the frequency deviation estimating unit 82 is specifically used for:
PLL fractional divider values are adjusted, until the frequency deviation is less than default frequency deviation threshold value;
The fractional divider value when frequency deviation is less than default frequency deviation threshold value is obtained, as the calibration value.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work(
Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different
Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion
The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used
It, can also be above-mentioned integrated during two or more units are integrated in one unit to be that each unit physically exists alone
The form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.In addition, each function list
Member, the specific name of module are also only to facilitate mutually distinguish, the protection domain being not intended to limit this application.Above system
The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with
It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute
The division of module or unit is stated, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as
Multiple units or component can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately
A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be by some interfaces, device
Or INDIRECT COUPLING or the communication connection of unit, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can be stored in a computer read/write memory medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on
The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program
Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie
Matter may include:Can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk,
Magnetic disc, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM,
Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described
The content that computer-readable medium includes can carry out increasing appropriate according to legislation in jurisdiction and the requirement of patent practice
Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier signal and electricity
Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality
Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each
Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed
Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.