A time-frequency joint calibration method and terminal device based on carrier frequency offset
By calculating and storing the carrier frequency offset as the crystal oscillator frequency offset in the industrial wireless communication system for time synchronization calibration and uplink transmission frequency pre-compensation, the system control overhead and delay caused by crystal oscillator frequency deviation are solved, and the transmission accuracy and signal orthogonality are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-22
- Publication Date
- 2026-04-03
Smart Images

Figure CN121568205B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial wireless communication technology, and in particular to a time-frequency joint calibration method and terminal device based on carrier frequency offset. Background Technology
[0002] In multi-user uplink orthogonal frequency division multiple access transmission scenarios in industrial wireless communication systems, terminal devices may experience carrier frequency offsets due to hardware differences or environmental factors, resulting in impaired orthogonality of uplink signal subcarriers and the introduction of interference. The time-frequency joint calibration method based on carrier frequency offset jointly compensates for the frequency deviation of terminal devices by jointly adjusting time synchronization parameters and frequency correction parameters, thereby restoring subcarrier orthogonality and improving uplink transmission reliability.
[0003] Existing industrial wireless communication technologies suffer from the following technical pain points: terminal devices and access point devices each use independent crystal oscillators as frequency reference sources. Factors such as crystal oscillator manufacturing errors, temperature variations, and aging cause inherent deviations in crystal oscillator frequencies, leading to carrier frequency offsets and time synchronization errors accumulating over time. In multi-user uplink orthogonal frequency division multiple access (OFDM) transmission scenarios in industrial wireless communication systems, such as when multiple sensor terminals need to send data streams to the access point device simultaneously, crystal oscillator frequency deviations can cause uplink signal carrier frequencies to become misaligned and timestamp growth rates to be inconsistent, disrupting the orthogonality of multi-user transmissions and causing signal interference and data loss. To maintain synchronization accuracy, existing technologies have to frequently rely on dedicated trigger frames for interaction, increasing system control overhead, communication latency, and power consumption. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a time-frequency joint calibration method and terminal device based on carrier frequency offset. This solves the technical problem that the carrier frequency offset and time synchronization error accumulate over time due to the crystal oscillator frequency deviation between the terminal device and the access point device, which requires frequent reliance on dedicated trigger frames for synchronization interaction, increasing system control overhead, communication delay, and power consumption.
[0005] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:
[0006] In a first aspect, the present invention provides a time-frequency joint calibration method based on carrier frequency offset, comprising:
[0007] Step 1: The terminal device receives the downlink radio frame sent by the access point device;
[0008] Step 2: Obtain the carrier frequency offset between the access point device and the terminal device using the known reference signal in the downlink radio frame;
[0009] Step 3: Convert the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation between the crystal frequencies of the two crystal oscillators;
[0010] Step 4: Store the crystal oscillator frequency offset into the received frame parameter vector of the terminal device;
[0011] Step 5: When time synchronization calibration or uplink transmission is required, read the crystal oscillator frequency offset from the received frame parameter vector.
[0012] Step 6: If time synchronization calibration is performed, adjust the growth rate of the local timestamp on the terminal device according to the read crystal oscillator frequency offset.
[0013] Step 7: If uplink transmission is performed, frequency pre-compensation is performed on the uplink transmission signal based on the read crystal oscillator frequency offset.
[0014] Furthermore, in the time-frequency joint calibration method based on carrier frequency offset of the present invention, step 2 obtains the carrier frequency offset between the access point device and the terminal device using the known reference signal in the downlink radio frame:
[0015] Based on the received downlink radio frames, locate the starting position of the long training field in the preamble;
[0016] Starting from the beginning of the long training field, extract the time-domain sampling sequences of the first orthogonal frequency division multiplexing symbol and the second orthogonal frequency division multiplexing symbol;
[0017] The sampling sequences of the first orthogonal frequency division multiplexing symbol and the sampling sequences of the second orthogonal frequency division multiplexing symbol are subjected to pointwise conjugate multiplication to obtain the instantaneous phase difference sequence.
[0018] The instantaneous phase difference sequence is averaged using a sliding window method.
[0019] Calculate the phase angle corresponding to the averaged instantaneous phase difference sequence;
[0020] Substituting the phase angle, the time interval between the first and second orthogonal frequency division multiplexing symbols, and the system sampling frequency into the frequency offset calculation formula, the carrier frequency offset value is obtained.
[0021] Furthermore, in the time-frequency joint calibration method based on carrier frequency offset of the present invention, step 3 converts the carrier frequency offset into a crystal oscillator frequency offset amount characterizing the relative deviation of the crystal oscillator frequencies of both parties, including:
[0022] Obtain the radio frequency carrier center frequency from the configuration parameters stored in the terminal device;
[0023] Divide the carrier frequency offset value obtained in step 2 by the radio frequency carrier center frequency to obtain the normalized frequency deviation coefficient.
[0024] Multiply the normalized frequency deviation coefficient by 10^6 to obtain the crystal oscillator frequency offset in parts per million.
[0025] Add a timestamp and frame sequence number to the crystal oscillator frequency offset;
[0026] The crystal frequency offset of the attached timestamp and frame sequence number is formatted into a structured data record;
[0027] Structured data records are written into the received frame parameter vector.
[0028] Furthermore, in the time-frequency joint calibration method based on carrier frequency offset of the present invention, if time synchronization calibration is performed in step 6, the growth rate of the local timestamp of the terminal device is adjusted according to the read crystal oscillator frequency offset, including:
[0029] Read the system reference clock frequency;
[0030] Calculate the frequency compensation factor based on the crystal oscillator frequency offset;
[0031] Multiply the frequency compensation scaling factor by 2^32 to obtain the theoretical cumulative value;
[0032] The theoretical accumulated value is rounded to generate the actual accumulated step value in 32-bit fixed-point format.
[0033] Set the initial value of the accumulator to 2^31;
[0034] In each local clock cycle, the actual accumulated step value is added to the accumulator;
[0035] Monitor the accumulator for value overflow;
[0036] When a numerical overflow occurs, the timestamp counter increments by one unit.
[0037] The actual cumulative step value is dynamically adjusted based on the growth data of the timestamp counter.
[0038] Furthermore, in the time-frequency joint calibration method based on carrier frequency offset of the present invention, if uplink transmission is performed in step 7, frequency pre-compensation is performed on the uplink transmission signal according to the read crystal oscillator frequency offset, including:
[0039] Analyze the uplink transmission scheduling information to determine the uplink carrier frequency and signal bandwidth;
[0040] Calculate the phase compensation amount corresponding to the carrier frequency based on the crystal oscillator frequency offset;
[0041] Convert the phase compensation amount into a 26-bit precision digital phase parameter;
[0042] Based on the crystal oscillator frequency offset, calculate the sampling clock frequency compensation coefficient and generate 32-bit sampling rate adjustment parameters;
[0043] Write the digital phase parameters and sampling rate adjustment parameters into the physical layer's configuration register;
[0044] During baseband signal modulation, the signal is phase-rotated according to digital phase parameters;
[0045] During the digital-to-analog conversion process, parameters are adjusted according to the sampling rate to resample the signal.
[0046] Furthermore, the time-frequency joint calibration method based on carrier frequency offset of the present invention further includes:
[0047] For the frequency offset record in the received frame parameter vector, calculate the signal quality evaluation value based on the reference signal quality of the downlink radio frame that generated the frequency offset record;
[0048] When reading the crystal oscillator frequency offset from the received frame parameter vector, the frequency offset record with the highest signal quality evaluation value is selected for reading.
[0049] Furthermore, in step 6 of the time-frequency joint calibration method based on carrier frequency offset of the present invention, the following is also included:
[0050] It provides a first calibration mode and a second calibration mode. The cumulative step value update cycle of the first calibration mode is shorter than that of the second calibration mode.
[0051] In the first calibration mode, the actual accumulated step value is updated in the first cycle;
[0052] In the second calibration mode, the actual accumulated step value is updated in a second cycle, which is longer than the first cycle;
[0053] When it is necessary to switch between the first calibration mode and the second calibration mode, the cumulative step value update of the new mode will begin after the current cycle's cumulative step value update is completed.
[0054] Select either the first calibration mode or the second calibration mode based on the power status or processing load of the terminal device.
[0055] Furthermore, the time-frequency joint calibration method based on carrier frequency offset of the present invention further includes:
[0056] Set the priority of the time synchronization calibration task and the uplink transmit frequency pre-compensation task;
[0057] When the time synchronization calibration task and the uplink transmit frequency pre-compensation task need to be executed simultaneously, the task with higher priority shall be executed first.
[0058] Assign a first performance evaluation parameter to the time synchronization calibration task, and assign a second performance evaluation parameter to the uplink transmit frequency pre-compensation task.
[0059] The processor resource allocation is adjusted based on the values of the first and second performance evaluation parameters.
[0060] Secondly, the present invention provides a time-frequency joint calibration terminal device based on carrier frequency offset, applied to the aforementioned time-frequency joint calibration method based on carrier frequency offset, comprising:
[0061] The receiving unit is used to receive downlink radio frames sent by the access point device;
[0062] The processing unit is used to obtain the carrier frequency offset between the access point device and the terminal device through the known reference signal in the downlink radio frame, and convert the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation of the crystal oscillator frequencies of the two parties.
[0063] A storage unit is used to store the crystal oscillator frequency offset into the received frame parameter vector;
[0064] The read unit is used to read the crystal oscillator frequency offset from the received frame parameter vector when time synchronization calibration or uplink transmission is required.
[0065] The time calibration unit is used to adjust the growth rate of the local timestamp of the terminal device according to the read crystal oscillator frequency offset when performing time synchronization calibration;
[0066] The frequency compensation unit is used to perform frequency pre-compensation on the uplink transmission signal based on the read crystal oscillator frequency offset during uplink transmission.
[0067] The beneficial effects of this invention are:
[0068] This invention obtains the carrier frequency offset by receiving a known reference signal from the downlink radio frame sent by the access point device through the terminal device, and converts the carrier frequency offset into a crystal frequency offset representing the relative deviation of the crystal oscillator frequencies of both parties, storing it in the received frame parameter vector. When time synchronization calibration or uplink transmission is required, the crystal frequency offset is read from the storage area. Time synchronization calibration adjusts the growth rate of the local timestamp of the terminal device according to the crystal frequency offset to compensate for the crystal frequency deviation. Uplink transmission performs frequency pre-compensation on the uplink transmission signal according to the crystal frequency offset to align the carrier frequency. This effectively reduces the number of interactions of dedicated trigger frames, reduces system control overhead and communication latency, and improves the time synchronization accuracy and signal orthogonality in multi-user uplink orthogonal frequency division multiple access transmission. Attached Figure Description
[0069] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on the drawings without creative effort.
[0070] Figure 1 This is a flowchart illustrating the time-frequency joint calibration method based on carrier frequency offset of the present invention. Detailed Implementation
[0071] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. The technical solutions provided by various embodiments of this invention will be described in detail below with reference to the accompanying drawings.
[0072] To better understand the purpose of this invention, the invention will now be described in further detail.
[0073] Firstly, please refer to Figure 1 The present invention provides a time-frequency joint calibration method based on carrier frequency offset, comprising:
[0074] Step 1: The terminal device receives the downlink radio frame sent by the access point device;
[0075] Step 2: Obtain the carrier frequency offset between the access point device and the terminal device using the known reference signal in the downlink radio frame;
[0076] Step 3: Convert the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation between the crystal frequencies of the two crystal oscillators;
[0077] Step 4: Store the crystal oscillator frequency offset into the received frame parameter vector of the terminal device;
[0078] Step 5: When time synchronization calibration or uplink transmission is required, read the crystal oscillator frequency offset from the received frame parameter vector.
[0079] Step 6: If time synchronization calibration is performed, adjust the growth rate of the local timestamp on the terminal device according to the read crystal oscillator frequency offset.
[0080] Step 7: If uplink transmission is performed, frequency pre-compensation is performed on the uplink transmission signal based on the read crystal oscillator frequency offset.
[0081] The terminal device receives downlink radio frames sent by the access point device. These downlink radio frames include known reference signals used for channel estimation and synchronization. In multi-terminal collaborative scenarios of the Industrial Internet of Things (IIoT), such as when a production line sensor cluster needs to maintain precise timing with the central controller, the downlink radio frames serve as the carrier of initial synchronization, providing a signal basis for subsequent frequency offset estimation.
[0082] The carrier frequency offset between the access point device and the terminal device is extracted using the known reference signal in the downlink radio frame. Specifically, the receiver baseband processor locates the starting position of the long training field in the preamble and extracts the time-domain sampling sequences of the first and second orthogonal frequency division multiplexing (OFDM) symbols. Point-by-point conjugate multiplication is performed on the sampling sequences of the two symbols to obtain the instantaneous phase difference sequence. A sliding window averaging process is then applied to the instantaneous phase difference sequence to calculate the average phase angle. The phase angle, symbol time interval, and system sampling frequency are substituted into the frequency offset formula to obtain the carrier frequency offset value. This step quantifies the phase distortion in the radio signal into a frequency domain deviation, providing data support for tracing the source of crystal oscillator level errors.
[0083] The carrier frequency offset is converted into a crystal oscillator frequency offset, representing the relative deviation between the two crystal oscillator frequencies. The conversion process normalizes the measured carrier frequency offset based on the RF carrier center frequency to eliminate the influence of carrier frequency scaling, yielding a base clock source offset coefficient in parts per million. For example, in industrial Ethernet replacement applications, the carrier frequency offset in the 5GHz band needs to be converted into the frequency drift of the crystal oscillator itself to be suitable for both time synchronization and uplink transmit compensation.
[0084] The crystal oscillator frequency offset is stored in the received frame parameter vector of the terminal device. The received frame parameter vector adopts a data structure that supports the management of multiple records, and each record is appended with a timestamp and frame sequence number identifier. The system dynamically updates the stored content in the received frame parameter vector according to the signal quality evaluation index, retains the frequency offset data at the moment of optimal channel conditions, and avoids outdated measurement values from interfering with subsequent operations.
[0085] When time synchronization calibration or uplink transmission is required, the crystal oscillator frequency offset is read from the received frame parameter vector. The read operation triggers a selective access mechanism based on the task type: time synchronization tasks prioritize the average of multiple recent consecutive measurements, while uplink transmission compensation uses the latest single measurement value. This differentiated read strategy balances the stability requirements of time synchronization with the real-time requirements of frequency compensation.
[0086] If time synchronization calibration is performed, the increment rate of the local timestamp on the terminal device is adjusted based on the read crystal oscillator frequency offset. Calibration is achieved by configuring the accumulator's increment step value: a frequency compensation factor is calculated based on the crystal oscillator frequency offset to generate the actual increment step value; this increment step value is added to the accumulator in each local clock cycle, and when the accumulator overflows, it triggers the timestamp counter to increment. The calibration mechanism compensates for the crystal oscillator frequency deviation by dynamically adjusting the increment step value, ensuring that the timestamp increment rate is synchronized with the access point device. In industrial wireless measurement and control systems, this method maintains long-term synchronization between the terminal device's clock pulse and the access point device, significantly reducing the communication overhead of periodic clock correction.
[0087] If uplink transmission is performed, the uplink transmission signal is pre-compensated for frequency based on the read crystal oscillator frequency offset. The pre-compensation operation is completed during the baseband processing stage, injecting a reverse phase rotation through a digital frequency synthesizer and adjusting the sampling clock frequency of the digital-to-analog converter. Taking a motor synchronous control scenario as an example, the pre-compensated uplink signal exhibits zero frequency offset characteristics at the receiving end, ensuring the subcarrier orthogonality of uplink orthogonal frequency division multiple access transmission across multiple terminals.
[0088] Based on the received downlink radio frames, the terminal device locates the starting position of the long training field in the preamble using a frame synchronization algorithm. This process utilizes the sequence correlation of known reference signals; for example, in industrial wireless sensor networks, the preamble is designed with a periodic repetition pattern to facilitate the receiver's rapid locking of the signal timing. Starting from the beginning position of the long training field, the device extracts the time-domain sampling sequences of the first and second orthogonal frequency division multiplexing (OFDM) symbols. The acquisition of the sampling sequences depends on the output of the analog-to-digital converter (ADC), with each symbol corresponding to a set of discrete-time samples, reflecting the instantaneous response of the wireless channel.
[0089] Pointwise conjugate multiplication is performed on the sampled sequences of the first and second orthogonal frequency division multiplexing (OFDM) symbols to generate an instantaneous phase difference sequence. This conjugate multiplication operation, implemented in a digital signal processor, essentially calculates the phase change between the two symbols, thereby capturing the linear phase rotation caused by the carrier frequency offset. In multipath propagation environments, the phase difference sequence may contain noise components; therefore, a sliding window averaging process is required. The sliding window averaging uses a fixed-length digital filter to smooth the sequence, suppress random interference, and improve the stability of the estimation results.
[0090] The phase angle corresponding to the averaged instantaneous phase difference sequence is calculated, typically by using the arctangent function to solve for the argument of the complex number, yielding the average phase offset. The phase angle, the time interval between the first and second orthogonal frequency division multiplexing (OFDM) symbols, and the system sampling frequency are substituted into the frequency offset calculation formula. The time interval is determined by the symbol length and sampling rate; for example, in an OFDM system, the symbol interval is fixed. The system sampling frequency is a key parameter for baseband processing. The carrier frequency offset value is directly output through the formula calculation, providing fundamental data for subsequent crystal oscillator calibration.
[0091] The terminal device obtains the radio frequency carrier center frequency from the stored configuration parameters. These configuration parameters are typically preset in the device's non-volatile memory and include operating frequency band and channel information; for example, in industrial wireless communication, the center frequency might be set to 2.4 GHz or 5 GHz. Dividing the carrier frequency offset by the radio frequency carrier center frequency yields the normalized frequency deviation coefficient. This division operation converts the absolute frequency offset into a relative deviation, eliminating the scaling effect of the carrier frequency and making the deviation coefficient applicable to systems in different frequency bands.
[0092] Multiplying the normalized frequency deviation coefficient by 10^6 yields the crystal oscillator frequency offset in parts per million (ppm). ppm is a standard measure of crystal oscillator frequency stability, facilitating direct comparison of clock accuracy between different devices. A timestamp and frame sequence number are appended to the crystal oscillator frequency offset; the timestamp records the measurement time, and the frame sequence number identifies the version of the downlink frame, aiding in tracking channel changes in mobile scenarios. The crystal oscillator frequency offset with the appended timestamp and frame sequence number is then formatted as a structured data record. The formatting process follows a predefined data structure, including field lengths and checksums, ensuring storage integrity.
[0093] Structured data records are written into the receive frame parameter vector. The receive frame parameter vector uses a data structure that supports cyclic updates of multiple records. The write operation is managed by the driver to ensure data persistence and provide a reliable frequency offset reference for subsequent time synchronization or uplink transmission.
[0094] The terminal device reads the system reference clock frequency. The reference clock frequency is the nominal value of the local crystal oscillator, typically tens of megahertz, and is the basis for timestamp generation. A frequency compensation scaling factor is calculated based on the crystal oscillator frequency offset; the scaling factor reflects how fast the terminal device's clock is relative to the access point device, and the sign and magnitude of the offset are considered during calculation.
[0095] Multiplying the frequency compensation scaling factor by 2^32 yields the theoretical accumulated value. The multiplication operation is implemented in digital logic, utilizing shifting and addition to optimize computational efficiency. The theoretical accumulated value is rounded to generate the actual accumulated step value in 32-bit fixed-point format; the fixed-point format avoids the overhead of floating-point operations, making it suitable for real-time processing in embedded systems. The initial value of the accumulator is set to 2^31; this initial value balances overflow frequency and resolution, ensuring smooth timestamp growth.
[0096] At each local clock cycle, the actual accumulated step value is added to the accumulator. The accumulator is a register that continuously accumulates step values, simulating the accumulation process of an ideal clock. The accumulator is monitored for overflow; overflow detection is achieved by checking the most significant bit of the register, triggered when the value exceeds 2^32. When an overflow occurs, the timestamp counter is incremented by one unit; the unit corresponds to the minimum time increment, such as microseconds or nanoseconds, depending on application requirements.
[0097] Based on the timestamp counter's increment data, the actual accumulated step value is dynamically adjusted. This dynamic adjustment process involves periodically comparing the actual timestamp increment rate with the standard timestamp increment rate (calculated based on the system's reference clock frequency), calculating the increment deviation ratio, and adjusting the actual accumulated step value accordingly, forming a closed-loop control. By continuously adjusting the accumulated step value, the impact of crystal oscillator frequency drift on the timestamp increment rate is offset. In industrial control systems, this mechanism can maintain long-term synchronization and reduce the frequency of calibrations.
[0098] The terminal equipment parses the uplink transmission scheduling information. This scheduling information, provided by the media access control layer, specifies parameters such as the uplink carrier frequency and signal bandwidth. For example, in orthogonal frequency division multiple access (OFDM) transmission, bandwidth determines the number of subcarriers. The phase compensation amount corresponding to the carrier frequency is calculated based on the crystal oscillator frequency offset. This phase compensation amount is the core of pre-compensation, calculated based on the offset and carrier frequency, to compensate for the frequency deviation of the uplink signal.
[0099] The phase compensation value is converted into a 26-bit precise digital phase parameter. The conversion process uses digital signal processing algorithms, such as coordinate rotation digital computer methods, to quantize the phase value into an integer format. A sampling clock frequency compensation coefficient is calculated based on the crystal oscillator frequency offset, generating a 32-bit sampling rate adjustment parameter. This parameter controls the clock frequency of the digital-to-analog converter, compensating for the sampling clock deviation.
[0100] The digital phase parameters and sampling rate adjustment parameters are written to the physical layer's configuration register. The write operation is completed via the bus interface, and the register is mapped to the hardware module to make the parameters effective. During baseband signal modulation, the signal phase is rotated according to the digital phase parameters; this phase rotation is achieved during the digital up-conversion stage, adjusting the phase of each sample through complex multiplication to correct carrier frequency offset.
[0101] During analog-to-digital conversion, the signal is resampled based on parameters adjusted according to the sampling rate. Resampling algorithms, such as interpolation or decimation, adjust the sample rate to match the compensated clock frequency. For example, in sensor uplink transmission, the pre-compensated signal maintains orthogonality when it reaches the access point device, improving demodulation performance.
[0102] The maximum number of records to be stored is set in the received frame parameter vector. When the maximum number of records is reached, the oldest stored frequency offset record is automatically deleted. For each frequency offset record, the system calculates a signal quality evaluation value based on the reference signal quality of the downlink radio frame that generated the record. The signal quality evaluation value is calculated based on the weighted sum of Received Signal Strength Indication (RSSI) and Signal-to-Noise Ratio (SNR), where RSSI has a weight of 0.7 and SNR has a weight of 0.3. When reading the crystal oscillator frequency offset from the received frame parameter vector, the system selects the record with the highest signal quality evaluation value for subsequent calibration or compensation operations.
[0103] The system provides two calibration modes: a first calibration mode and a second calibration mode. The first calibration mode updates the accumulated step value more frequently than the second calibration mode. In the first calibration mode, the system updates the actual accumulated step value at a shorter interval, suitable for industrial control scenarios requiring high time synchronization accuracy. In the second calibration mode, the system updates the actual accumulated step value at a longer interval, reducing processor load and making it suitable for battery-powered terminal devices. When switching between the first and second calibration modes, the system completes the accumulated step value update for the current cycle before starting the update for the new mode, ensuring timing continuity. The system dynamically selects the mode based on the terminal device's power status or processing load; for example, it automatically switches to the second calibration mode to extend battery life when the battery is low, and activates the first calibration mode to maintain synchronization accuracy during high data throughput.
[0104] If uplink transmission is performed, the uplink transmission signal is pre-compensated based on the read crystal oscillator frequency offset.
[0105] Frequency pre-compensation includes the following steps: The terminal device parses the uplink transmission scheduling information to determine the uplink carrier frequency and signal bandwidth; calculates the phase compensation amount corresponding to the carrier frequency based on the crystal oscillator frequency offset, and converts the phase compensation amount into 26-bit precision digital phase parameters using the Coordinate Rotating Digital Computer (CORDIC) algorithm; calculates the sampling clock frequency compensation coefficient based on the crystal oscillator frequency offset to generate 32-bit sampling rate adjustment parameters; and writes the digital phase parameters and sampling rate adjustment parameters into the physical layer configuration register. During baseband signal modulation, the I / Q signals are phase-rotated according to the digital phase parameters; during digital-to-analog conversion, the clock divider is controlled according to the sampling rate adjustment parameters to resample the signal.
[0106] The system assigns high priority (priority 7) to the time synchronization calibration task and medium priority (priority 5) to the uplink transmit frequency pre-compensation task. When both tasks need to be executed simultaneously, the time synchronization calibration task is executed first. The first performance evaluation parameter for the time synchronization calibration task is the accumulated timestamp error, and the second performance evaluation parameter for the uplink transmit frequency pre-compensation task is the instantaneous frequency deviation. When the accumulated timestamp error exceeds 10 microseconds, the CPU scheduling frequency of the time synchronization task is increased; when the instantaneous frequency deviation exceeds 100Hz, the processing bandwidth of the uplink compensation task is temporarily increased. Resource allocation is implemented through the real-time operating system scheduler, which dynamically adjusts the CPU time slice ratio based on the performance evaluation parameters.
[0107] Secondly, the present invention provides a time-frequency joint calibration terminal device based on carrier frequency offset, applied to the aforementioned time-frequency joint calibration method based on carrier frequency offset, comprising:
[0108] The receiving unit is used to receive downlink radio frames sent by the access point device;
[0109] The processing unit is used to obtain the carrier frequency offset between the access point device and the terminal device through the known reference signal in the downlink radio frame, and convert the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation of the crystal oscillator frequencies of the two parties.
[0110] A storage unit is used to store the crystal oscillator frequency offset into the received frame parameter vector;
[0111] The read unit is used to read the crystal oscillator frequency offset from the received frame parameter vector when time synchronization calibration or uplink transmission is required.
[0112] The time calibration unit is used to adjust the growth rate of the local timestamp of the terminal device according to the read crystal oscillator frequency offset when performing time synchronization calibration;
[0113] The frequency compensation unit is used to perform frequency pre-compensation on the uplink transmission signal based on the read crystal oscillator frequency offset during uplink transmission.
[0114] Calculate the carrier frequency offset;
[0115] In a wireless communication system, let the transmit carrier frequency of the access point device be... The local receiving reference frequency of the terminal device is Since the two devices use independent crystal oscillators as frequency references, the difference between them manifests as a carrier frequency offset in the signal received by the terminal device, which is defined as:
[0116] (1)
[0117] In the baseband equivalent model, let the baseband signal transmitted by the access point device be... The signal received by the terminal device can then be represented as:
[0118] (2)
[0119] in, Represents a continuous-time variable. This indicates the baseband signal received by the terminal device. This indicates the baseband signal sent by the transmitting device. The imaginary unit is used to describe the phase rotation of a signal in the complex plane. This indicates the carrier frequency offset between the access point device and the terminal device. Indicates noise.
[0120] As can be seen from the above formula, the carrier frequency offset in the received signal is manifested as a phase rotation that changes linearly with time, and its phase change rate is proportional to the carrier frequency offset.
[0121] In a discrete-time system, let the sampling frequency be... The sampling period is If, in the received downlink single-user frame, two known reference signals are selected with a time interval between them... There are 10 sampling points, and the phase difference between the two is measured to be 1. Then we have:
[0122] (3)
[0123] Therefore, the formula for calculating the carrier frequency offset can be derived as follows:
[0124] (4)
[0125] In a practical system, after receiving a wireless frame, the phase difference is obtained through the DCC phase detection unit:
[0126] (5)
[0127] in, This indicates the results of processing using LLTF autocorrelation. This indicates the phase angle.
[0128] In typical wireless communication, existing preambles are transmitted in a 20MHz main channel. LLTF frequency offset calibration uses 64 points, calculated using the following formula:
[0129] (6)
[0130] Therefore, by combining the system sampling rate and symbol interval, the specific formula for calculating the carrier frequency offset can be obtained:
[0131] (7)
[0132] Calculate the crystal oscillator frequency offset and store it in rxvector:
[0133] After the terminal device obtains the carrier frequency offset, it knows its own carrier center frequency is... The crystal frequency offset between devices can be calculated using the following formula:
[0134] (8)
[0135] The unit is ppm, which stands for part per million.
[0136] The crystal oscillator frequency offset was calculated. Then, it is stored in rxvector, which can be retrieved as needed in subsequent processes. For example, when an HE TB PPDU needs to be sent, the frequency offset calculation pre-compensation value can be directly obtained from rxvector without the need for Trigger frame interaction; after time synchronization, the timestamp can be compensated based on the frequency offset to keep the time growth between devices consistent and make the timestamp more accurate. The software can decide whether to retrieve it based on the actual situation without incurring additional computational overhead.
[0137] Based on the frequency offset compensation timestamp;
[0138] Normally, after time synchronization is completed, although the terminal device and the access point device have the same timestamp at a certain moment, the growth rate of the local clock of the terminal device is still inconsistent with that of the access point device due to the frequency deviation of the crystal oscillators of the two devices, which causes the timestamp error to gradually accumulate over time.
[0139] In terminal devices, timestamps are typically generated by an accumulator driven by a local clock. Ideally, the local standard clock frequency is assumed to be... The timestamp is generated by adding a fixed step value to the current timestamp in each local clock cycle, so that the timestamp grows at a fixed rate.
[0140] In this scheme, as mentioned above, the terminal device has already calculated the crystal oscillator frequency offset between devices based on the carrier frequency offset. The unit is ppm. This crystal oscillator frequency offset characterizes the speed relationship between the local clock of the terminal device and the clock of the access point device.
[0141] To address the aforementioned issues, this application employs a timestamp fine calibration mechanism based on accumulator overflow.
[0142] Instead of directly accumulating the timestamp in steps each clock cycle, this mechanism introduces an accumulator register (e.g., a 32-bit accumulator) for fine calibration, and periodically accumulates the accumulator by configuring the addend value.
[0143] Specifically:
[0144] In each local clock cycle, the addend value is accumulated into the accumulation register;
[0145] The preset step value is added to the current timestamp only when the accumulator register overflows;
[0146] The accumulator register restarts its accumulation process after overflow.
[0147] By changing the value of addend, the number of overflows per unit time can be controlled, thereby effectively changing the timestamp growth rate and achieving fine compensation for crystal oscillator frequency deviation.
[0148] Assuming the local standard clock frequency is So, the clock frequency after compensation It should be:
[0149] (9)
[0150] To ensure that the timestamp increment rate matches the standard clock frequency, the accumulator register needs to be set to... Within each local clock cycle, only [the following is generated]: The number of overflows is proportional. Therefore, the value of addend needs to be set to:
[0151] (10)
[0152] By configuring the addend value, the accumulator register can still generate overflow at the same rhythm as the standard clock frequency even if the crystal oscillator frequency deviates, thus ensuring the accuracy of the timestamp growth rate.
[0153] According to the frequency offset pre-compensated TB frame, when the terminal device sends the uplink HE TB PPDU, if the carrier frequency offset is not compensated, the uplink signal will be affected by the carrier frequency deviation caused by the crystal oscillator frequency offset, thereby reducing the reception performance of the access point device.
[0154] To this end, this application utilizes the crystal oscillator frequency offset that has been calculated and stored in the received frame parameter vector. Before the terminal device transmits the uplink TB frame, a frequency correction opposite to the direction of the crystal oscillator frequency offset is introduced into the transmitted signal to achieve frequency pre-compensation of the uplink signal.
[0155] In practice, frequency precompensation is accomplished by configuring physical layer transmit frequency offset compensation parameters, and its calculation method includes, but is not limited to, the following forms.
[0156] Sampling Frequency Offset (SFO) compensation value, used to correct the sampling clock frequency at the transmitting end:
[0157] (11)
[0158] Carrier Frequency Offset (CFO) phase compensation value, used to correct the carrier frequency at the transmitting end:
[0159] (12)
[0160] Where CarrierFreq represents the carrier center frequency, and CBW represents the channel bandwidth. This indicates the frequency offset of the crystal oscillator.
[0161] By calculating the above parameters, the frequency compensation required for transmitting the uplink TB frame can be obtained. When the terminal device transmits the uplink TB frame, the physical layer performs frequency and phase pre-compensation on the transmitted signal according to the compensation parameters, without relying on an additional trigger frame. This ensures that the uplink signal is aligned with the receiving reference frequency when it arrives at the access point device, thereby improving the stability and demodulation performance of uplink communication.
[0162] Example 1: Time synchronization precision calibration based on crystal oscillator frequency offset;
[0163] In this embodiment, the terminal device and the access point device constitute a wireless communication system and perform time synchronization.
[0164] The time synchronization period is 5 seconds. However, due to clock drift, the timestamps of the two devices are the same at the moment of time synchronization. However, due to clock drift, the timestamps of the two devices grow at different rates. After 1 second, the timestamps are different. If the timestamps are to be consistent, the time synchronization period needs to be shortened to less than 1 second, which seriously affects the efficiency of effective data communication.
[0165] In this scheme, when the system performs time synchronization, after data transmission and reception, the crystal oscillator frequency offset between the two devices can be calculated using formulas (7) and (8) in the technical scheme. It is then stored in rxvector and reported to the software. The receiving device can then use the local clock frequency and crystal oscillator frequency offset. The local timestamp step value is compensated according to formulas (9) and (10) to make the clock growth rate of the receiving device and the transmitting device consistent, thus achieving precise time synchronization calibration. After clock frequency compensation, the two devices can keep their timestamps consistent for a longer period of time, which can reduce the time synchronization cycle and improve the efficiency of transmitting effective data over the air interface.
[0166] Example 2: Uplink frequency pre-compensation of HE TB PPDU based on crystal oscillator frequency offset;
[0167] In this embodiment, the terminal device needs to send an uplink HE TB PPDU to the access point device for uplink data transmission.
[0168] Typically, when a device performs uplink orthogonal frequency division multiple access (OFDM) transmission, the access point device needs to send a trigger frame. Then, the terminal device performs frequency offset pre-compensation based on this frame and replies with an HE TB PPDU frame. The interaction of frequency offset trigger frames severely affects air interface efficiency.
[0169] In this scheme, after data transmission and reception, the crystal oscillator frequency offset between the two devices can be calculated using formulas (7) and (8) in the technical solution. The crystal oscillator frequency offset is stored in rxvector and reported to the software. When a HE TB PPDU frame needs to be replied to, it can be read from rxvector. The sampling frequency offset (SFO) compensation value and the carrier frequency offset (CFO) phase compensation value are calculated according to formulas (11) and (12) and sent to the physical layer. The physical layer adjusts the corresponding carrier frequency according to these two values to ensure strict alignment between multiple devices. Then, HE TB PPDU frames can be sent without the need for Trigger frame scheduling.
[0170] In uplink multi-user orthogonal frequency division multiple access (OFDM) transmission scenarios, an access point device (APD) communicates with multiple terminal devices. For example, an APD may communicate with four terminal devices within an 80MHz bandwidth, dividing the 80MHz bandwidth into four consecutive 20MHz resource units, each allocated to a different terminal device. Without frequency offset calibration, the carrier frequency of each terminal device will shift independently due to crystal oscillator deviation, leading to spectral conflicts. Through the frequency offset pre-compensation of this invention, each terminal device calibrates its carrier frequency based on the APD, ensuring strict alignment of uplink signals within the corresponding resource units, avoiding spectral overlap, and improving the orthogonality of multi-user transmission.
[0171] Example 3: Time-frequency joint compensation based on single frequency offset estimation;
[0172] In this embodiment, the terminal device and the access point device constitute a wireless communication system. The system has high requirements for time synchronization accuracy and uplink multi-user data transmission performance. It requires time synchronization and will perform uplink orthogonal frequency division multiple access transmission.
[0173] During system operation, when the terminal device receives a downlink single-user frame or beacon frame sent by the access point device, it performs phase detection on the reference signal in the received signal according to formulas (7) and (8) in the aforementioned technical solution, calculates the carrier frequency offset, and further converts it into the crystal oscillator frequency offset between the terminal device and the access point device. Crystal oscillator frequency deviation It is stored in the received frame parameter vector rxvector and reported to the software layer for unified management.
[0174] After initial time synchronization is completed, the terminal device no longer relies on high-frequency time synchronization control interactions, but instead reads the crystal oscillator frequency offset from rxvector. Based on the local clock frequency and crystal oscillator frequency offset, the local timestamp step value is compensated according to formulas (9) and (10) so that the timestamp growth rate is consistent with the access point device, thereby maintaining timestamp alignment over a longer period of time and achieving precise calibration of time synchronization. After that, only low-frequency time synchronization control interaction is needed.
[0175] Meanwhile, the terminal device needs to reply with an HE TB PPDU frame in the next frame. The terminal device does not need to wait for the access point device to send a trigger frame for frequency offset calibration, but directly reads the same crystal oscillator frequency offset from rxvector. Based on formulas (11) and (12), the sampling frequency offset compensation parameters and carrier frequency phase compensation parameters are calculated according to the crystal oscillator frequency offset, and the compensation parameters are configured to the physical layer transmission module.
[0176] When the physical layer sends uplink HE TB PPDU frames, it performs frequency and phase pre-compensation on the transmitted signal according to the compensation parameters, so that the uplink signal transmitted by the terminal device is aligned with its receiving reference frequency when it arrives at the access point device, thereby ensuring the orthogonality and demodulation performance of uplink transmission of multiple terminal devices.
[0177] In this embodiment, the timestamp calibration and uplink transmission frequency pre-compensation can be achieved simultaneously through frequency offset estimation in only one downlink frame reception process. This avoids repeated synchronization interactions and additional control frame overhead, effectively reducing system complexity and improving air interface resource utilization efficiency while ensuring high-precision time-frequency synchronization.
[0178] In multi-user uplink orthogonal frequency division multiple access (OFDM) transmission scenarios in industrial wireless communication systems, the terminal device initiates a joint time-frequency calibration process by receiving downlink radio frames sent by the access point device. The preamble of the downlink radio frame includes a known reference signal. The terminal device locates the start position of the long training field based on a frame synchronization algorithm and extracts the time-domain sampling sequence of two consecutive OFDM symbols. By performing point-by-point conjugate multiplication on the sampling sequence, an instantaneous phase difference sequence is obtained. This sequence is then processed by sliding window averaging to suppress noise interference. After calculating the average phase angle and combining it with the symbol time interval and the system sampling frequency, the carrier frequency offset value is finally obtained.
[0179] When converting carrier frequency offset to crystal oscillator frequency offset, the terminal device reads the RF carrier center frequency from its local configuration parameters, obtains the normalized frequency deviation coefficient through division, and then multiplies it by a fixed coefficient to convert it into a crystal oscillator frequency offset in parts per million units. A timestamp and frame sequence number are appended to each offset, formatted as a structured data record including a check field, and written to a circular buffer of the received frame parameter vector. The storage management module implements a first-in-first-out (FIFO) strategy based on a preset maximum number of records, and simultaneously calculates the channel quality evaluation value for each record based on the reference signal quality, prioritizing the record with the highest quality evaluation value during subsequent reads.
[0180] When the terminal device needs time synchronization calibration, the crystal oscillator frequency offset is read from the storage area, and the frequency compensation ratio factor is calculated in combination with the system reference clock frequency. A 32-bit accumulation step value is generated through fixed-point arithmetic and configured into the hardware accumulator. The accumulator increments by the step value each local clock cycle, and overflow events trigger timestamp counter updates. The accumulation step value is dynamically corrected according to the actual growth rate of the timestamp counter, forming a closed-loop control. The system provides two calibration modes: the first calibration mode uses short-cycle step value updates, suitable for high-precision synchronization requirements; the second calibration mode uses long-cycle updates, dynamically switching modes according to the device power status or processing load, effectively reducing power consumption in battery-powered scenarios.
[0181] For uplink transmit frequency pre-compensation, the terminal equipment parses the uplink scheduling information to obtain carrier frequency and bandwidth parameters, and calculates the phase compensation amount and sampling clock compensation coefficient based on the crystal oscillator frequency offset. The 26-bit digital phase parameter and the 32-bit sampling rate adjustment parameter are written into the physical layer register. Phase rotation correction is implemented in the baseband modulation stage, and clock synchronization is adjusted through resampling in the digital-to-analog conversion stage.
[0182] The system prioritizes time synchronization calibration and uplink transmission compensation tasks, dynamically allocating processor resources based on the real-time values of the first and second performance evaluation parameters. In industrial sensor network applications, when multiple terminal devices initiate uplink transmissions simultaneously, this mechanism maintains time synchronization accuracy while ensuring uplink signal orthogonality, significantly reducing the number of dedicated trigger frame interactions and lowering system control overhead and communication latency.
Claims
1. A time-frequency joint calibration method based on carrier frequency offset, characterized in that, include: Step 1: The terminal device receives the downlink radio frame sent by the access point device; Step 2: Obtain the carrier frequency offset between the access point device and the terminal device using the known reference signal in the downlink radio frame; Step 3: Convert the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation between the crystal frequencies of the two sides; Step 4: Store the crystal oscillator frequency offset into the received frame parameter vector of the terminal device; Step 5: When time synchronization calibration or uplink transmission is required, read the crystal oscillator frequency offset from the received frame parameter vector. Step 6: If time synchronization calibration is performed, adjust the growth rate of the local timestamp on the terminal device according to the read crystal oscillator frequency offset. Step 7: If uplink transmission is performed, frequency pre-compensation is performed on the uplink transmission signal based on the read crystal oscillator frequency offset. Also includes: For the frequency offset record in the received frame parameter vector, calculate the signal quality evaluation value based on the reference signal quality of the downlink radio frame that generated the frequency offset record; When reading the crystal oscillator frequency offset from the received frame parameter vector, the frequency offset record with the highest signal quality evaluation value is selected for reading.
2. The time-frequency joint calibration method based on carrier frequency offset according to claim 1, characterized in that, In step 2, the carrier frequency offset between the access point device and the terminal device is obtained using the known reference signal in the downlink radio frame. Based on the received downlink radio frames, locate the starting position of the long training field in the preamble; Starting from the beginning of the long training field, extract the time-domain sampling sequences of the first orthogonal frequency division multiplexing symbol and the second orthogonal frequency division multiplexing symbol; The sampling sequences of the first orthogonal frequency division multiplexing symbol and the sampling sequences of the second orthogonal frequency division multiplexing symbol are subjected to pointwise conjugate multiplication to obtain the instantaneous phase difference sequence. The instantaneous phase difference sequence is averaged using a sliding window method. Calculate the phase angle corresponding to the instantaneous phase difference sequence after averaging; the phase angle is calculated by solving the argument of the complex number using the arctangent function to obtain the average phase rotation caused by the carrier frequency offset; the system reference clock frequency is the nominal frequency value of the local crystal oscillator of the terminal device, and the system reference clock frequency serves as the reference for timestamp generation and frequency compensation; Substituting the phase angle, the time interval between the first and second orthogonal frequency division multiplexing symbols, and the system sampling frequency into the frequency offset calculation formula, the carrier frequency offset value is obtained.
3. The time-frequency joint calibration method based on carrier frequency offset according to claim 2, characterized in that, Step 3 converts the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation between the two crystal oscillator frequencies, including: Obtain the radio frequency carrier center frequency from the configuration parameters stored in the terminal device; Divide the carrier frequency offset value obtained in step 2 by the radio frequency carrier center frequency to obtain the normalized frequency deviation coefficient. Multiply the normalized frequency deviation coefficient by 10^6 to obtain the crystal oscillator frequency offset in parts per million. Add a timestamp and frame sequence number to the crystal oscillator frequency offset; The crystal frequency offset of the attached timestamp and frame sequence number is formatted into a structured data record; Structured data records are written into the received frame parameter vector.
4. The time-frequency joint calibration method based on carrier frequency offset according to claim 3, characterized in that, If time synchronization calibration is performed in step 6, the growth rate of the local timestamp on the terminal device is adjusted according to the read crystal oscillator frequency offset, including: Read the system reference clock frequency; Calculate the frequency compensation factor based on the crystal oscillator frequency offset; Multiply the frequency compensation scaling factor by 2^32 to obtain the theoretical cumulative value; The theoretical accumulated value is rounded to generate the actual accumulated step value in 32-bit fixed-point format. Set the initial value of the accumulator to 2^31; In each local clock cycle, the actual accumulated step value is added to the accumulator; Monitor the accumulator for value overflow; When a numerical overflow occurs, the timestamp counter increments by one unit. The actual cumulative step value is dynamically adjusted based on the growth data of the timestamp counter.
5. The time-frequency joint calibration method based on carrier frequency offset according to claim 4, characterized in that, If uplink transmission is performed in step 7, then frequency pre-compensation is performed on the uplink transmission signal based on the read crystal oscillator frequency offset, including: Analyze the uplink transmission scheduling information to determine the uplink carrier frequency and signal bandwidth; Calculate the phase compensation amount corresponding to the carrier frequency based on the crystal oscillator frequency offset; Convert the phase compensation amount into a 26-bit precision digital phase parameter; Based on the crystal oscillator frequency offset, calculate the sampling clock frequency compensation coefficient and generate 32-bit sampling rate adjustment parameters; Write the digital phase parameters and sampling rate adjustment parameters into the physical layer's configuration register; During baseband signal modulation, the signal is phase-rotated according to digital phase parameters; During the digital-to-analog conversion process, parameters are adjusted according to the sampling rate to resample the signal.
6. The time-frequency joint calibration method based on carrier frequency offset according to claim 5, characterized in that, Step 6 also includes: It provides a first calibration mode and a second calibration mode. The cumulative step value update cycle of the first calibration mode is shorter than that of the second calibration mode. In the first calibration mode, the actual accumulated step value is updated in the first cycle; In the second calibration mode, the actual accumulated step value is updated in a second cycle, which is longer than the first cycle; When it is necessary to switch between the first calibration mode and the second calibration mode, the cumulative step value update of the new mode will begin after the current cycle's cumulative step value update is completed. Select either the first calibration mode or the second calibration mode based on the power status or processing load of the terminal device.
7. The time-frequency joint calibration method based on carrier frequency offset according to claim 6, characterized in that, Also includes: Set the priority of the time synchronization calibration task and the uplink transmit frequency pre-compensation task; When the time synchronization calibration task and the uplink transmit frequency pre-compensation task need to be executed simultaneously, the task with higher priority shall be executed first. Assign a first performance evaluation parameter to the time synchronization calibration task, and assign a second performance evaluation parameter to the uplink transmit frequency pre-compensation task. The processor resource allocation is adjusted based on the values of the first and second performance evaluation parameters.
8. A time-frequency joint calibration terminal device based on carrier frequency offset, applied to the time-frequency joint calibration method based on carrier frequency offset as described in any one of claims 1 to 7, characterized in that, include: The receiving unit is used to receive downlink radio frames sent by the access point device; The processing unit is used to obtain the carrier frequency offset between the access point device and the terminal device through the known reference signal in the downlink radio frame, and convert the carrier frequency offset into a crystal frequency offset that characterizes the relative deviation of the crystal oscillator frequencies of the two parties. A storage unit is used to store the crystal oscillator frequency offset into the received frame parameter vector; The read unit is used to read the crystal oscillator frequency offset from the received frame parameter vector when time synchronization calibration or uplink transmission is required. The time calibration unit is used to adjust the growth rate of the local timestamp of the terminal device according to the read crystal oscillator frequency offset when performing time synchronization calibration; The frequency compensation unit is used to perform frequency pre-compensation on the uplink transmission signal based on the read crystal oscillator frequency offset during uplink transmission.
Citation Information
Patent Citations
Method for realizing synchronization of carrier and sampling clock, and user site device
CN102694762A
Access point, terminal equipment and short-distance communication time synchronization method and system
CN121126510A