A frequency deviation compensation method and system

By splitting the frequency offset angle and using Taylor's formula for approximate calculation, only 1/8 of the original size table needs to be stored, which solves the problems of frequency offset compensation resource occupation and high power consumption in the existing technology, and achieves high-precision frequency offset compensate.

CN112565131BActive Publication Date: 2024-10-01SHANGHAI QINGKUN INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202011423677.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-08
Publication Date
2024-10-01
Estimated Expiration
2040-12-08

AI Technical Summary

Technical Problem

Frequency offset compensation methods in existing wireless communication systems require a large amount of storage resources and high power consumption, making it difficult to achieve high-precision frequency offset compensation.

Method used

By splitting the frequency offset angle into two parts and using Taylor's formula to perform approximate calculations of trigonometric functions, we only need to store a table in the 0-pi/4 range, look up the table through the phase accumulation value, realize frequency offset compensation, and refresh the Flags optimize the calculation process and reduce unnecessary calculations.

Benefits of technology

It greatly reduces the occupation of storage resources and reduces power consumption. At the same time, it improves the accuracy of frequency offset compensation and achieves more efficient frequency offset compensation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112565131B_ABST
    Figure CN112565131B_ABST
Patent Text Reader

Abstract

The present invention provides a frequency offset compensation method and system, the method comprising the steps of: obtaining a signal sampling rate and a frequency offset initial phase parameter; calculating the signal sampling rate and the frequency offset initial phase parameter to obtain a signal initial phase and a frequency offset compensation value; 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 accumulation value and a preset lookup table; obtaining an output waveform according to the waveform data; performing complex multiplication calculation on the signal input data and the output waveform to obtain frequency offset compensation output data. The method requires less storage resources, has lower power consumption, and can achieve higher frequency offset compensation accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of wireless communication technology, and in particular to a frequency offset compensation method and system. Background Art

[0002] In wireless communication systems, it is often necessary to compensate the frequency offset of the received signal. For example, if the signal sampling rate is f s , the frequency offset to be compensated is f0, the received signal is X(K)(k=0,1...n), and the signal after frequency offset compensation is y(k)(x,y are complex numbers), then y(k)=x(k)*(cos(f0 / fs*2*pi*(k-1))+1i*sin(f0 / fs*2*pi*(k-1))), where k=1,2,3…n; equivalently, it can be regarded as: y(k)=x(k)*(cos(delta)+1i*sin(delta)), where k=1,…n, delta is between 0-2*pi. Common frequency offset compensation methods include table lookup method, coordinate rotation digital calculation method, quadratic table lookup method, etc. By searching the stored cos and sin tables, the signal after frequency offset compensation can be obtained.

[0003] However, in order to achieve high-precision frequency offset compensation, the table lookup method needs to store a relatively large table, which occupies more resources; the coordinate rotation digital calculation method will increase the delay, and in order to achieve higher precision, a large number of iterations are required, which will also increase power consumption; the secondary table lookup method is a compromise solution that can better balance storage space and power consumption, but after the secondary table lookup, one more complex multiplication is required, which will also consume certain resources, and the performance is also affected by the size of the secondary table lookup, making it difficult to achieve high precision. Therefore, a frequency offset compensation method with less storage resources, lower power consumption, and higher compensation accuracy is needed. Summary of the invention

[0004] The object of the present invention is to provide a frequency offset compensation method and system, which require less storage resources, lower power consumption, and can achieve higher frequency offset compensation accuracy.

[0005] The technical solution provided by the present invention is as follows:

[0006] The present invention provides a frequency offset compensation method, comprising the steps of:

[0007] Obtain signal sampling rate and frequency deviation initial phase parameters;

[0008] Calculating the signal sampling rate and the frequency deviation initial phase parameter to obtain the signal initial phase and frequency deviation compensation value;

[0009] Performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value;

[0010] Obtaining waveform data according to the phase accumulation value and a preset lookup table;

[0011] Obtaining an output waveform according to the waveform data;

[0012] Complex multiplication is performed on the input data of the signal and the output waveform to obtain frequency offset compensated output data.

