Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a signal synchronization method and a signal synchronization device.
The technical scheme adopted by the invention is as follows:
the first aspect of the present application provides a signal synchronization method, which is applied to a synchronization device, and includes the following steps:
receiving an input signal, wherein the input signal at least comprises a PN sequence;
preliminary angular frequency deviation estimation is carried out on the input signal, and phase angles of a plurality of PN sequences are calculated respectively;
When the angular frequency deviation of the input signal is larger than the preset angular frequency deviation threshold, calculating the average value of the phase angles of the PN sequences to calculate the angular frequency deviation;
And adjusting the frequency of the input signal according to the calculated angular frequency deviation to realize signal synchronization.
Preferably, the receiving the input signal includes:
receiving an input signal, wherein the input signal comprises a PN sequence and a chirp sequence;
and if the duty ratio of the PN sequence and the chirp sequence in the signal period is smaller than or equal to a preset duty ratio threshold, not carrying out frequency offset correction on the input signal.
Preferably, adjusting the frequency of the input signal according to the calculated angular frequency deviation, achieving signal synchronization includes:
generating a frequency deviation modulation function through the calculated angular frequency deviation;
and multiplying the preset expression of the input signal by a frequency deviation modulation function, and correcting the frequency deviation of the input signal to realize signal synchronization.
Preferably, adjusting the frequency of the input signal according to the calculated angular frequency deviation, achieving signal synchronization includes:
generating a frequency deviation modulation function through the calculated angular frequency deviation;
and multiplying the preset expression of the input signal by a frequency deviation modulation function and then multiplying the preset expression of the input signal by a phase deviation modulation function, and correcting the frequency deviation and the phase deviation of the input signal to realize signal synchronization.
Preferably, the preset input signal has the following expression:
wherein,For the expression of the i-way signal of the receiver,For the expression of the q-way signal of the receiver,As an expression of the transmitted baseband signal,In units of imaginary numbers,In order for the angular frequency deviation to be a function of,Is the initial phase difference of the transmitter carrier and the receiver carrier.
Preferably, the expression of the i paths of signals of the receiver is:
the receiver is provided withThe expression of the way signal is:
wherein,Representing the carrier angular frequency of the transmitter,For the carrier angular frequency of the receiver,For the initial phase of the transmitter carrier,For the initial phase of the receiver carrier wave,Representing the angular frequency deviation of the light beam,Representing the initial phase difference of the transmitter carrier and the receiver carrier.
Preferably, calculating the phase angle of the plurality of PN sequences includes:
performing correlation operation on PN sequences of input signals and local PN sequences to obtain expressions of m correlation peaks;
And dividing the expression of the latter correlation peak by the expression of the former correlation peak to obtain phase angles of a plurality of PN sequences.
Preferably, the expression of the m correlation peaks is:
wherein,An expression representing the first correlation peak,An expression representing the second correlation peak,The expression representing the mth correlation peak, the sampling sequence of PN is reduced to p (N), a >0 being the amplitude of PN, where n=0, 1, 2, N-1, where n=256, p (N) = +1 or-1.
A second aspect of the present application provides a signal synchronization apparatus, including a receiver, applying the above signal synchronization method.
The invention has the beneficial effects that at least one of the following is adopted:
By calculating and correcting the angular frequency deviation, the positioning accuracy of the ranging positioning system can be remarkably improved. The time delay error caused by angular frequency deviation can be effectively compensated, the demodulation quality of signals can be improved, the error rate can be reduced, and the measurement accuracy of the system can be improved.
Even if the crystal oscillator stability of the high-precision clock is reduced due to the temperature drift effect and the aging effect, and the frequency deviation is increased, the angular frequency deviation and the phase deviation can be recalculated according to the requirement, the frequency and the phase of the input signal can be correspondingly adjusted, and the problem of crystal oscillator stability change caused by the temperature drift, the aging effect and other factors in the long-time running process of the crystal oscillator can be solved. Long-term stability and reliability of signal synchronization are ensured.
The angular frequency deviation is estimated by respectively calculating phase angles of a plurality of PN sequences and selecting a method of accumulating or averaging according to different conditions (angular frequency deviation), so that the robustness of the system is enhanced. The method can adapt to angular frequency deviation conditions with different magnitudes, and improves the adaptability and flexibility of the system.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Example 1
The signal synchronization method in this embodiment may be applied to a ranging positioning system, where the ranging positioning system includes at least a transmitter and a receiver, and before the signal synchronization method in this embodiment is applied, an expression having an input signal at a frequency offset and a phase offset may be modeled in advance.
Assume that the transmitted baseband signal has the expression of,The PN sequence for synchronization is a sequence with amplitude A and a value of +1 or-1.
PN=AX [ 1-1-1111-111-1-1-111111-1-111-11-1-11-1-1-1-11], is 32 bits in total, each bit is subjected to 8 times sampling interpolation, namely the PN sequence is subjected to 32 times 8=256 sampling points, the sampling time interval is 10 nanoseconds, or the sampling frequency is 100MHz, and the sampled PN sequence is represented by p (n). For a chirp sequence, each chirp has 80 sampling points, and the expression of the chirp sequence is:
Where B represents the bandwidth of the chirp, and in this embodiment the value of B is 23MHz,Representing the duration of the chirp code, in this embodiment, in the systemMicrosecond, k represents the number of Hz per second of frequency rise and a represents the signal amplitude.
In this embodiment, the transmitter is a single-channel transmitter, i.e. the signal of only i channels is multiplied byWithout multiplication of q-way signalOr otherwiseThe radio frequency signal expression sent by the transmitter is as follows:
wherein,Representing the carrier angular frequency of the transmitter,Is the initial phase of the transmitter carrier.
The carrier angular frequency used by the receiver is,Is generally not equal toThe initial phase of the receiver isIs also generally not equal to. In this case, the i-section of the receiver is usedMultiplying by equation (2), q is usedMultiplying by formula (2), and respectively performing low-pass filtering to obtain the expression of i paths of signals of the receiver as follows:
the expression of q paths of signals of the receiver is as follows:
wherein,Representing the carrier angular frequency of the transmitter,For the carrier angular frequency of the receiver,For the initial phase of the transmitter carrier,For the initial phase of the receiver carrier wave,Representing the angular frequency deviation of the light beam,Representing the initial phase difference of the transmitter carrier and the receiver carrier.
Will beThe expressions that are combined together to construct the receiver input signal:
wherein,For the expression of the i-way signal of the receiver,For the expression of the q-way signal of the receiver,For the expression of the transmitted baseband signal, j is an imaginary unit,In order for the angular frequency deviation to be a function of,Is the initial phase difference of the transmitter carrier and the receiver carrier.
As can be seen from equations (3), (4) and (5), when a frequency offset is present,The i-path signal and q-path signal of the receiver are respectively divided intoAndModulation whenThe larger the modulation the larger the angular frequency, which is at this point, i.e. the i-and q-parts cannot become very small at the same time, nor particularly large at the same time.
When the frequency offset is needed to be corrected, i paths of signals and q paths of signals are needed to be reserved at the same time, if the angular frequency offset can be calculatedA complex exponential function can be constructedFor multiplication with a received signal,In fact, one is generated on the complex planeIs a counter-clockwise rotation vector of the rotation rate, which effectively counteracts the rotation of the rotor byThe resulting phase changes linearly, thereby restoring the signal to a state without frequency offset. This process is known as frequency correction.
After completion of the frequency correction, the received signal still has a fixed phase offsetConstructing a complex exponential function。Essentially a complex number of fixed phase, which acts to rotate the signalRadian, thereby completely counteracting the original phase deviation. This process is known as phase deviation correction.
To sum up, only the received signal is multiplied byThe frequency deviation correction and the phase deviation correction can be completed, and the synchronization of signals is realized.
A signal synchronization method is applied to a synchronization device, as shown in FIG. 1, and comprises the following steps:
step 1, receiving an input signal.
Since the input signal may be affected by various factors during the transmission process, such as temperature, humidity, electromagnetic interference, etc., which may cause the frequency of the input signal to change, the input signal will generally have a frequency offset, so in a possible implementation manner, after the receiver receives the input signal, the receiver directly performs the subsequent step 2 to start frequency offset correction.
In another possible embodiment, it is considered that the magnitude of the frequency offset of the input signal is related to the stability of the crystal oscillator, for example:
assuming that the desired carrier frequencies of both the transmitter and receiver are=2.4 GHz, the stability of the crystal oscillator used isTo the point ofWhen the stability is expressed as the deviation between the frequency of the actual output of the crystal and the desired frequency divided by the desired frequency. Of which 10-6 is higher in stability and 10-5 is worse. When (when)When=2.4 ghz, w=10-6, the result is obtained from formula (5):
illustrating the effect of the frequency offset as if the i-and q-path baseband signals were modulated by a 2.4KHz sinusoidal signal with a period ofWhile baseband signalFor the duration of chirp code。
The period of chirp taking up the sine period. The chirp code can be considered constant amplitude for the period of time it lasts. I.e.In the followingIs almost constant within any interval of (a), and the variation is completely negligible.
When considering whether the PN sequence is affected by frequency offset, the duration of a single PN sequence is。
PN time lengthThe ratio is as followsStill small, the amplitude variation due to the frequency offset can still be ignored.
When (when)At this timeThe baseband signals corresponding to the i-path and the q-path are modulated by 24KHz sinusoidal signals,Becomes 41.7 microseconds, and it is apparent that the chirp period takes upBecomes 0.019, at which time the amplitude variation of chirp over this period can still be ignored. Discovery of occupancy taking into account the period of the PN sequenceThe ratio of (2) becomes 0.061 and the change in amplitude can be ignored.
Further assume that the carrier frequency offset is more severe, i.eAt the time, the chirp period occupiesWill become 0.19, the duration of the PN sequence will beThe share of (c) will become 0.61, at which time the amplitudes of chirp and PN have not been considered constant over their duration. In general, it can be considered that when the periods of chirp and PN are occupiedThe magnitude change may be disregarded when the fraction of (c) is equal to or below 0.1, whereas the magnitude change may be considered when the fraction is above 0.1. How much Hz the frequency offset is received and transmitted by the system and the period of chirp and PN calculated by the frequency offset is occupiedThe share of (2) needs to be determined by measurement.
Although the stability of the crystal oscillator isTo the point ofDuring the time, the amplitude change of the frequency deviation is smaller, but the stability of the crystal oscillator is affected by the temperature drift effect and the aging effect, and the stability of the crystal oscillator is gradually reduced, so that the frequency deviation and the phase deviation are gradually increased. In addition, during the long-term use of the crystal oscillator, due to mechanical vibration or impact, the internal structure of the crystal oscillator may be slightly changed, so that the stability of the crystal oscillator is affected. In addition to physical changes, the electrical parameters of the crystal oscillator also change over time, and these changes also affect the stability of the crystal oscillator.
Thus, the frequency and phase deviations present in the signal cannot be completely rectified by means of a high-precision clock alone, and in one possible implementation the input signal comprises a PN sequence and a chirp sequence. And step 2 is executed if the duty ratio of the PN sequence and the chirp sequence in the signal period is larger than a preset duty ratio threshold, and if the duty ratio of the PN sequence and the chirp sequence in the signal period is smaller than or equal to the preset duty ratio threshold, the frequency offset correction is not carried out on the input signal.
By calculating the duty ratio of PN sequence and chirp sequence in the signal period, the frequency offset information in the signal can be more comprehensively captured, thereby improving the accuracy of frequency offset detection. Even if the frequency stability of the crystal oscillator is reduced due to the aging effect and the temperature drift effect, the embodiment can dynamically judge whether the signal has obvious frequency offset problem, dynamically adjust the frequency offset correction strategy and ensure that the frequency offset correction strategy can respond in time when the frequency offset amplitude in the signal changes.
It should be noted that, by calculating the duty ratio of the PN sequence and the chirp sequence in the signal period, it may be determined whether or not frequency offset correction is required. The system can determine whether to start the frequency offset correction program according to the actual condition of the signal, and the robustness and the flexibility of the system are improved. When the duty cycle of the PN sequence and the chirp sequence is below a preset threshold, the system may choose not to frequency offset the input signal. Therefore, the method can save computing resources and processing time, and particularly avoid unnecessary processing under the condition that the frequency offset influence of the signal is small, and improve the utilization efficiency of resources.
Step 2, carrying out preliminary angular frequency deviation estimation on the input signal and respectively calculating phase angles of a plurality of PN sequences;
Referring to the preliminary frequency offset estimation of the input signal, the approximate range of the frequency offset may be determined by FFT (fast fourier transform) or other spectral analysis methods.
Wherein calculating phase angles of the plurality of PN sequences includes:
And dividing the expression of the latter correlation peak and the expression of the former correlation peak to obtain phase angles of a plurality of PN sequences.
By calculating the phase angles of the plurality of PN sequences, the phase deviation of the input signal can be estimated more accurately. The calculation of the phase angle is based on the phase difference between the correlation peaks, which can more accurately reflect the true phase information of the signal.
The computation of multiple correlation peaks may enhance the interference rejection capability of the system. Even in the presence of noise or other interference, the interference can be better filtered through the phase angle calculation of a plurality of correlation peaks, and the reliability of phase estimation is improved.
The robustness of the system can be improved through multiple correlation operations and phase angle calculations. Even if a single correlation peak is affected by interference or error, more accurate phase information can be obtained through the comprehensive consideration of a plurality of correlation peaks.
Specifically, the first PN sequence is acquired, let equation (5)WhereinRepresenting a sampling time interval which, in this embodiment,Taking 10 nanoseconds, the expression of the input signal received by the receiver can be expressed as:
Wherein the sampling sequence of PN is reduced to p (N), a >0 is the amplitude of PN, where n=0, 1, 2, N-1, where n=256, p (N) = +1 or-1.
After the PN sequence of the receiver is correlated with the local PN, the expression of the first correlation peak is obtained as follows:
also, the expression for the second correlation peak can be obtained as:
Because the initial phase of the second PN sequence is increased relative to the first PN sequenceSimilarly, the expression of the correlation peak of the mth PN sequence can be calculated as:
By usingDivided byThe method comprises the following steps:
In the above,,,AndCan be obtained from the complex number of the i-part and q-part structures of the correlation peak, specifically, the i-part of the m-th correlation peak is taken asThe q part isThenThus, it can be calculated. As can be seen from the above description,The modulus of (a) is equal, which can be checked in the receiver, it can also be seen that the phase angle of the complex number obtained by dividing the second correlation peak with respect to the first correlation peak isIs also the phase angle of the third correlation peak relative to the second correlation peakIs also the phase angle of the fourth correlation peak relative to the third correlation peakN times of (a). The phase angle of the fourth correlation peak relative to the first correlation peak will beThe phase angle of the fourth correlation peak relative to the first correlation peak is 3N times the phase angle difference of the first three PN sequences is added together.
And 3, accumulating phase angles of the PN sequences to calculate the angular frequency deviation when the angular frequency deviation of the input signal is smaller than or equal to a preset angular frequency deviation threshold value, and calculating the average value of the phase angles of the PN sequences to calculate the angular frequency deviation when the angular frequency deviation of the input signal is larger than the preset angular frequency deviation threshold value.
Calculating the phase angles of the plurality of PN sequences can improve the accuracy of the frequency offset estimation. When the frequency offset is smaller, the frequency offset is calculated by accumulating the phase angles of a plurality of PN sequences, and when the frequency offset is larger, the frequency offset is calculated by calculating the average value of the phase angles of the plurality of PN sequences. This method can obtain better results under different frequency offset conditions.
Different calculation methods are flexibly selected under the condition of different frequency offset sizes. And when the frequency deviation is relatively large, calculating the average phase angle. This flexibility enables the system to accommodate different operating environments and signal conditions.
Specifically, when the angular frequency deviation of the input signal is less than or equal to a preset angular frequency deviation threshold, the phase angles of the three PN sequences are added together, namely byResults of (a) are obtained. When the angular frequency deviation of the input signal is larger than a preset angular frequency deviation threshold value, respectively obtaining,,Three were calculatedAveraging it results in a more accurate。
Find outAfter that, due toThe real I and imaginary Q parts of the complex number are known. If it is assumed thatAt an acute angle, both the real and imaginary parts of the complex number are greater than zero, I >0 and Q >0, such that:
Can be found out。
In one possible implementation, complex phase angles may be found by verilog implementation, and sine and cosine calculations are implemented with verilog.
In another possible embodiment, the c language is used to findThis may send an interrupt to the cpu via verilog, transmitting the complex number to the cpuThereby using the c language to calculateThe following operation is performed by using the c language to obtainThe specific process is that theThenFind itTo the power, i.e. to. Once it is foundWhileIt is equal to the conjugate of the same,Naturally can also be found.
Is required to giveDue toVery close to 0, the taylor series expansion is utilized:
Wherein the method comprises the steps ofRepresentative ofThe first derivative at 0 takes a value,Representative ofThe second derivative at 0 takes the value,Representative ofThe third derivative at 0 takes on the value,Representative ofThe fourth derivative at 0 takes the value. Order theThe following calculation process is performed according to equation (13):
Substitution intoThe method comprises the following steps:
This is a complex number, and the direct conjugation of this complex number results in. To desireOne is solved by verilog, and the other is solved by c language and put into a 128 x 8 memory array for the ip core to call.
In the present embodiment, the calculation accuracy can be improved by approximating the inverse operation of the complex exponential function by the taylor series expansion, and the calculation can be simplified by the taylor series expansionIs calculated by the computer. The method avoids the complexity of direct inversion operation, so that the calculation is simpler and more efficient, verilog is used for hardware realization, can calculate complex phase angles in real time, and informs a CPU to further process through an interrupt mechanism. The method can greatly improve the instantaneity of signal processing, is suitable for occasions needing quick response, and reduces the calculation load of a CPU (central processing unit) through hardware calculation realized by verilog. The software part realized by the C language can be expanded or modified as required, so that the expandability of the system is improved.
And 4, adjusting the frequency of the input signal according to the calculated angular frequency deviation to realize signal synchronization.
Specifically, a frequency deviation modulation function is generated from the calculated angular frequency deviation;
and multiplying the preset expression of the input signal by a frequency deviation modulation function, and correcting the frequency deviation of the input signal to realize signal synchronization.
In the present embodiment, the frequency deviation modulation function is. Find outCan calculate. Then multiplying the expression of the preset input signal, namely formula (5)S (t) can be obtained, the frequency correction is completed, and then the phase deviation modulation function is multipliedAnd phase offset correction is completed, so that signal synchronization is realized.
In this embodiment, the positioning accuracy of the ranging positioning system can be significantly improved by calculating and correcting the angular frequency deviation. Compared with the traditional method for reducing the influence of the angular frequency deviation by using a high-precision clock, the method for estimating and correcting the angular frequency deviation by using a software algorithm realizes the estimation and correction of the angular frequency deviation, avoids the hardware complexity and the cost increase caused by introducing the high-precision clock, reduces the dependence on hardware, estimates the angular frequency deviation by respectively calculating the phase angles of a plurality of PN sequences and selecting an accumulation or averaging method according to different conditions (the magnitude of the angular frequency deviation), and enhances the robustness of the system. The system can adapt to angular frequency deviation conditions of different sizes, improves the adaptability and flexibility of the system, solves the problem of angular frequency deviation by adopting a software algorithm instead of a hardware clock, can recalculate the angular frequency deviation and the phase deviation according to the needs, correspondingly adjusts the frequency and the phase of an input signal, and can solve the problem of crystal oscillator stability change caused by factors such as temperature drift, aging effect and the like in the long-time running process of the crystal oscillator. The invention not only can generate the modulation function to correct the frequency deviation according to the angular frequency deviation, but also can generate the frequency deviation modulation function and the phase deviation modulation function at the same time, thereby comprehensively correcting the frequency deviation and the phase deviation of the input signal and further improving the precision of the signal synchronization.
Example two
The present embodiment provides a signal synchronization device, including a receiver, and the signal synchronization method described in the first embodiment is applied.
It will be appreciated that the signal synchronization device in this embodiment further includes a transmitter, where the hardware performance of the transmitter and the receiver are identical, for example, the transmitter and the receiver both use the same crystal oscillator (crystal oscillator) to generate their carrier frequencies, and the bandwidths of the transmitter and the receiver are identical.
In summary, the signal synchronization device in this embodiment realizes efficient and reliable signal synchronization by ensuring consistency in hardware performance of the transmitter and the receiver. The transmitter and the receiver both use the same crystal oscillator to generate carrier frequency, thereby ensuring high frequency stability between the two, and simultaneously, the same bandwidth setting ensures the integrity and reliability of signals in the signal transmission and receiving process, thereby improving the performance of the whole system.
The foregoing examples merely illustrate specific embodiments of the invention, which are described in greater detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention.