CN112565131A - Frequency offset compensation method and system - Google Patents

Frequency offset compensation method and system Download PDF

Info

Publication number
CN112565131A
CN112565131A CN202011423677.8A CN202011423677A CN112565131A CN 112565131 A CN112565131 A CN 112565131A CN 202011423677 A CN202011423677 A CN 202011423677A CN 112565131 A CN112565131 A CN 112565131A
Authority
CN
China
Prior art keywords
frequency offset
phase
initial phase
offset compensation
value
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.)
Pending
Application number
CN202011423677.8A
Other languages
Chinese (zh)
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.)
Shanghai Qingkun Information Technology Co Ltd
Original Assignee
Shanghai Qingkun Information Technology 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 Shanghai Qingkun Information Technology Co Ltd filed Critical Shanghai Qingkun Information Technology Co Ltd
Priority to CN202011423677.8A priority Critical patent/CN112565131A/en
Publication of CN112565131A publication Critical patent/CN112565131A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L27/00Modulated-carrier systems
    • H04L27/0014Carrier regulation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L27/00Modulated-carrier systems
    • H04L27/0014Carrier regulation
    • H04L2027/0024Carrier regulation at the receiver end
    • H04L2027/0026Correction of carrier offset

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)

Abstract

The invention provides a frequency offset compensation method and a system, wherein the method comprises the following steps: acquiring a signal sampling frequency and a frequency offset initial phase parameter; calculating the signal sampling rate and the frequency offset initial phase parameter to obtain an initial phase and frequency offset compensation value of the signal; performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value; obtaining waveform data according to the phase accumulated value and a preset table look-up table; obtaining an output waveform according to the waveform data; and carrying out complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency offset compensation output data. The method has the advantages of less required storage resources, lower power consumption and capability of realizing higher frequency offset compensation precision.

Description

Frequency offset compensation method and system
Technical Field
The present invention relates to the field of wireless communication technologies, and in particular, to a frequency offset compensation method and system.
Background
In a wireless communication system, it is often necessary to compensate the received signal for frequency offset, e.g. at a signal sampling rate fsFrequency offset to be compensated is f0The received signal is x (k) (k is 0,1.. n), and the frequency offset-compensated signal is y (k) (x, y is complex number), then y (k) x (k) (cos (f0/fs 2 pi (k-1)) +1i sin (f0/fs 2 pi (k-1)) +1i sin(k-1))), wherein k is 1,2, 3 … n; the equivalence is regarded as: y (k) ═ x (cos (delta) +1i × sin (delta)), where k ═ 1, … n, and delta is between 0 and 2 × pi. Common frequency offset compensation methods include a table lookup method, a coordinate rotation digital calculation method, a secondary table lookup method and the like, and a signal after frequency offset compensation can be obtained by searching a stored cos table and a sin table.
However, in order to implement high-precision frequency offset compensation, the table lookup method needs to store a relatively large table, and occupies a lot of resources; the coordinate rotation digital calculation method can increase time delay, and in order to realize higher precision, the iteration times are required to be larger, and the power consumption is also increased; the compromise scheme in the secondary table look-up method can better balance the storage space and the power consumption, but after the secondary table look-up, complex multiplication needs to be performed for one more time, certain resources can be consumed, the performance is also influenced by the size of the secondary table look-up, and the high precision is difficult to achieve. Therefore, a frequency offset compensation method with less memory resources, lower power consumption and higher compensation precision is needed.
Disclosure of Invention
The invention aims to provide a frequency offset compensation method and a frequency offset compensation system, which have the advantages of less required storage resources, lower power consumption and capability of realizing higher frequency offset compensation precision.
The technical scheme provided by the invention is as follows:
the invention provides a frequency offset compensation method, which comprises the following steps:
acquiring a signal sampling frequency and a frequency offset initial phase parameter;
calculating the signal sampling rate and the frequency offset initial phase parameter to obtain an initial phase and frequency offset compensation value of the signal;
performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value;
obtaining waveform data according to the phase accumulated value and a preset table look-up table;
obtaining an output waveform according to the waveform data;
and carrying out complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency offset compensation output data.
Specifically, when performing frequency offset compensation, for example, the signal sampling rate is fsFrequency offset to be compensated is f0The received signal is x (k) (0, 1.. n), and the frequency offset-compensated signal is y (k) (x, y are complex numbers), then y (k) × (cos (f0/fs × 2 × pi (k-1)) +1i × sin (f0/fs 2 × pi (k-1))), wherein k ═ 1,2, 3 … n; the equivalence is regarded as: y (k) ═ x (cos (delta) +1i × sin (delta)), where k ═ 1, … n, and delta is between 0 and 2 × pi. In the table look-up method in the prior art, a frequency offset compensation result is obtained by searching a cos and sin table in a range of 0-2 × pi, but the method needs to store a larger table and occupies more resources.
The scheme divides the process into two processes, and divides the delta into: delta1+ delta 2.
According to the Taylor formula, for any function f (x) derivable at x0, and the closer x is to x0, the higher the calculation accuracy, it can be expressed as:
cos(x)=cos(x0)-sin(x0)(x-x0)-cos(x0)(x-x0)2/2;
sin(x)=sin(x0)+cos(x0)(x-x0)-sin(x0)(x-x0)2/2;
for delta in the above example:
cos(delta)=cos(delta1)-sin(delta1)(delta2)-cos(delta1)(delta2)2/2;
sin(delta)=sin(delta1)+cos(delta1)(delta2)-sin(delta1)(delta2)2/2;
where 0 ≦ a <2 × pi for any angle a, may be written as a ≦ b + m × pi/4, where 0 ≦ b < pi/4, and m is a number from 0 to 7. Then cos (a) cos (b + m pi/4); for m ═ 0, cos (a) cos (b); m ═ 1, cos (a) sin (pi/4-b); by analogy, cos (a) can always be expressed as the result of taking the negative sign of the sine and cosine values of the two angles b, pi/4-b. Sin (a) may also be so denoted. Therefore, the calculation of the angle sine-cosine value in the range of 0-2 × pi can be converted into the result of calculating only the range of 0-pi/4, meanwhile, only a cos and sin table in the range of 0-pi/4 needs to be stored, and then the sine-cosine results corresponding to b and pi/4-b can be taken out in a positive and negative sequential access manner, so that the results of sin (delta) and cos delta (delta) are obtained.
Based on the splitting process, the scheme can calculate and obtain initial phase and frequency offset compensation values of signals through signal sampling frequency and frequency offset initial phase parameters, then phase accumulation calculation is carried out on the initial phase and frequency offset compensation values, phase accumulated values can be obtained, one phase accumulated value is output every time the phase accumulated values are accumulated, waveform data can be obtained by inputting the phase accumulated values into a preset table look-up table, output waveforms are further obtained, complex multiplication calculation is carried out on the output waveforms and input data, and frequency offset compensation output data can be obtained; according to the scheme, the table lookup is carried out through the phase accumulated value, the angle range of 0-2 × pi can be mapped to 0-pi × 4, and the operation amount is not required to be increased when a trigonometric function transformation formula is applied, so that only the preset table lookup table with the original size of 1/8 needs to be stored, the storage resources required by the table lookup method are greatly simplified, the power consumption is lower, and higher frequency offset compensation precision can be realized.
Further, the calculating the signal sampling rate and the frequency offset initial phase parameter to obtain the initial phase and frequency offset compensation value of the signal specifically includes:
judging whether to calculate by utilizing the frequency offset initial phase parameter or not by pre-inputting a FreshFlag parameter;
if not, the calculation is terminated;
if the frequency offset initial phase parameter is judged to be the 32-bit unsigned initial phase, calculating the frequency offset initial phase parameter to obtain a normalized 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value. The normalization mode is as follows: and a frequency offset compensation value (f0_ delta ═ round (f0/fs ^ 2^ 32)).
The pre-input FreshFlag parameter refers to a judgment parameter given by software according to whether the current input frequency offset compensation value is consistent with the last input frequency offset compensation value, when the current input frequency offset compensation value is consistent with the last input frequency offset compensation value, FreshFlag is 0, which indicates that the frequency offset compensation value is not changed, and the FreshFlag parameter can be continuously calculated by using the previous initial phase and frequency offset compensation value; when the currently input frequency offset compensation value is inconsistent with the last input frequency offset compensation value, the FreshFlag is 1, which indicates that the frequency offset compensation value changes, and a new initial phase and frequency offset compensation value are needed to be used for calculation.
Further, the performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value specifically includes:
judging whether to refresh the initial phase and the frequency offset compensation value or not by pre-inputting FreshFlag parameters;
if not, not refreshing the initial phase and the frequency offset compensation value, continuing to perform phase accumulation calculation according to the historical initial phase and the frequency offset compensation value, and outputting one phase accumulation value every time the phase accumulation value is accumulated;
if the frequency offset compensation value is judged to be the initial phase, phase accumulation calculation is carried out according to the updated initial phase and the updated frequency offset compensation value, and one phase accumulation value is output every time the phase accumulation value is accumulated.
Further, after obtaining the waveform data according to the phase accumulated value and a preset table look-up table and before obtaining the output waveform according to the waveform data, the method further includes:
and obtaining an initial waveform according to the waveform data.
Further, the obtaining an output waveform according to the waveform data specifically includes:
and calibrating the initial waveform to obtain the accurate output waveform.
In addition, the present invention also provides a frequency offset compensation system, comprising:
the register is used for configuring signal sampling frequency and initial phase offset parameters;
the initial phase frequency offset calculator is connected with the register and used for receiving the signal sampling rate and the frequency offset initial phase parameter input by the register and calculating the signal sampling rate and the frequency offset initial phase parameter to obtain an initial phase and frequency offset compensation value of a signal;
the phase accumulator is connected with the initial phase frequency offset calculator and used for receiving the initial phase and the frequency offset compensation value input by the initial phase frequency offset calculator and carrying out phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value;
the table look-up and waveform generator is connected with the phase accumulator and used for receiving the phase accumulated value input by the phase accumulator, obtaining waveform data according to the phase accumulated value and a preset table look-up table and obtaining an output waveform according to the waveform data;
and the frequency offset calibrator is used for performing complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency offset compensation output data.
According to the scheme, the initial phase frequency offset calculator is used for calculating the signal sampling frequency and the initial phase frequency offset parameter, the initial phase and frequency offset compensation value of the signal can be obtained, the initial phase and frequency offset compensation value is subjected to phase accumulation calculation through the phase accumulator, a phase accumulated value can be obtained, one phase accumulated value is output once the phase accumulated value is accumulated, the phase accumulated value is input into a preset table look-up table through a table look-up and waveform generator, waveform data can be obtained, an output waveform is further obtained, the frequency offset calibrator is used for carrying out complex multiplication calculation on the output waveform and the input data, and frequency offset compensation output data can be obtained; according to the scheme, the table lookup is carried out through the phase accumulated value, the angle range of 0-2 × pi can be mapped to 0-pi × 4, and the operation amount is not required to be increased when a trigonometric function transformation formula is applied, so that only the preset table lookup table with the original size of 1/8 needs to be stored, the storage resources required by the table lookup method are greatly simplified, the power consumption is lower, and higher frequency offset compensation precision can be realized.
Further, the initial phase frequency offset calculator judges whether to use the initial phase frequency offset parameter for calculation or not by pre-inputting a FreshFlag parameter;
if not, the calculation is terminated;
if the frequency offset initial phase parameter is judged to be the 32-bit unsigned initial phase, calculating the frequency offset initial phase parameter to obtain a normalized 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value.
Further, the phase accumulator judges whether to refresh the initial phase and the frequency offset compensation value or not by pre-inputting a FreshFlag parameter;
if not, not refreshing the initial phase and the frequency offset compensation value, continuing to perform phase accumulation calculation according to the historical initial phase and the frequency offset compensation value, and outputting one phase accumulation value every time the phase accumulation value is accumulated;
if the frequency offset compensation value is judged to be the initial phase, phase accumulation calculation is carried out according to the updated initial phase and the updated frequency offset compensation value, and one phase accumulation value is output every time the phase accumulation value is accumulated.
Further, the table lookup and waveform generator obtains an initial waveform according to the waveform data.
Further, still include: and the Taylor arithmetic unit is connected between the table look-up and waveform generator and the frequency offset calibrator and is used for calibrating the initial waveform to obtain the accurate output waveform.
According to the frequency offset compensation method and system provided by the invention, the initial phase and frequency offset compensation values of signals can be obtained through calculation of signal sampling frequency and frequency offset initial phase parameters, then phase accumulation calculation is carried out on the initial phase and frequency offset compensation values, a phase accumulated value can be obtained, one phase accumulated value is output once the phase accumulated value is accumulated, waveform data can be obtained by inputting the phase accumulated value into a preset table look-up table, an output waveform is further obtained, and complex multiplication calculation is carried out on the output waveform and input data, so that frequency offset compensation output data can be obtained; according to the scheme, the table lookup is carried out through the phase accumulated value, the angle range of 0-2 × pi can be mapped to 0-pi × 4, and the operation amount is not required to be increased when a trigonometric function transformation formula is applied, so that only the preset table lookup table with the original size of 1/8 needs to be stored, the storage resources required by the table lookup method are greatly simplified, the power consumption is lower, and higher frequency offset compensation precision can be realized.
Drawings
The foregoing features, technical features, advantages and embodiments of the present invention will be further explained in the following detailed description of the preferred embodiments, which is to be read in connection with the accompanying drawings.
FIG. 1 is a schematic overall flow diagram of an embodiment of the present invention;
FIG. 2 is a block diagram of a table lookup and waveform generator according to an embodiment of the present invention;
FIG. 3 is a block diagram of a Taylor operator according to an embodiment of the present invention;
fig. 4 is a schematic system structure according to an embodiment of the present invention.
Reference numbers in the figures: 1-register 1; 2-initial phase frequency offset calculator; a 3-phase accumulator; 4-table lookup and waveform generator; 5-a frequency offset calibrator; 6-Taylor arithmetic unit.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
Example 1
One embodiment of the present invention, as shown in fig. 1, provides a frequency offset compensation method, including the steps of:
and S1, acquiring a signal sampling frequency and a frequency offset initial phase parameter.
When performing frequency offset compensation, e.g. signal sampling rate fsFrequency offset to be compensated is f0The received signal is x (k) (0, 1.. n), and the frequency offset-compensated signal is y (k) (x, y are complex numbers), then y (k) × (cos (f0/fs × 2 × pi (k-1)) +1i × sin (f0/fs 2 × pi (k-1))), wherein k ═ 1,2, 3 … n; the equivalence is regarded as: y (k) ═ x (cos (delta) +1i × sin (delta)), where k ═ 1, … n, and delta is between 0 and 2 × pi. In the table look-up method in the prior art, a frequency offset compensation result is obtained by searching a cos and sin table in a range of 0-2 × pi, but the method needs to store a larger table and occupies more resources.
The scheme divides the process into two processes, and divides the delta into: delta1+ delta 2.
According to the Taylor formula, for any function f (x) derivable at x0, and the closer x is to x0, the higher the calculation accuracy, it can be expressed as:
cos(x)=cos(x0)-sin(x0)(x-x0)-cos(x0)(x-x0)2/2;
sin(x)=sin(x0)+cos(x0)(x-x0)-sin(x0)(x-x0)2/2;
for delta in the above example:
cos(delta)=cos(delta1)-sin(delta1)(delta2)-cos(delta1)(delta2)2/2;
sin(delta)=sin(delta1)+cos(delta1)(delta2)-sin(delta1)(delta2)2/2;
where 0 ≦ a <2 × pi for any angle a, may be written as a ≦ b + m × pi/4, where 0 ≦ b < pi/4, and m is a number from 0 to 7. Then cos (a) cos (b + m pi/4); for m ═ 0, cos (a) cos (b); m ═ 1, cos (a) sin (pi/4-b); by analogy, cos (a) can always be expressed as the result of taking the negative sign of the sine and cosine values of the two angles b, pi/4-b. Sin (a) may also be so denoted. Therefore, the calculation of the angle sine-cosine value in the range of 0-2 × pi can be converted into the result of calculating only the range of 0-pi/4, meanwhile, only a cos and sin table in the range of 0-pi/4 needs to be stored, and then the sine-cosine results corresponding to b and pi/4-b can be taken out in a positive and negative sequential access manner, so that the results of sin (delta) and cos delta (delta) are obtained.
And S2, calculating the signal sampling frequency and the initial phase offset parameter to obtain the initial phase and the frequency offset compensation value of the signal.
Preferably, the calculating the signal sampling frequency and the initial phase offset parameter to obtain the initial phase and the initial phase offset compensation value of the signal specifically includes:
judging whether to calculate by using a frequency offset initial phase parameter or not by pre-inputting a FreshFlag parameter; if not, the calculation is terminated; if the frequency offset compensation value is judged to be yes, calculating the frequency offset initial phase parameter to obtain a 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value. The normalization mode is as follows: and a frequency offset compensation value (f0_ delta ═ round (f0/fs ^ 2^ 32)).
The pre-input FreshFlag parameter refers to a judgment parameter given by software according to whether the current input frequency offset compensation value is consistent with the last input frequency offset compensation value, when the current input frequency offset compensation value is consistent with the last input frequency offset compensation value, FreshFlag is 0, which indicates that the frequency offset compensation value is not changed, and the FreshFlag parameter can be continuously calculated by using the previous initial phase and frequency offset compensation value; when the currently input frequency offset compensation value is inconsistent with the last input frequency offset compensation value, the FreshFlag is 1, which indicates that the frequency offset compensation value changes, and a new initial phase and frequency offset compensation value are needed to be used for calculation.
And S3, performing phase accumulation calculation on the initial phase and frequency offset compensation values to obtain a phase accumulation value, and recording the phase accumulation value as delta.
Preferably, the phase accumulation calculation is performed on the initial phase and frequency offset compensation values to obtain a phase accumulation value, and the method specifically includes:
judging whether to refresh an initial phase and a frequency offset compensation value or not by pre-inputting a FreshFlag parameter; if not, not refreshing the initial phase and frequency offset compensation values, continuously performing phase accumulation calculation according to the historical initial phase and frequency offset compensation values, and outputting one phase accumulation value every time the phase accumulation is performed; if the frequency offset compensation value is judged to be the initial phase, phase accumulation calculation is carried out according to the updated initial phase and the updated frequency offset compensation value, and a phase accumulation value is output every time the phase accumulation is carried out.
And S4, obtaining waveform data according to the phase accumulated value and a preset table look-up table.
Specifically, as shown in fig. 2, in the present embodiment, the table lookup is performed by the table lookup and waveform generator, the phase accumulated value is input into the table lookup and waveform generator, and if delta is greater than 2^32-1, delta-2^ 32; taking Findex ═ (30 th to 32 th bit of delta); taking delta _ n (1 st-29 th bit of delta), if Findex is odd, refreshing delta _ n to be 2^29-1-delta _ n; taking index1 as the 25 th bit to the 29 th bit of delta _ n, and taking index2 as the 17 th bit to the 24 th bit of delta _ n; the waveform data x can be obtained by inputting a preset lookup table using index1 to perform lookup.
And S5, obtaining an output waveform according to the waveform data.
And S6, performing complex multiplication calculation on the input data and the output waveform of the signal to obtain frequency offset compensation output data.
Based on the splitting process, the scheme can calculate and obtain initial phase and frequency offset compensation values of signals through signal sampling frequency and frequency offset initial phase parameters, then phase accumulation calculation is carried out on the initial phase and frequency offset compensation values, phase accumulated values can be obtained, one phase accumulated value is output every time the phase accumulated values are accumulated, waveform data can be obtained by inputting the phase accumulated values into a preset table look-up table, output waveforms are further obtained, complex multiplication calculation is carried out on the output waveforms and input data, and frequency offset compensation output data can be obtained; according to the scheme, the table lookup is carried out through the phase accumulated value, the angle range of 0-2 × pi can be mapped to 0-pi × 4, and the operation amount is not required to be increased when a trigonometric function transformation formula is applied, so that only the preset table lookup table with the original size of 1/8 needs to be stored, the storage resources required by the table lookup method are greatly simplified, the power consumption is lower, and higher frequency offset compensation precision can be realized.
Example 2
An embodiment of the present invention, on the basis of embodiment 1, after obtaining waveform data according to a phase accumulated value and a preset table lookup table, and before obtaining an output waveform according to the waveform data, further includes: an initial waveform is obtained from the waveform data.
Preferably, S5, obtaining the output waveform according to the waveform data specifically includes: and calibrating the initial waveform to obtain an accurate output waveform.
Specifically, as shown in fig. 3, the waveform data x, index2 and Findex are input to a Taylor operator:
z=index2*const;
x1_re=real(x)-imag(x)*z-real(x)*z^2/2;
x1_im=imag(x)+real(x)*z-imag(x)*z^2/2;
thereafter, the waveform data x, x — x1_ re +1i × 1_ im can be updated; and finally, obtaining an accurate output waveform according to the Findex and the calibrated waveform data x.
Example 3
One embodiment of the present invention. As shown in fig. 4, the present invention further provides a frequency offset compensation system, which includes a register 1, an initial phase frequency offset calculator 2, a phase accumulator 3, a table lookup and waveform generator 4, a frequency offset calibrator 5, and a taylor operator 6.
The register 1 is used for configuring the signal sampling frequency and the initial phase offset parameter.
When performing frequency offset compensation, e.g. signal sampling rate fsFrequency offset to be compensated is f0The received signal is x (k) (0, 1.. n), and the frequency offset-compensated signal is y (k) (x, y are complex numbers), then y (k) × (cos (f0/fs × 2 × pi (k-1)) +1i × sin (f0/fs 2 × pi (k-1))), wherein k ═ 1,2, 3 … n; the equivalence is regarded as: y (k) ═ x (cos (delta) +1i × sin (delta)), where k ═ 1, … n, and delta is between 0 and 2 × pi. In the table look-up method in the prior art, a frequency offset compensation result is obtained by searching a cos and sin table in a range of 0-2 × pi, but the method needs to store a larger table and occupies more resources.
The scheme divides the process into two processes, and divides the delta into: delta1+ delta 2.
According to the Taylor formula, for any function f (x) derivable at x0, and the closer x is to x0, the higher the calculation accuracy, it can be expressed as:
cos(x)=cos(x0)-sin(x0)(x-x0)-cos(x0)(x-x0)2/2;
sin(x)=sin(x0)+cos(x0)(x-x0)-sin(x0)(x-x0)2/2;
for delta in the above example:
cos(delta)=cos(delta1)-sin(delta1)(delta2)-cos(delta1)(delta2)2/2;
sin(delta)=sin(delta1)+cos(delta1)(delta2)-sin(delta1)(delta2)2/2;
where 0 ≦ a <2 × pi for any angle a, may be written as a ≦ b + m × pi/4, where 0 ≦ b < pi/4, and m is a number from 0 to 7. Then cos (a) cos (b + m pi/4); for m ═ 0, cos (a) cos (b); m ═ 1, cos (a) sin (pi/4-b); by analogy, cos (a) can always be expressed as the result of taking the negative sign of the sine and cosine values of the two angles b, pi/4-b. Sin (a) may also be so denoted. Therefore, the calculation of the angle sine-cosine value in the range of 0-2 × pi can be converted into the result of calculating only the range of 0-pi/4, meanwhile, only a cos and sin table in the range of 0-pi/4 needs to be stored, and then the sine-cosine results corresponding to b and pi/4-b can be taken out in a positive and negative sequential access manner, so that the results of sin (delta) and cos delta (delta) are obtained.
The initial phase frequency offset calculator 2 is connected with the register 1, and is configured to receive the signal sampling frequency and the initial phase offset parameter input by the register 1, and calculate the signal sampling frequency and the initial phase offset parameter to obtain an initial phase and frequency offset compensation value of the signal.
Preferably, the initial phase frequency offset calculator 2 judges whether to calculate by using the frequency offset initial phase parameter by pre-inputting the FreshFlag parameter; if not, the calculation is terminated; if the frequency offset compensation value is judged to be yes, calculating the frequency offset initial phase parameter to obtain a 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value. The normalization mode is as follows: and a frequency offset compensation value (f0_ delta ═ round (f0/fs ^ 2^ 32)).
The pre-input FreshFlag parameter refers to a judgment parameter given by software according to whether the current input frequency offset compensation value is consistent with the last input frequency offset compensation value, when the current input frequency offset compensation value is consistent with the last input frequency offset compensation value, FreshFlag is 0, which indicates that the frequency offset compensation value is not changed, and the FreshFlag parameter can be continuously calculated by using the previous initial phase and frequency offset compensation value; when the currently input frequency offset compensation value is inconsistent with the last input frequency offset compensation value, the FreshFlag is 1, which indicates that the frequency offset compensation value changes, and a new initial phase and frequency offset compensation value are needed to be used for calculation.
The phase accumulator 3 is connected to the initial phase frequency offset calculator 2, and is configured to receive the initial phase and frequency offset compensation values input by the initial phase frequency offset calculator 2, and perform phase accumulation calculation on the initial phase and frequency offset compensation values to obtain a phase accumulation value, which is recorded as delta.
Preferably, the phase accumulator 3 judges whether to refresh the initial phase and frequency offset compensation value by pre-inputting the FreshFlag parameter; if not, not refreshing the initial phase and frequency offset compensation values, continuously performing phase accumulation calculation according to the historical initial phase and frequency offset compensation values, and outputting one phase accumulation value every time the phase accumulation is performed; if the frequency offset compensation value is judged to be the initial phase, phase accumulation calculation is carried out according to the updated initial phase and the updated frequency offset compensation value, and a phase accumulation value is output every time the phase accumulation is carried out.
The look-up table and waveform generator 4 is connected with the phase accumulator 3 and used for receiving the phase accumulated value input by the phase accumulator, obtaining waveform data according to the phase accumulated value and a preset look-up table, and obtaining an output waveform according to the waveform data.
Specifically, as shown in fig. 2, the phase accumulated value is input into the lookup table and the waveform generator, and if delta is greater than 2^32-1, then delta-2^ 32; taking index Findex ═ (30 th to 32 th bits of delta); taking delta _ n (1 st-29 th bit of delta), if Findex is odd, refreshing delta _ n to be 2^29-1-delta _ n; taking index1 as the 25 th bit to the 29 th bit of delta _ n, and taking index2 as the 17 th bit to the 24 th bit of delta _ n; the waveform data x can be obtained by inputting a preset lookup table using index1 to perform lookup.
Preferably, the look-up table and waveform generator 4 obtains the initial waveform from the waveform data.
The taylor arithmetic unit 6 is connected between the table look-up and waveform generator 4 and the frequency offset calibrator 5, and is used for calibrating the initial waveform to obtain an accurate output waveform.
Specifically, as shown in fig. 3, the waveform data x, index2 and Findex are input to a Taylor operator:
z=index2*const;
x1_re=real(x)-imag(x)*z-real(x)*z^2/2;
x1_im=imag(x)+real(x)*z-imag(x)*z^2/2;
thereafter, the waveform data x, x — x1_ re +1i × 1_ im can be updated; and finally, obtaining an accurate output waveform according to the Findex and the calibrated waveform data x.
The frequency offset calibrator 5 is configured to perform complex multiplication on the input data and the output waveform of the signal to obtain frequency offset compensation output data.
According to the scheme, the initial phase frequency offset calculator 2 is used for calculating the signal sampling frequency and the initial phase frequency offset parameter, the initial phase and frequency offset compensation value of the signal can be obtained, the initial phase and frequency offset compensation value is subjected to phase accumulation calculation through the phase accumulator 3, a phase accumulated value can be obtained, one phase accumulated value is output once the phase accumulated value is accumulated, the phase accumulated value is input into a preset table look-up table through the table look-up and waveform generator 4, waveform data can be obtained, an output waveform is further obtained, and the frequency offset calibrator 5 is used for performing complex multiplication calculation on the output waveform and the input data to obtain frequency offset compensation output data; according to the scheme, the table lookup is carried out through the phase accumulated value, the angle range of 0-2 × pi can be mapped to 0-pi × 4, and the operation amount is not required to be increased when a trigonometric function transformation formula is applied, so that only the preset table lookup table with the original size of 1/8 needs to be stored, the storage resources required by the table lookup method are greatly simplified, the power consumption is lower, and higher frequency offset compensation precision can be realized.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method of frequency offset compensation, comprising the steps of:
acquiring a signal sampling frequency and a frequency offset initial phase parameter;
calculating the signal sampling rate and the frequency offset initial phase parameter to obtain an initial phase and frequency offset compensation value of the signal;
performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value;
obtaining waveform data according to the phase accumulated value and a preset table look-up table;
obtaining an output waveform according to the waveform data;
and carrying out complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency offset compensation output data.
2. The method of claim 1, wherein the calculating the signal sampling rate and the frequency offset initial phase parameter to obtain an initial phase and a frequency offset compensation value of the signal specifically includes:
judging whether to calculate by utilizing the frequency offset initial phase parameter or not by pre-inputting a FreshFlag parameter;
if not, the calculation is terminated;
if the frequency offset initial phase parameter is judged to be the 32-bit unsigned initial phase, calculating the frequency offset initial phase parameter to obtain a normalized 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value.
3. The method of claim 1, wherein the performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value specifically comprises:
judging whether to refresh the initial phase and the frequency offset compensation value or not by pre-inputting FreshFlag parameters;
if not, not refreshing the initial phase and the frequency offset compensation value, continuing to perform phase accumulation calculation according to the historical initial phase and the frequency offset compensation value, and outputting one phase accumulation value every time the phase accumulation value is accumulated;
if the frequency offset compensation value is judged to be the initial phase, phase accumulation calculation is carried out according to the updated initial phase and the updated frequency offset compensation value, and one phase accumulation value is output every time the phase accumulation value is accumulated.
4. The method of claim 1, wherein after obtaining the waveform data according to the phase accumulation value and the predetermined look-up table, and before obtaining the output waveform according to the waveform data, the method further comprises:
and obtaining an initial waveform according to the waveform data.
5. The method of claim 4, wherein the obtaining an output waveform according to the waveform data specifically includes:
and calibrating the initial waveform to obtain the accurate output waveform.
6. A frequency offset compensation system, comprising:
the register is used for configuring signal sampling frequency and initial phase offset parameters;
the initial phase frequency offset calculator is connected with the register and used for receiving the signal sampling rate and the frequency offset initial phase parameter input by the register and calculating the signal sampling rate and the frequency offset initial phase parameter to obtain an initial phase and frequency offset compensation value of a signal;
the phase accumulator is connected with the initial phase frequency offset calculator and used for receiving the initial phase and the frequency offset compensation value input by the initial phase frequency offset calculator and carrying out phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value;
the table look-up and waveform generator is connected with the phase accumulator and used for receiving the phase accumulated value input by the phase accumulator, obtaining waveform data according to the phase accumulated value and a preset table look-up table and obtaining an output waveform according to the waveform data;
and the frequency offset calibrator is used for performing complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency offset compensation output data.
7. The frequency offset compensation system of claim 6, wherein: the initial phase frequency offset calculator judges whether to use the frequency offset initial phase parameter for calculation or not by pre-inputting a FreshFlag parameter;
if not, the calculation is terminated;
if the frequency offset initial phase parameter is judged to be the 32-bit unsigned initial phase, calculating the frequency offset initial phase parameter to obtain a normalized 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value.
8. The frequency offset compensation system of claim 6, wherein: the phase accumulator judges whether to refresh the initial phase and the frequency offset compensation value or not through pre-inputting FreshFlag parameters;
if not, not refreshing the initial phase and the frequency offset compensation value, continuing to perform phase accumulation calculation according to the historical initial phase and the frequency offset compensation value, and outputting one phase accumulation value every time the phase accumulation value is accumulated;
if the frequency offset compensation value is judged to be the initial phase, phase accumulation calculation is carried out according to the updated initial phase and the updated frequency offset compensation value, and one phase accumulation value is output every time the phase accumulation value is accumulated.
9. The frequency offset compensation system of claim 6, wherein: and the table lookup and waveform generator obtains an initial waveform according to the waveform data.
10. The frequency offset compensation system of claim 9, further comprising: and the Taylor arithmetic unit is connected between the table look-up and waveform generator and the frequency offset calibrator and is used for calibrating the initial waveform to obtain the accurate output waveform.
CN202011423677.8A 2020-12-08 2020-12-08 Frequency offset compensation method and system Pending CN112565131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011423677.8A CN112565131A (en) 2020-12-08 2020-12-08 Frequency offset compensation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011423677.8A CN112565131A (en) 2020-12-08 2020-12-08 Frequency offset compensation method and system

Publications (1)

Publication Number Publication Date
CN112565131A true CN112565131A (en) 2021-03-26

Family

ID=75059726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011423677.8A Pending CN112565131A (en) 2020-12-08 2020-12-08 Frequency offset compensation method and system

Country Status (1)

Country Link
CN (1) CN112565131A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102651725A (en) * 2011-02-25 2012-08-29 中兴通讯股份有限公司 Multi-user frequency offset compensation method and device
CN104301264A (en) * 2013-07-15 2015-01-21 普天信息技术研究院有限公司 Frequency offset compensation method
CN109521992A (en) * 2018-11-14 2019-03-26 桂林电子科技大学 A kind of linear FM signal generation method based on cordic algorithm of multiplier-less
CN111865865A (en) * 2020-08-04 2020-10-30 北京空天智数科技有限公司 Frequency offset and phase offset estimation method suitable for high-sensitivity satellite-borne ADS-B receiver

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102651725A (en) * 2011-02-25 2012-08-29 中兴通讯股份有限公司 Multi-user frequency offset compensation method and device
CN104301264A (en) * 2013-07-15 2015-01-21 普天信息技术研究院有限公司 Frequency offset compensation method
CN109521992A (en) * 2018-11-14 2019-03-26 桂林电子科技大学 A kind of linear FM signal generation method based on cordic algorithm of multiplier-less
CN111865865A (en) * 2020-08-04 2020-10-30 北京空天智数科技有限公司 Frequency offset and phase offset estimation method suitable for high-sensitivity satellite-borne ADS-B receiver

Similar Documents

Publication Publication Date Title
CN100520672C (en) DDS signal source amplitude-frequency characteristic compensation method and related DDS signal source
CN105306056A (en) Scale factor temperature compensating method of current frequency conversion circuit
CN109572483B (en) Remaining mileage calculation method and device for pure electric vehicle
CN103345037A (en) Reshaping signal control method of camera voice coil motor actuator
CN104038134A (en) Method for correcting position error of permanent magnet synchronous motor rotor based on linear hall
CN104698845B (en) Radar antenna servo tracking method and system based on automatic disturbance rejection controller
CN103067016B (en) A kind of streamline time to digital converter device and method thereof
CN103178779A (en) Signal generator with amplitude compensation function and method thereof
TW201505377A (en) Phase-amplitude conversion method and device in DDS (Direct Digital Synthesizer)
CN115979324A (en) Nonlinear calibration method and device for magnetic encoder
CN103457608B (en) For operating the system and method for analog-digital converter
CN115097899A (en) High-response power waveform simulation method
CN108196217B (en) Direct current metering method and system for off-board charger current calibration instrument
CN112565131A (en) Frequency offset compensation method and system
CN106053884A (en) Double-shaft resonant accelerometer digital control circuit device based on coordinate rotation method
CN101488752B (en) Temperature frequency correcting apparatus
CN106324342B (en) Harmonic detection method based on table lookup
CN110633447B (en) Spherical distance fixed-point calculation method based on FPGA and calculation device thereof
CN102507993B (en) Burst signal generator with automatic initial phase calibration function
US7209937B2 (en) Method and apparatus for generation of arbitrary mono-cycle waveforms
CN107943204B (en) Digital frequency synthesis method and device
KR20170139968A (en) Apparatus and method for counting a cycle of a battery
CN112565129B (en) Frequency offset compensation method and system
CN112565129A (en) Frequency offset compensation method and system
CN103095297B (en) Method for generating accurate frequency by direct digital frequency synthesizer

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