[0013] Specifically, when performing frequency offset compensation, if the signal sampling rate is f s , the frequency deviation to be compensated is f0, the received signal is X(K)(k=0,1...n), and the signal after frequency deviation compensation is y(k)(x,y are complex numbers), then y(k)=x(k)*(cos(f0 / fs*2*pi*(k-1))+1i*sin(f0 / fs*2*pi*(k-1))), where k=1,2,3…n; equivalently, it can be regarded as: y(k)=x(k)*(cos(delta)+1i*sin(delta)), where k=1,…n, delta is between 0-2*pi. The table lookup method in the prior art is to obtain the frequency deviation compensation result by looking up the cos, sin table in the range of 0-2*pi, but this method needs to store a large table and occupies more resources.

[0014] This solution splits the above process into two processes, splitting delta into: delta=delta1+delta2.

[0015] According to Taylor's formula, for any function f(x) that is differentiable at x0, and the closer x is to x0, the higher the calculation accuracy, it can be expressed as:

[0016] cos(x)=cos(x0)-sin(x0)(x-x0)-cos(x0)(x-x0) 2 / 2;

[0017] sin(x)=sin(x0)+cos(x0)(x-x0)-sin(x0)(x-x0) 2 / 2;

[0018] For delta in the above example:

[0019] cos(delta)=cos(delta1)-sin(delta1)(delta2)-cos(delta1)(delta2) 2 / 2;

[0020] sin(delta)=sin(delta1)+cos(delta1)(delta2)-sin(delta1)(delta2) 2 / 2;

[0021] Among them, for any angle a, 0 ≤ a < 2*pi, it can be written as a = b + m*pi / 4, where 0 ≤ b < pi / 4 and m is a number between 0 and 7. Then cos(a) = cos(b + m*pi / 4); for m = 0, cos(a) = cos(b); for m = 1, cos(a) = sin(pi / 4 - b); and so on. Cos(a) can always be expressed as the sine and cosine values of the two angles b and pi / 4 - b, and the results with the sine and cosine values taking negative signs. Similarly, sin(a) can also be expressed in this way. Therefore, we can convert the calculation of the sine and cosine values of angles in the range of 0 - 2*pi into only calculating the results in the range of 0 - pi / 4. At the same time, only the cosine and sine tables in the range of 0 - pi / 4 need to be stored, and then the sine and cosine results corresponding to b and pi / 4 - b can be obtained by taking numbers in the forward and reverse orders, and further the results of sin(delta) and cos(delta) can be obtained.

[0022] Based on the above splitting process, this solution can calculate the initial phase and frequency offset compensation value of the signal through the signal sampling rate and the initial phase parameter of the frequency offset. Then, by performing phase accumulation calculation on the initial phase and the frequency offset compensation value, the phase accumulation value can be obtained. Each time an accumulation is performed, a phase accumulation value is output. By inputting the phase accumulation value into a preset look-up table, waveform data can be obtained, and then the output waveform can be obtained. By performing complex multiplication calculation on the output waveform and the input data, the frequency offset compensation output data can be obtained; this solution can map the angle range of 0 - 2*pi to 0 - pi* / 4 by looking up the table through the phase accumulation value, and does not require an increase in the amount of calculation when using the trigonometric function transformation formula. Therefore, this solution only needs to store a preset look-up table with 1 / 8 of the original size, greatly simplifies the storage resources required by the look-up table method, has lower power consumption, and can achieve higher frequency offset compensation accuracy.

[0023] Furthermore, the calculation of the initial phase and the frequency offset compensation value of the signal through the signal sampling rate and the initial phase parameter of the frequency offset specifically includes:

[0024] Judging whether to use the initial phase parameter of the frequency offset for calculation by pre-inputting the FreshFlag parameter;

[0025] If the judgment is no, the calculation is terminated;

[0026] If the judgment is yes, calculate the 32-bit unsigned number initial phase and the normalized 32-bit unsigned number frequency offset compensation value from the initial phase parameter of the frequency offset. The normalization method is: frequency offset compensation value (f0_delta = round(f0 / fs * 2^32)).

[0027] The pre-input FreshFlag parameter refers to a judgment parameter given by the software based on whether the frequency offset compensation value currently input is consistent with the frequency offset compensation value input last time. When the frequency offset compensation value currently input is consistent with the frequency offset compensation value input last time, FreshFlag = 0, indicating that the frequency offset compensation value has not changed, and the previous initial phase and frequency offset compensation values ​​can continue to be used for calculation; when the frequency offset compensation value currently input is inconsistent with the frequency offset compensation value input last time, FreshFlag = 1, indicating that the frequency offset compensation value has changed, and new initial phase and frequency offset compensation values ​​need to be used for calculation.

