Device and its implementation of a kind of dynamic adjustment WiMAX base station crystal oscillator stability
Technical field
The present invention relates to a kind of method of adjusting the crystal oscillator stability, especially, relate to device and its implementation of a kind of dynamic adjustment WiMAX base station crystal oscillator stability.
Background technology
The various clocks of WiMAX base station are provided by crystal oscillator, so the precision of crystal oscillator has just determined the precision of all kinds of clocks in WiMAX base station.The characteristics of crystal oscillator have determined it that very high stability is arranged at short notice, but because the influence (for example factor such as variation of temperature, voltage fluctuation) of the aging and environment of crystal oscillator itself, the natural frequency of crystal oscillator can be drifted about, the drift parameter of common crystals can be bigger, it generally is one day a few percent hertz, 1 year several hertz, the drift curve can be with reference to figure 4.If adopt the high rubidium/caesium crystal oscillator of stability, cost can be very high.If allow the crystal oscillator free oscillation, the clock accuracy of WiMAX base station will be As time goes on worse and worse, band and come to such an extent that influence will make the communication reliability of WiMAX base station descend, therefore need be in the process of WiMAX base station operation, dynamically crystal oscillator is adjusted, its output frequency is stabilized within the acceptable accuracy.In addition, need be fast to the calibration of crystal oscillator, when the base station was subjected to external interference like this, the base station can compensate crystal oscillator fast, kept the frequency stability of crystal oscillator, thereby guaranteed the reliability of base station communication.
Summary of the invention
One object of the present invention is to provide the device of a kind of dynamic adjustments WiMAX base station crystal oscillator stability.
Another object of the present invention is to provide the method for a kind of dynamic adjustments WiMAX base station crystal oscillator stability.
A kind of device that is used for WiMAX base station dynamic adjustments crystal oscillator stability of the present invention comprises GPS receiver, frequency counter, phase detectors, phase error adjuster, D/A, crystal oscillator, clock generator, wherein:
The GPS receiver: be used to receive gps signal, the 1pps signal that GPS is produced passes to frequency counter; For solving the problem of WiMAX base station crystal oscillator frequency drift, in the WiMAX base station, to introduce this GPS receiver and be used for receiving gps signal, output 1pps (1pulse per second) signal is for frequency counter provides the time reference reference.
Frequency counter: be used for the clock signal of input is counted, behind the rising edge that detects the 1pps signal that described GPS receiver sends, begin counting, behind the rising edge that detects next 1pps signal, stop counting, this count value is sent to phase detectors;
Phase detectors: be used for the count value that described frequency counter produces is carried out filtering and average treatment, calculate current phase error, this phase error is input to the phase error adjuster;
Phase error adjuster:, calculate adjusted crystal oscillator and regulate parameter according to the current Control Parameter of current phase error, adjustment factor and crystal oscillator;
D/A: the described crystal oscillator according to input is regulated parameter, generates actual crystal oscillator regulation voltage, the frequency of oscillation of control crystal oscillator;
Crystal oscillator: be used under the control of crystal oscillator regulation voltage, produce oscillator signal;
Clock generator: be used for after the described oscillator signal of crystal oscillator output passes through clock generator, producing the multipath clock signal, wherein one tunnel import described frequency counter as counting clock;
Another object of the present invention is to provide a kind of method of utilizing said apparatus to realize dynamic adjustments WiMAX base station crystal oscillator stability, and the method comprising the steps of:
Utilize the GPS receiver to receive gps signal, the 1pps signal that GPS is produced passes to frequency counter;
Utilize frequency counter that the clock signal of input is counted, behind the rising edge that detects the 1pps signal that described GPS receiver sends, begin counting, behind the rising edge that detects next 1pps signal, stop counting, this count value is sent to phase detectors;
Utilization is carried out filtering and average treatment to the count value that described frequency counter produces, and calculates current phase error, and this phase error is input to the phase error adjuster;
Utilize the phase error adjuster,, calculate adjusted crystal oscillator and regulate parameter according to the current Control Parameter of current phase error, adjustment factor and crystal oscillator;
Utilize D/A, regulate parameter, generate actual crystal oscillator regulation voltage, the frequency of oscillation of control crystal oscillator according to the described crystal oscillator of input;
Utilize crystal oscillator, under the control of crystal oscillator regulation voltage, produce oscillator signal;
Utilize clock generator,, wherein one the tunnel import described frequency counter as counting clock with the described oscillator signal generation multipath clock signal of crystal oscillator output;
Wherein, the crystal oscillator of crystal oscillator is regulated parameter according to formula
R
O=R
O'+Δ phase*K
DCalculate R
OBe that current crystal oscillator is regulated parameter,
R
O' be last crystal oscillator regulated value,
Δ phase is current phase error,
K
DBe that crystal oscillator is adjusted coefficient.
Method of the present invention, wherein said K
D=crystal oscillator adjustable range/phase detectors excursion.
Method of the present invention wherein obtains K
DProcess be:
Step 1: sampling number n is set;
Step 2: the minimum value OCXOmin that allows with crystal oscillator regulates crystal oscillator, the measured value COUNTmin of record phase detectors;
Step 3: the maximum OCXOmax that allows with crystal oscillator regulates crystal oscillator, the measured value COUNTmax of record phase detectors;
Step 4: calculating K
D=(OCXOmax-OCXOmin)/(COUNTmax-COUNTmin).
Method of the present invention, wherein phase error adopts coarse adjustment to calculate: Δ phase=phase error and/sampling number.
Method of the present invention, wherein phase error adopts fine tuning to calculate:
If sampling length is n:
{x
0,x
1,x
2,…,x
n-1}
Sliding window length is m, and then the intermediate samples number that obtains in the sliding process from left to right of window is n-m+1, and is during slip that the sampled point phase adduction in the sliding window is average, obtains a new sample sequence, and its length is n-m+1:
{y
0,y
1,y
2,…,y
n-m}
y
i=∑x
k/m
At last, this n-m+1 median phase adduction is average, obtain current phase error:
Δphase=∑y
i/(n-m+1)。
Method of the present invention, wherein the error of frequency counter is f=Emax*68.3%,
Wherein Emax represents the maximum sampling error of frequency counter.
Device and its implementation of a kind of dynamic adjustment WiMAX of the present invention base station crystal oscillator stability, the stability that the 1pps signal that utilizes the GPS receiver to export is calibrated the crystal oscillator output signal frequency, by calculating the adjustment factor between phase detectors and the crystal oscillator, can fast the precision of crystal oscillator be adjusted within the 0.5Hz, and the stable accuracy that finally makes crystal oscillator is in 0.01Hz.This method can be regulated the frequency error of crystal oscillator quickly and accurately, algorithm is simple, by the state exchange between coarse adjustment and the fine tuning, convergence was fast when deviation was big, deviation hour can make crystal oscillator reach the limit of accuracy of oneself and keep stable, can be with the concussion frequency rapid adjustment of a common crystals to very high precision, and long-term stability and short-term stability are all fine.
In a word, device of the present invention and its implementation can dynamically be adjusted crystal oscillator in the process of WiMAX base station operation, and its output frequency is stabilized within the acceptable accuracy; Can quickly calibrated crystal oscillator, when being subjected to external interference in the base station, the base station can compensate crystal oscillator fast, keeps the frequency stability of crystal oscillator, thereby guarantees the reliability of base station communication.Device of the present invention and implementation method can be widely used in the equipment such as WiMAX base station and sweep generator, improve the reliability of communication; Simultaneously, need not buy expensive crystal oscillator, only need just can make the clock of base station reach satisfied precision fast by common crystals and a dynamic calibration system.
Description of drawings
Fig. 1 is a crystal oscillator stability dynamic adjustments structure;
Fig. 2 is a crystal oscillator stability dynamic adjustments state transition graph;
Fig. 3 is a crystal oscillator stability dynamic adjustments flow chart;
Fig. 4 is the frequency drift curve of crystal oscillator when not carrying out the crystal oscillator dynamic adjustments;
Fig. 5 is the frequency drift curve of crystal oscillator when carrying out the crystal oscillator dynamic adjustments.
Embodiment
Below in conjunction with accompanying drawing, the invention will be further described.
Fig. 1 is a WiMAX crystal oscillator stability dynamic adjustments structure chart.
The time reference that frequency counter provides according to the 1pps signal, input clock is counted, this count value is passed to phase detectors, after phase detectors adopt special algorithm that this count value is carried out filtering/average, calculate phase difference, calculate adjusting parameter with phasometer, then crystal oscillator is regulated crystal oscillator.
After frequency counter detects the rising of 1pps signal, begin the clock signal of input is counted, each clock cycle count value adds 1.After the rising edge that detects next 1pps signal, stop counting, current count value is passed to phase detectors, unison counter is clear 0, begins to count next time.
Phase detectors precompute the adjusting relation between crystal oscillator and the phase detectors, it is the crystal oscillator adjustment factor, after calculating current phase error, utilize the crystal oscillator adjustment factor just can calculate bias adjustment value to crystal oscillator, with this bias adjustment value and the addition of current crystal oscillator regulated value, just can calculate actual crystal oscillator regulated value.Just can change the frequency of oscillation of crystal oscillator with the control voltage of this crystal oscillator regulated value adjustment crystal oscillator, the change of crystal oscillator frequency of oscillation is the count value of adjustable frequency counter again, be that this is a closed-loop system, can make system finally reach stable by continuous adjustment phase error.
When detected phase error was bigger, system just can be adjusted to crystal oscillator frequency in the error 0.5Hz by once calculating to regulate by n sampled point averaged.
When detected phase error is smaller, the mean value of system-computed n phase error, each phase error calculates with the method that m sampled point carries out the window moving average, at this moment the crystal oscillator error can be adjusted near the 0.01Hz, and in this error range, swing up and down, reach stable state.
The crystal oscillator output frequency of a short-term stability if desired, by-pass cock that can shutdown system is not promptly regulated crystal oscillator, and at this moment crystal oscillator is in free concussion state, and its short-term stability is by the parameter decision of crystal oscillator itself.
GPS guarantees based on the time of precision, extraordinary long-time stability are arranged, but its short-term stability is poor.In conjunction with GPS and crystal oscillator, utilize the long-time stability calibration crystal oscillator frequency of GPS, can provide a short-term and long-time stability all good crystal oscillator.In addition, the governing speed of the method is very fast, just can make crystal oscillator be in very high frequency accuracy by twice adjusting.
After adopting the crystal oscillator dynamic adjusting method, the drift of crystal oscillator can improve significantly, referring to Fig. 5.
1, general structure
Again referring to Fig. 1, the figure shows the dynamic adjustment structure of WiMAX crystal oscillator.
The GPS receiver
Receive the 1pps signal that GPS launches by gps antenna, with of the reference of this signal incoming frequency counter as counting.
Frequency counter
Behind the rising edge that detects the 1pps signal that GPS sends, begin counting, behind the rising edge that detects next 1pps signal, stop counting, this count value is sent to phase detectors.
Phase detectors
Be used for to the count value that frequency counter produces sample, filtering and average treatment, calculate current phase error, this phase error is input to the phase error adjuster.
The phase error adjuster
According to the current Control Parameter of current phase error and crystal oscillator, calculate adjusted crystal oscillator and regulate parameter
D/A
Crystal oscillator according to input is regulated parameter, generates actual crystal oscillator regulation voltage, the concussion frequency of control crystal oscillator.
Clock generator
The oscillator signal of crystal oscillator output produces the multipath clock signal by behind the clock generator, and wherein one tunnel incoming frequency counter is as counting clock.
2, the realization of phase error adjuster
R
O=R
O’+Δphase*K
D
R
O: current crystal oscillator is regulated parameter
R
O': last crystal oscillator is regulated parameter
Δ phase: current phase error
K
D: crystal oscillator is adjusted coefficient
The input of phase error adjuster is R
O' (last crystal oscillator adjusting parameter) and Δ phase (current phase error), output R
O(current crystal oscillator adjusting parameter) by the Measurement Phase error, just can directly calculate the adjusting parameter to crystal oscillator.
3, the realization of phase detectors
1) calculates crystal oscillator and adjust coefficient (K
D)
This process will be carried out before the operation of crystal oscillator dynamic adjustments algorithm, and purpose is the parameter K that will use after calculating
D.
K
D=crystal oscillator adjustable range/phase detectors excursion
K
DComputational process is:
Step 1: phase detectors sampling number n is set;
Step 2: the minimum value OCXOmin that allows with crystal oscillator regulates crystal oscillator, the measured value COUNTmin of record phase detectors;
Step 3: the maximum OCXOmax that allows with crystal oscillator regulates crystal oscillator, the measured value COUNTmax of record phase detectors;
Step 4: calculate: K
D=(OCXOmax-OCXOmin)/(COUNTmax-COUNTmin);
Step 5: with K
DBe saved among the FLASH, use when base station initiated for WiMAX.
2) in the WiMAX running crystal oscillator is carried out the residing state of dynamic adjustments
In the actual moving process, may be in three state to the adjusting of crystal oscillator, as shown in Figure 2
When crystal oscillator phase error during, enter the coarse adjustment state greater than 0.5Hz
When crystal oscillator phase error during, enter the fine tuning state less than 0.5Hz
If when fine tuning, reach high short-term stability, enter hold mode, promptly crystal oscillator is in free-running operation at this moment, and this moment, clock accuracy depended on the stability of crystal oscillator itself.
3) phase error detection flow process
The phase error detection flow process is referring to Fig. 3
4) filter threshold determines
The counting error of frequency counter is similar to Normal Distribution, so filter threshold is:
f=Emax*68.3%
Wherein Emax represents the maximum sampling error of frequency counter.
5) phase error algorithm
A) coarse adjustment algorithm
Δ phase=phase error and/sampling number
B) fine tuning algorithm
If sampling length is n:
{x
0,x
1,x
2,…,x
n-1}
Sliding window length is m, and then the intermediate samples number that obtains in the sliding process from left to right of window is n-m+1, and is during slip that the sampled point phase adduction in the sliding window is average, obtains a new sample sequence, and its length is n-m+1:
{y
0,y
1,y
2,…,y
n-m}
yi=∑x
k/m
At last, this n-m+1 median phase adduction is average, obtain current phase error:
Δphase=∑y
i/(n-m+1)