[0028] Further, the performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain the phase accumulation value specifically includes:

[0029] Determining whether to refresh the initial phase and the frequency offset compensation value by pre-inputting a FreshFlag parameter;

[0030] If the judgment is no, the initial phase and the frequency offset compensation value are not refreshed, and the phase accumulation calculation is continued according to the historical initial phase and the frequency offset compensation value, and each time the accumulation is performed, a phase accumulation value is output;

[0031] If the judgment is yes, a phase accumulation calculation is performed according to the updated initial phase and the updated frequency offset compensation value, and a phase accumulation value is output each time the accumulation is performed.

[0032] Furthermore, after obtaining the waveform data according to the phase accumulation value and the preset lookup table and before obtaining the output waveform according to the waveform data, the method further includes:

[0033] An initial waveform is obtained according to the waveform data.

[0034] Further, the step of obtaining an output waveform according to the waveform data specifically includes:

[0035] The initial waveform is calibrated to obtain the accurate output waveform.

[0036] In addition, the present invention also provides a frequency offset compensation system, comprising:

[0037] Registers are used to configure signal sampling rate and frequency deviation initial phase parameters;

[0038] An initial phase frequency deviation calculator, connected to the register, for receiving the signal sampling rate and the initial frequency deviation parameter input by the register, and calculating the signal sampling rate and the initial frequency deviation parameter to obtain the initial phase and frequency deviation compensation value of the signal;

[0039] a phase accumulator connected to the initial phase frequency offset calculator, configured to receive the initial phase and the frequency offset compensation value input by the initial phase frequency offset calculator, and perform phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value;

[0040] A lookup table and waveform generator, connected to the phase accumulator, for receiving the phase accumulation value input by the phase accumulator, obtaining waveform data according to the phase accumulation value and a preset lookup table, and then obtaining an output waveform according to the waveform data;

[0041] The frequency deviation calibrator is used to perform complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency deviation compensated output data.

[0042] This scheme calculates the signal sampling rate and the initial phase parameters of the frequency deviation through an initial phase frequency deviation calculator, and can obtain the initial phase and frequency deviation compensation values ​​of the signal, and then performs phase accumulation calculation on the initial phase and frequency deviation compensation values ​​through a phase accumulator to obtain a phase accumulation value, and outputs a phase accumulation value each time it is accumulated, and inputs the phase accumulation value into a preset lookup table through a lookup table and a waveform generator to obtain waveform data, and then obtains an output waveform, and performs complex multiplication calculation on the output waveform and the input data through a frequency deviation calibrator to obtain frequency deviation compensated output data; this scheme performs a lookup table through the phase accumulation value, and can map the angle range of 0-2*pi to 0-pi* / 4, and does not need to increase the amount of calculation when using the trigonometric function transformation formula. Therefore, this scheme only needs to store a preset lookup table of 1 / 8 of the original size, which greatly simplifies the storage resources required for the lookup table method, has lower power consumption, and can achieve higher frequency deviation compensation accuracy.

[0043] Further, the initial phase frequency deviation calculator determines whether to use the frequency deviation initial phase parameter for calculation by pre-inputting the FreshFlag parameter;

[0044] If the judgment is no, the calculation is terminated;

[0045] If the judgment is yes, the frequency offset initial phase parameter is calculated to obtain a 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency offset compensation value.

[0046] Furthermore, the phase accumulator determines whether to refresh the initial phase and the frequency offset compensation value by pre-inputting a FreshFlag parameter;

[0047] If the judgment is no, the initial phase and the frequency offset compensation value are not refreshed, and the phase accumulation calculation is continued according to the historical initial phase and the frequency offset compensation value, and each time the accumulation is performed, a phase accumulation value is output;

[0048] If the judgment is yes, a phase accumulation calculation is performed according to the updated initial phase and the updated frequency offset compensation value, and a phase accumulation value is output each time the accumulation is performed.

[0049] Furthermore, the table lookup and waveform generator obtains an initial waveform according to the waveform data.

[0050] Furthermore, it also includes: a Taylor operator, which is connected between the lookup table and waveform generator and the frequency deviation calibrator, and is used to calibrate the initial waveform to obtain the accurate output waveform.

[0051] According to a frequency offset compensation method and system provided by the present invention, the scheme can calculate the initial phase and frequency offset compensation value of the signal through the signal sampling rate and the initial phase parameter of the frequency offset, and then perform phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain the phase accumulation value. Each time the accumulation is performed, a phase accumulation value is output, and waveform data can be obtained by inputting the phase accumulation value into a preset lookup table, and then the output waveform is obtained. The output waveform is complex multiplied with the input data to obtain the frequency offset compensation output data; the scheme performs a lookup table through the phase accumulation value, and can map the angle range of 0-2*pi to 0-pi* / 4, and does not need to increase the amount of calculation when using the trigonometric function transformation formula. Therefore, the scheme only needs to store a preset lookup table of 1 / 8 of the original size, which greatly simplifies the storage resources required for the lookup table method, has lower power consumption, and can achieve higher frequency offset compensation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The preferred implementation scheme will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of the present solution.

[0053] Figure 1 It is a schematic diagram of the overall process of an embodiment of the present invention;

[0054] Figure 2 is a structural block diagram of a table lookup and waveform generator according to an embodiment of the present invention;

[0055] Figure 3 1 is a block diagram of a Taylor operator according to an embodiment of the present invention;

[0056] Figure 4 Schematic diagram of the system structure of an embodiment of the present invention.

[0057] Numbers in the figure: 1-register 1; 2-initial phase frequency deviation calculator; 3-phase accumulator; 4-lookup table and waveform generator; 5-frequency deviation calibrator; 6-Taylor operator. DETAILED DESCRIPTION

[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

[0059] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

[0060] Example 1

[0061] One embodiment of the present invention, as Figure 1 As shown, the present invention provides a frequency offset compensation method, comprising the steps of:

[0062] S1. Obtain signal sampling rate and frequency deviation initial phase parameters.

[0063] When performing frequency offset compensation, if the signal sampling rate is f s , the frequency deviation to be compensated is f0, the received signal is X(K)(k=0,1...n), and the signal after frequency deviation compensation is y(k)(x,y are complex numbers), then y(k)=x(k)*(cos(f0 / fs*2*pi*(k-1))+1i*sin(f0 / fs*2*pi*(k-1))), where k=1,2,3…n; equivalently, it can be regarded as: y(k)=x(k)*(cos(delta)+1i*sin(delta)), where k=1,…n, delta is between 0-2*pi. The table lookup method in the prior art is to obtain the frequency deviation compensation result by looking up the cos, sin table in the range of 0-2*pi, but this method needs to store a large table and occupies more resources.

[0064] This solution splits the above process into two processes, splitting delta into: delta=delta1+delta2.

[0065] According to Taylor's formula, for any function f(x) that is differentiable at x0, and the closer x is to x0, the higher the calculation accuracy, it can be expressed as:

[0066] cos(x)=cos(x0)-sin(x0)(x-x0)-cos(x0)(x-x0) 2 / 2;

[0067] sin(x) = sin(x0) + cos(x0)(x - x0) - sin(x0)(x - x0) 2 / 2;

[0068] For delta in the above example:

[0069] cos(delta) = cos(delta1) - sin(delta1)(delta2) - cos(delta1)(delta2) 2 / 2;

[0070] sin(delta) = sin(delta1) + cos(delta1)(delta2) - sin(delta1)(delta2) 2 / 2;

[0071] Where, for any angle a, 0 ≤ a < 2 * pi, it can be written as a = b + m * pi / 4, where 0 ≤ b < pi / 4 and m is a number between 0 and 7. Then cos(a) = cos(b + m * pi / 4); for m = 0, cos(a) = cos(b); for m = 1, cos(a) = sin(pi / 4 - b); and so on. By calculation, cos(a) can always be expressed as the sine and cosine values of the two angles b and pi / 4 - b, and the results with the opposite signs of their sine and cosine values. Similarly, sin(a) can also be expressed in this way. Therefore, we can convert the calculation of the sine and cosine values of angles in the range of 0 - 2 * pi into only calculating the results in the range of 0 - pi / 4. At the same time, only the cosine and sine tables in the range of 0 - pi / 4 need to be stored, and then the sine and cosine results corresponding to b and pi / 4 - b can be obtained by taking numbers in the forward and reverse orders, and further the results of sin(delta) and cos(delta) can be obtained.

[0072] S2. Calculate the initial phase and frequency offset compensation value of the signal based on the signal sampling rate and the initial phase parameter of the frequency offset.

[0073] Preferably, calculating the initial phase and frequency offset compensation value of the signal based on the signal sampling rate and the initial phase parameter of the frequency offset specifically includes:

[0074] Judge whether to calculate using the initial phase parameter of the frequency offset by pre - inputting the FreshFlag parameter; if the judgment is no, terminate the calculation; if the judgment is yes, calculate the initial phase of the 32 - bit unsigned number and the normalized 32 - bit unsigned number frequency offset compensation value based on the initial phase parameter of the frequency offset. The normalization method is: frequency offset compensation value (f0_delta = round(f0 / fs * 2^32)).

[0075] The pre-input FreshFlag parameter refers to a judgment parameter given by the software based on whether the frequency offset compensation value currently input is consistent with the frequency offset compensation value input last time. When the frequency offset compensation value currently input is consistent with the frequency offset compensation value input last time, FreshFlag = 0, indicating that the frequency offset compensation value has not changed, and the previous initial phase and frequency offset compensation values ​​can continue to be used for calculation; when the frequency offset compensation value currently input is inconsistent with the frequency offset compensation value input last time, FreshFlag = 1, indicating that the frequency offset compensation value has changed, and new initial phase and frequency offset compensation values ​​need to be used for calculation.

[0076] S3. Perform phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value, which is recorded as delta.

[0077] Preferably, performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain the phase accumulation value specifically includes:

[0078] Whether to refresh the initial phase and frequency offset compensation values ​​is determined by pre-inputting the FreshFlag parameter; if the judgment is no, the initial phase and frequency offset compensation values ​​are not refreshed, and the phase accumulation calculation is continued according to the historical initial phase and frequency offset compensation values, and a phase accumulation value is output each time the accumulation is performed; if the judgment is yes, the phase accumulation calculation is performed according to the updated initial phase and the updated frequency offset compensation value, and a phase accumulation value is output each time the accumulation is performed.

[0079] S4. Obtain waveform data according to the phase accumulation value and a preset lookup table.

[0080] Specifically, Figure 2 As shown, in this embodiment, a table lookup and a waveform generator are used to look up a table, and the phase accumulation value is input into the table lookup and the waveform generator. If delta is greater than 2^32-1, then delta=delta-2^32; take Findex=(the 30th-32th bit of delta); take delta_n=(the 1st-29th bit of delta), if Findex is an odd number, refresh delta_n=2^29-1-delta_n; take index1=the 25th-29th bit of delta_n, and take index2=the 17th-24th bit of delta_n; use index1 to input the preset table lookup for table lookup, and the waveform data x can be obtained.

[0081] S5. Obtain an output waveform according to the waveform data.

[0082] S6. Perform complex multiplication calculation on the input data and output waveform of the signal to obtain frequency offset compensation output data.

[0083] Based on the above splitting process, this scheme can calculate the initial phase and frequency offset compensation value of the signal through the signal sampling rate and the initial phase parameter of the frequency offset, and then perform phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain the phase accumulation value. Each time the accumulation is performed, a phase accumulation value is output. By inputting the phase accumulation value into a preset lookup table, waveform data can be obtained, and then the output waveform can be obtained. The output waveform is complex multiplied with the input data to obtain the frequency offset compensation output data. This scheme uses the phase accumulation value to perform a table lookup, and can map the angle range of 0-2*pi to 0-pi* / 4, and does not require an increase in the amount of calculation when using the trigonometric function transformation formula. Therefore, this scheme only needs to store a preset lookup table of 1 / 8 of the original size, which greatly simplifies the storage resources required for the table lookup method, has lower power consumption, and can achieve higher frequency offset compensation accuracy.

[0084] Example 2

[0085] An embodiment of the present invention, based on embodiment 1, after obtaining waveform data according to the phase accumulation value and a preset lookup table and before obtaining the output waveform according to the waveform data, further includes: obtaining an initial waveform according to the waveform data.

[0086] Preferably, S5, obtaining an output waveform according to the waveform data, specifically includes: calibrating the initial waveform to obtain an accurate output waveform.

[0087] Specifically, Figure 3 As shown, the waveform data x, index2 and Findex are input into the Taylor operator. The Taylor operator:

[0088] z = index2*const;

[0089] x1_re=real(x)-imag(x)*z-real(x)*z^2 / 2;

[0090] x1_im=imag(x)+real(x)*z-imag(x)*z^2 / 2;

[0091] Afterwards, the waveform data x can be updated, x=x1_re+1i*x1_im; finally, according to Findex and the calibrated waveform data x, an accurate output waveform can be obtained.

[0092] Example 3

[0093] An embodiment of the present invention. Figure 4 As shown, the present invention also provides a frequency offset compensation system, including a register 1, an initial phase frequency offset calculator 2, a phase accumulator 3, a lookup table and waveform generator 4, a frequency offset calibrator 5 and a Taylor operator 6.

[0094] Register 1 is used to configure the signal sampling rate and frequency deviation initial phase parameters.

[0095] When performing frequency offset compensation, if the signal sampling rate is f s , the frequency deviation to be compensated is f0, the received signal is X(K)(k=0,1...n), and the signal after frequency deviation compensation is y(k)(x,y are complex numbers), then y(k)=x(k)*(cos(f0 / fs*2*pi*(k-1))+1i*sin(f0 / fs*2*pi*(k-1))), where k=1,2,3…n; equivalently, it can be regarded as: y(k)=x(k)*(cos(delta)+1i*sin(delta)), where k=1,…n, delta is between 0-2*pi. The table lookup method in the prior art is to obtain the frequency deviation compensation result by looking up the cos, sin table in the range of 0-2*pi, but this method needs to store a large table and occupies more resources.

[0096] This solution splits the above process into two processes, splitting delta into: delta=delta1+delta2.

[0097] According to Taylor's formula, for any function f(x) that is differentiable at x0, and the closer x is to x0, the higher the calculation accuracy, it can be expressed as:

[0098] cos(x)=cos(x0)-sin(x0)(x-x0)-cos(x0)(x-x0) 2 / 2;

[0099] sin(x)=sin(x0)+cos(x0)(x-x0)-sin(x0)(x-x0) 2 / 2;

[0100] For delta in the above example:

[0101] cos(delta)=cos(delta1)-sin(delta1)(delta2)-cos(delta1)(delta2) 2 / 2;

[0102] sin(delta)=sin(delta1)+cos(delta1)(delta2)-sin(delta1)(delta2) 2 / 2;

[0103] Among them, for any angle a, where 0 ≤ a < 2*pi, it can be written as a = b + m*pi / 4, where 0 ≤ b < pi / 4 and m is a number between 0 and 7. Then cos(a) = cos(b + m*pi / 4); for m = 0, cos(a) = cos(b); for m = 1, cos(a) = sin(pi / 4 - b); and so on. By calculation, cos(a) can always be expressed as the sine and cosine values of the two angles b and pi / 4 - b, and the results with the negative signs of their sine and cosine values. Similarly, sin(a) can also be expressed in this way. Therefore, we can convert the calculation of the sine and cosine values of angles in the range of 0 - 2*pi into only calculating the results in the range of 0 - pi / 4. At the same time, we only need to store the cosine and sine tables in the range of 0 - pi / 4, and then obtain the sine and cosine results corresponding to b and pi / 4 - b by taking numbers in positive and reverse orders, and further obtain the results of sin(delta) and cos(delta).

[0104] The initial phase and frequency offset calculator 2 is connected to the register 1, and is used to receive the signal sampling rate and the initial phase parameter of the frequency offset input by the register 1, and calculate the initial phase and the frequency offset compensation value of the signal.

[0105] Preferably, the initial phase and frequency offset calculator 2 judges whether to calculate using the initial phase parameter of the frequency offset through the pre-input FreshFlag parameter; if the judgment is no, the calculation is terminated; if the judgment is yes, the initial phase parameter of the frequency offset is calculated to obtain a 32-bit unsigned number initial phase and a normalized 32-bit unsigned number frequency offset compensation value. The normalization method is: frequency offset compensation value (f0_delta = round(f0 / fs * 2^32)).

[0106] The pre-input FreshFlag parameter refers to a judgment parameter given by the software according to whether the frequency offset compensation value input this time is the same as the frequency offset compensation value input last time. When the frequency offset compensation value input this time is the same as the frequency offset compensation value input last time, FreshFlag = 0, indicating that the frequency offset compensation value has not changed, and the previous initial phase and frequency offset compensation value can continue to be used for calculation; when the frequency offset compensation value input this time is different from the frequency offset compensation value input last time, FreshFlag = 1, indicating that the frequency offset compensation value has changed, and new initial phase and frequency offset compensation values need to be used for calculation.

[0107] The phase accumulator 3 is connected to the initial phase and frequency offset calculator 2, and is used to receive the initial phase and the frequency offset compensation value input by the initial phase and frequency offset calculator 2, and perform phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain a phase accumulation value, denoted as delta.

[0108] Preferably, the phase accumulator 3 determines whether to refresh the initial phase and frequency offset compensation value by pre-inputting the FreshFlag parameter; if the judgment is no, the initial phase and frequency offset compensation value are not refreshed, and the phase accumulation calculation is continued according to the historical initial phase and frequency offset compensation value, and each accumulation is outputted a phase accumulation value; if the judgment is yes, the phase accumulation calculation is performed according to the updated initial phase and the updated frequency offset compensation value, and each accumulation is outputted a phase accumulation value.

[0109] The lookup table and waveform generator 4 is connected to the phase accumulator 3, and is used to receive the phase accumulation value input by the phase accumulator, obtain waveform data according to the phase accumulation value and a preset lookup table, and then obtain an output waveform according to the waveform data.

[0110] Specifically, Figure 2 As shown, the phase accumulation value is input into the lookup table and waveform generator. If delta is greater than 2^32-1, then delta=delta-2^32; take the index Findex=(30-32 bits of delta); take delta_n=(1-29 bits of delta), if Findex is an odd number, refresh delta_n=2^29-1-delta_n; take index1=25-29 bits of delta_n, take index2=17-24 bits of delta_n; use index1 to input the preset lookup table for lookup, and the waveform data x can be obtained.

[0111] Preferably, the table lookup and waveform generator 4 obtains the initial waveform according to the waveform data.

[0112] The Taylor operator 6 is connected between the table lookup and waveform generator 4 and the frequency deviation calibrator 5, and is used to calibrate the initial waveform to obtain an accurate output waveform.

[0113] Specifically, Figure 3 As shown, the waveform data x, index2 and Findex are input into the Taylor operator. The Taylor operator:

[0114] z = index2*const;

[0115] x1_re=real(x)-imag(x)*z-real(x)*z^2 / 2;

[0116] x1_im=imag(x)+real(x)*z-imag(x)*z^2 / 2;

[0117] Afterwards, the waveform data x can be updated, x=x1_re+1i*x1_im; finally, according to Findex and the calibrated waveform data x, an accurate output waveform can be obtained.

[0118] The frequency offset calibrator 5 is used to perform complex multiplication calculation on the input data and output waveform of the signal to obtain frequency offset compensated output data.

[0119] This scheme calculates the signal sampling rate and the initial phase parameters of the frequency deviation through the initial phase frequency deviation calculator 2, and can obtain the initial phase and frequency deviation compensation value of the signal, and then performs phase accumulation calculation on the initial phase and frequency deviation compensation value through the phase accumulator 3 to obtain the phase accumulation value, and outputs a phase accumulation value each time it is accumulated. The phase accumulation value is input into a preset lookup table through the lookup table and waveform generator 4 to obtain waveform data, and then the output waveform is obtained. The output waveform and the input data are complex multiplied by the frequency deviation calibrator 5 to obtain the frequency deviation compensation output data; this scheme performs a lookup table through the phase accumulation value, and can map the angle range of 0-2*pi to 0-pi* / 4, and does not need to increase the amount of calculation when using the trigonometric function transformation formula. Therefore, this scheme only needs to store a preset lookup table of 1 / 8 of the original size, which greatly simplifies the storage resources required for the lookup table method, has lower power consumption, and can achieve higher frequency deviation compensation accuracy.

[0120] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.

Claims

1. A frequency offset compensation method, It is characterized in that Includes steps: Obtain signal sampling rate and frequency deviation initial phase parameters; The signal sampling rate and the frequency deviation initial phase parameter are calculated to obtain the initial phase and frequency deviation compensation value of the signal; specifically comprising: judging whether to use the frequency deviation initial phase parameter for calculation by pre-inputting a refresh flag FreshFlag parameter; if the judgment is no, terminating the calculation; if the judgment is yes, calculating the frequency deviation initial phase parameter to obtain a 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency deviation compensation value; Performing phase accumulation calculation on the initial phase and the frequency offset compensation value to obtain the phase accumulation value, specifically comprising: judging whether to refresh the initial phase and the frequency offset compensation value through the pre-input refresh flag FreshFlag parameter; if the judgment is no, then the initial phase and the frequency offset compensation value are not refreshed, and the phase accumulation calculation is continued according to the historical initial phase and the frequency offset compensation value, and each time the accumulation is performed, a phase accumulation value is output; if the judgment is yes, then the phase accumulation calculation is performed according to the updated initial phase and the updated frequency offset compensation value, and each time the accumulation is performed, a phase accumulation value is output; if the frequency offset compensation value currently input is consistent with the frequency offset compensation value input last time, the pre-input refresh flag FreshFlag value is 0, indicating that the frequency offset compensation value has not changed, and the previous initial phase and frequency offset compensation value can continue to be used for calculation; if the frequency offset compensation value currently input is inconsistent with the frequency offset compensation value input last time, then the refresh flag FreshFlag value is 1, indicating that the frequency offset compensation value has changed and needs to be calculated with a new initial phase and frequency offset compensation value; Obtaining waveform data according to the phase accumulation value and a preset lookup table; Obtaining an output waveform according to the waveform data; Complex multiplication is performed on the input data of the signal and the output waveform to obtain frequency offset compensated output data.

2. A frequency offset compensation method according to claim 1, It is characterized in that After obtaining the waveform data according to the phase accumulation value and the preset lookup table, and before obtaining the output waveform according to the waveform data, the method further includes: An initial waveform is obtained according to the waveform data.

3. A frequency offset compensation method according to claim 2, It is characterized in that The step of obtaining an output waveform according to the waveform data specifically includes: The initial waveform is calibrated to obtain the accurate output waveform.

4. A frequency deviation compensation system, It is characterized in that include: Registers are used to configure the signal sampling rate and frequency deviation initial phase parameters; An initial phase frequency deviation calculator, connected to the register, for receiving the signal sampling rate and the frequency deviation initial phase parameter input by the register, and calculating the signal sampling rate and the frequency deviation initial phase parameter to obtain the signal initial phase and frequency deviation compensation value, wherein the initial phase frequency deviation calculator determines whether to use the frequency deviation initial phase parameter for calculation by pre-inputting a refresh flag FreshFlag parameter; if the judgment is no, the calculation is terminated; if the judgment is yes, the frequency deviation initial phase parameter is calculated to obtain a 32-bit unsigned initial phase and a normalized 32-bit unsigned frequency deviation compensation value; A phase accumulator is connected to the initial phase frequency deviation calculator, and is used to receive the initial phase and the frequency deviation compensation value input by the initial phase frequency deviation calculator, and perform phase accumulation calculation on the initial phase and the frequency deviation compensation value to obtain a phase accumulation value; the phase accumulator determines whether to refresh the initial phase and the frequency deviation compensation value by pre-inputting a refresh flag FreshFlag parameter; if the judgment is no, the initial phase and the frequency deviation compensation value are not refreshed, and the phase accumulation calculation is continued according to the historical initial phase and the frequency deviation compensation value, and each time the accumulation is performed, a phase accumulation value is output; If the judgment is yes, then perform phase accumulation calculation according to the updated initial phase and the updated frequency offset compensation value, and output a phase accumulation value each time the accumulation is performed; if the frequency offset compensation value currently input is consistent with the frequency offset compensation value input last time, the pre-input refresh flag FreshFlag value is 0, indicating that the frequency offset compensation value has not changed, and the previous initial phase and frequency offset compensation value can continue to be used for calculation; if the frequency offset compensation value currently input is inconsistent with the frequency offset compensation value input last time, the refresh flag FreshFlag value is 1, indicating that the frequency offset compensation value has changed and needs to be calculated with a new initial phase and frequency offset compensation value; A lookup table and waveform generator, connected to the phase accumulator, for receiving the phase accumulation value input by the phase accumulator, obtaining waveform data according to the phase accumulation value and a preset lookup table, and then obtaining an output waveform according to the waveform data; The frequency deviation calibrator is used to perform complex multiplication calculation on the input data of the signal and the output waveform to obtain frequency deviation compensated output data.

5. A frequency offset compensation system according to claim 4, Features: The table lookup and waveform generator obtains an initial waveform according to the waveform data.

6. A frequency offset compensation system according to claim 5, It is characterized in that Also includes: A Taylor operator is connected between the table lookup and waveform generator and the frequency deviation calibrator, and is used to calibrate the initial waveform to obtain the accurate output waveform.

Citation Information

Cited By

  • Frequency offset residual error and phase noise joint compensation method for lightning stroke scene

    CN121690400A