Method for clock synchronization between transmitter and receiver
By sampling timestamps between the transmitter and receiver in the wireless Wi-Fi link and synchronous processing, the problem of system clock is solved, and the stability of the buffer and the reliability of data transmission are achieved.
Patent Information
- Application Number
- CN202411924339.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-28
- Filing Date
- 2024-12-25
- Publication Date
- 2025-07-01
AI Technical Summary
In wireless Wi-Fi links, the system clock is out of sync between the transmitter and the receiver, causing the buffer to overflow or underflow.
Clock synchronization is achieved by sampling timestamps between the transmitter and receiver and utilizing the wireless network time synchronization function to generate initial timestamps and target phase difference, and coarse adjustments are performed regularly on the receiver system clock to compensate for the phase difference.
It effectively prevents overflow or underflow of buffers, ensures the stability and reliability of data transmission, and improves the synchronization accuracy of system clocks.
Smart Images

Figure CN120238227A_ABST
Abstract
Description
Technical Field
[0001] The present application generally relates to a method for clock synchronization between a transmitter and a receiver. Background Art
[0002] High Definition Multimedia Interface (HDMI) is a fully digital interface for image and sound transmission, capable of transmitting uncompressed audio and video signals. HDMI can be used in devices such as set-top boxes, DVD players, personal computers, video game consoles, integrated amplifiers, digital audio, and televisions. HDMI can transmit audio and video signals simultaneously. The design of using the same cable to transmit audio and video signals greatly simplifies the installation of system wiring. However, HDMI technology still requires a physical cable connection between the set-top box and the television.
[0003] In the past, wireless networks (Wi-Fi networks) have supported dual-band and tri-band operations, but devices were forced to select a specific frequency band. Devices could only choose between the 2.4 GHz and 5 GHz Wi-Fi network frequency bands and use a single connection to transmit or receive data.
[0004] Wi-Fi 7 allows Wi-Fi 7 devices to simultaneously send and receive data on multiple frequency bands and channels through multi-link operation (MLO). As a result, throughput is increased and latency is reduced, thus improving the reliability for emerging applications such as virtual reality (VR) / augmented reality (AR), online gaming, telecommuting, and cloud computing.
[0005] With the increased throughput in Wi-Fi 7, high-quality audio and video signals can be transmitted and received via Wi-Fi. Therefore, wireless products such as wireless transmitters and wireless receivers can replace the HDMI cable between the television and the set-top box, implementing a wireless one connected line (WOCL) solution.
[0006] However, there is a problem of system clock asynchronization in the wireless Wi-Fi link between the wireless transmitter connected to the set-top box and the wireless receiver connected to the television. If the system clock frequency of the wireless transmitter is greater than that of the wireless receiver, the buffer will overflow. If the system clock frequency of the wireless transmitter is less than that of the wireless receiver, the buffer will underflow. Summary of the Invention
[0007] A method for clock synchronization between a transmitter and a receiver, including sampling a first receiver timestamp and a second receiver timestamp of the receiver at a first time and a second time respectively, sampling a first transmitter timestamp and a second transmitter timestamp of the transmitter at a third time and a fourth time respectively, sampling a first time synchronization function receiver timestamp and a second time synchronization function receiver timestamp by a wireless network time synchronization function at the first time and the second time respectively, sampling a first time synchronization function transmitter timestamp and a second time synchronization function transmitter timestamp by the wireless network time synchronization function at the third time and the fourth time respectively, generating an initial timestamp according to the first receiver timestamp and the first transmitter timestamp, generating an initial time synchronization function timestamp according to the first time synchronization function receiver timestamp and the first time synchronization function transmitter timestamp, generating a target phase difference according to the initial timestamp, the initial time synchronization function timestamp, the first receiver timestamp, the second receiver timestamp, the first time synchronization function receiver timestamp, the second time synchronization function receiver timestamp, the second time synchronization function transmitter timestamp and the second transmitter timestamp, and performing a coarse adjustment on the receiver system clock regularly to compensate for the target phase difference.
[0008] A method for clock synchronization between a transmitter and a receiver through a wireless communication protocol, including sampling at least two transmission timestamps periodically at the transmitter in a reference time domain of the wireless communication protocol, the at least two transmission timestamps being sampled at different time points and separated from each other by a predetermined interval, sampling at least two reception timestamps at the receiver in the reference time domain of the wireless communication protocol, and adjusting a system clock frequency of the receiver according to an offset obtained from the at least two transmission timestamps, the at least two reception timestamps and the predetermined interval.
[0009] These and other objects of the present invention will undoubtedly become obvious to those of ordinary skill in the art after reading the preferred embodiments described in detail below and their various diagrams. Brief Description of the Drawings
[0010] Figure 1 is a block diagram of a wireless single connection line system according to an embodiment of the present invention.
[0011] Figure 2 is a method for system clock synchronization using a Wi-Fi time synchronization function according to an embodiment of the present invention.
[0012] Figure 3 is a flowchart of a method for system clock synchronization according to an embodiment of the present invention. Detailed Description of the Preferred Embodiments
[0013] Figure 1 It is a block diagram of a wireless one connected line (WOCL) system 100 according to an embodiment of the present invention. The WOCL system 100 includes a box 102, a wireless transmitter 104 connected to the box through a High Definition Multimedia Interface (HDMI), a wireless receiver 108 connected to the wireless transmitter 104 through Wi-Fi, and a television 112 connected to the wireless receiver 108 through HDMI. The wireless transmitter 104 includes a video encoder 106, and the wireless receiver 108 includes a line to evolution (L2E) decoder 110.
[0014] The wireless one connected line (WOCL) enables wireless transmission between the box 102 and the television 112 through Wi-Fi. The box side is equipped with the wireless transmitter 104, while the television side is equipped with the wireless receiver 108. The box 102 converts all signals into HDMI outputs and sends the HDMI outputs to the wireless transmitter 104. The wireless transmitter 104 uses the L2E encoder 106 to compress the HDMI outputs to generate Wi-Fi data packets. The Wi-Fi data packets are wirelessly transmitted from the wireless transmitter 104 to the wireless receiver 108. The wireless receiver 108 receives the Wi-Fi data packets and uses the L2E decoder 110 to decode the Wi-Fi data packets into HDMI inputs, and then outputs the HDMI inputs to the television 112. The whole process can be regarded as transmitting signals from the box 102 to the television 112 through an HDMI transmission line. In a wired environment, the system clocks are kept synchronized, but in a wireless environment, the transmitter system clock and the receiver system clock in the wireless transmitter 104 and the wireless receiver 108 may experience clock drift. Therefore, additional synchronization operations must be performed to prevent video frames from being discarded or retransmitted.
[0015] Figure 2 It is a method 200 for clock synchronization using the Wi-Fi time synchronization function according to an embodiment of the present invention. In this embodiment, the transmitter and the receiver communicate through the Wi-Fi communication protocol. According to Figure 2, at the first time and the second time, the first receiver timestamp R1 and the second receiver timestamp R2 are sampled by the receiver system clock respectively. In addition, at the third time and the fourth time, the first transmitter timestamp T1 and the second transmitter timestamp T2 are sampled by the transmitter system clock respectively. In addition, the Wi-Fi communication protocol provides a timing synchronization function (TSF) as a reference clock. The first TSF receiver timestamp TSF R1 , the second TSF receiver timestamp TSF R2 , the first TSF transmitter timestamp TSF T1 and the second TSF transmitter timestamp TSF T2 are sampled by the Wi-Fi TSF at the first time, the second time, the third time and the fourth time respectively.
[0016] In one embodiment, the time period between the first time and the second time is about 200 milliseconds, and the time period between the third time and the fourth time is also about 200 milliseconds.
[0017] First, an initial timestamp T is generated according to the first receiver timestamp R1 and the first transmitter timestamp T1 using the following equation INI :
[0018] T INI = R1 - T1
[0019] Second, an initial TSF timestamp TSF R1 and the first TSF transmitter timestamp TSF T1 are used to generate an initial TSF timestamp TSF INI :
[0020] TSF INI = TSF R1 - TSF T1
[0021] As Figure 2 shown, R2' represents the synchronized second receiver timestamp R2'. Ideally, the second receiver timestamp is adjusted from R2 to R2' so that the system clocks of the transmitter and the receiver can be synchronized. Third, the synchronized second receiver timestamp R2' is generated according to the following equation:
[0022]
[0023] In this equation, the timeline of the receiver system clock is aligned with the timeline of the transmitter system clock. The difference between the second receiver timestamp R2 and the first receiver timestamp R1 is transferred to the timeline of the transmitter system clock. Therefore, the synchronized second receiver timestamp R2′ is transferred from the second receiver timestamp R2 on the timeline of the transmitter system clock.
[0024] Therefore, the target phase difference between the second transmitter timestamp T2 and the synchronized second receiver timestamp R2′ can be calculated by the following equation:
[0025]
[0026] By subtracting T2 from R2′, the target phase difference can be calculated, and thus the offset is obtained according to the following equation, and the receiver system clock is coarsely adjusted accordingly.
[0027]
[0028] T f is the frequency of the system clock, and TSF f is the frequency of the time synchronization function clock. In one embodiment, T f can be approximately 10 MHz, and TSF f can be approximately 1 MHz. Finally, the coarse adjustment is periodically performed on the receiver system clock to compensate for the target phase difference.
[0029] In another embodiment, a fine adjustment is performed in addition to the coarse adjustment. In the fine adjustment phase, the i-th receiver timestamp R i and the (i - 1)-th receiver timestamp R i-1 are sampled by the receiver system clock at the i-th time and the (i - 1)-th time, respectively. The i-th transmitter timestamp T i and the (i - 1)-th transmitter timestamp T i-1 are sampled by the transmitter system clock at the j-th time and the (j - 1)-th time, respectively. The i-th time synchronization function receiver timestamp and the (i - 1)-th time synchronization function receiver timestamp are sampled by the wireless network time synchronization function at the i-th time and the (i - 1)-th time, respectively. The i-th time synchronization function transmitter timestamp and the (i - 1)-th time synchronization function transmitter timestamp are sampled by the wireless network time synchronization function at the j-th time and the (j - 1)-th time, respectively, where i and j are integers greater than 2.
[0030] Then, the phase difference can be calculated according to the following equation:
[0031]
[0032] Generate the i-th first difference fd using the following equation based on the target phase difference and the phase difference i :
[0033] First difference = target phase difference - phase difference
[0034] Therefore, the i-th first difference fd i is input into a loop filter to generate fine tuning. In one embodiment, fine tuning can be performed using an average loop filter according to the following equation:
[0035]
[0036] where n is an integer greater than 0. The loop filter can be, but is not limited to, the average value of n.
[0037] In another embodiment, when the following conditions are met, the i-th transmitter timestamp T i and the i-th time synchronization function transmitter timestamp
[0038]
[0039] where T ob is the time duration for observing the transmitter timestamp, for example, 200 milliseconds.
[0040] Figure 3 is a flowchart of a system clock synchronization method 300 according to an embodiment of the present invention. Method 300 includes the following steps:
[0041] Step S302: Sample the first receiver timestamp R1, the second receiver timestamp R2, the first transmitter timestamp T1, the second transmitter timestamp T2, the first time synchronization function receiver timestamp TSF R1 , the second time synchronization function receiver timestamp TSF R2 , the first time synchronization function transmitter timestamp TSF T1 and the second time synchronization function transmitter timestamp TSF T2 ;
[0042] Step S304: According to the first receiver timestamp R1, the second receiver timestamp R2, the first transmitter timestamp T1, the second transmitter timestamp T2, the first time synchronization function receiver timestamp TSF R1 , the second time synchronization function receiver timestamp TSF R2 , the first time synchronization function transmitter timestamp TSF T1 and the second time synchronization function transmitter timestamp TSFT2 Generate the target phase difference;
[0043] Step S306: Sample the i-th receiver timestamp R i , the (i - 1)-th receiver timestamp R i-1 , the i-th transmitter timestamp T i , the (i - 1)-th transmitter timestamp T i-1 , the i-th time synchronization function receiver timestamp The (i - 1)-th time synchronization function receiver timestamp The i-th time synchronization function transmitter timestamp and the (i - 1)-th time synchronization function transmitter timestamp
[0044] Step S308: Based on the i-th receiver timestamp R i , the (i - 1)-th receiver timestamp R i-1 , the i-th transmitter timestamp T i , the (i - 1)-th transmitter timestamp T i-1 , the i-th time synchronization function receiver timestamp The (i - 1)-th time synchronization function receiver timestamp The i-th time synchronization function transmitter timestamp and the (i - 1)-th time synchronization function transmitter timestamp Generate the first difference; and
[0045] Step S310: Fine-tune between the transmitter system clock and the receiver system clock to achieve synchronization.
[0046] Steps S302 and S304 are used for coarse tuning, and steps S306 - S310 are used for fine tuning. By performing coarse tuning and fine tuning, the frequency of the receiver system clock can be matched with the frequency of the transmitter system clock. Therefore, buffer overflow or underflow will not occur. The system clock synchronization method can be completed using the Wi-Fi time synchronization function.
[0047] Those skilled in the art will readily find that many modifications and variations can be made to the device and method while retaining the teachings of the present invention. Therefore, the above disclosure should be interpreted only in accordance with the scope of the appended claims.
[0048] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element. The orientation or positional relationship indicated by terms such as "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present application. Unless otherwise expressly specified and defined, the terms "mounted", "connected", "coupled" shall be construed broadly, for example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection, or an electrical connection; it may be directly connected, or indirectly connected through an intermediate medium, and may be the internal communication of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.
[0049] The various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other, and the focus of each embodiment is to illustrate the differences from other embodiments. In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the embodiments of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0050] In this application, specific embodiments are used to elaborate on the principles and implementation manners of the application. The description of the above embodiments is only used to help understand the method and its core idea of the application; at the same time, for those of ordinary skill in the art, according to the idea of the application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the application.
Claims
1. A method for clock synchronization between a transmitter and a receiver, characterized in that: include: sampling a first receiver timestamp and a second receiver timestamp of the receiver at a first time and a second time, respectively; sampling a first transmitter timestamp and a second transmitter timestamp of the transmitter at a third time and a fourth time, respectively; At the first time and the second time, respectively, a first time synchronization function receiver timestamp and a second time synchronization function receiver timestamp are sampled by the wireless network time synchronization function; At the third time and the fourth time, the wireless network time synchronization function samples the first time synchronization function transmitter timestamp and the second time synchronization function transmitter timestamp respectively; generating an initial timestamp based on the first receiver timestamp and the first transmitter timestamp; generating an initial TSF timestamp according to the first TSF receiver timestamp and the first TSF transmitter timestamp; generating a target phase difference based on the initial timestamp, the initial TSF timestamp, the first receiver timestamp, the second receiver timestamp, the first TSF receiver timestamp, the second TSF receiver timestamp, the second TSF transmitter timestamp, and the second transmitter timestamp; as well as Periodically, a coarse adjustment is performed on the receiver system clock to compensate for the target phase difference.
2. The method according to claim 1, characterized in that Generating the initial timestamp according to the first receiver timestamp and the first transmitter timestamp is generating the initial timestamp by subtracting the first transmitter timestamp from the first receiver timestamp.
3. The method according to claim 1, characterized in that Generating the initial TSF timestamp according to the first TSF receiver timestamp and the first TSF transmitter timestamp is generating the initial TSF timestamp by subtracting the first TSF transmitter timestamp from the first TSF receiver timestamp.
4. The method according to claim 1, characterized in that Generating the target phase difference according to the initial timestamp, the initial TSF timestamp, the first receiver timestamp, the second receiver timestamp, the first TSF receiver timestamp, the second TSF receiver timestamp, the second TSF transmitter timestamp and the second transmitter timestamp is: in: R1 is the first receiver timestamp; R2 is the second receiver timestamp; T INI is the initial timestamp; TSF T2 is the second time synchronization function transmitter timestamp; TSF R1 is the first time synchronization function receiver timestamp; TSF INI is the initial time synchronization function timestamp; TSF R2 is the second time synchronization function receiver timestamp; and T2 is the second transmitter timestamp.
5. The method according to claim 4, characterized in that The coarse adjustment is performed according to the following equation: in: TSF T1 is the first time synchronization function transmitter timestamp; T f is the frequency of the system clock; and TSF f is the frequency of the time synchronization function clock.
6. The method according to claim 5, characterized in that The frequency of the system clock is 10 MHz, and the frequency of the time synchronization function clock is 1 MHz.
7. The method according to claim 4, characterized in that Further including: The i-th receiver timestamp and the (i-1)-th receiver timestamp are sampled by the receiver system clock at the i-th time and the (i-1)-th time, respectively; The i-th transmitter timestamp and the (i-1)-th transmitter timestamp are sampled by the transmitter system clock at the j-th time and the (j-1)-th time, respectively; At the i-th time and the (i-1)-th time, the wireless network time synchronization function samples the i-th time synchronization function receiver timestamp and the (i-1)-th time synchronization function respectively; At the jth time and the (j-1)th time, the wireless network time synchronization function samples the i-th time synchronization function transmitter timestamp and the (i-1)-th time synchronization function transmitter timestamp respectively; generating a phase difference according to the initial timestamp, the initial time synchronization function timestamp, the i-th receiver timestamp, the (i-1)-th receiver timestamp, the i-th time synchronization function transmitter timestamp, the i-th time synchronization function receiver timestamp, the (i-1)-th time synchronization function receiver timestamp and the i-th transmitter timestamp; generating a first difference between the target phase difference and the phase difference; applying a ring filter to filter the first difference to a mean difference; periodically performing a fine adjustment on the receiver system clock to compensate for the average difference; Wherein i and j are integers greater than 2.
8. The method according to claim 7, characterized in that The phase difference is generated according to the initial timestamp, the initial time synchronization function timestamp, the i-th receiver timestamp, the (i-1)-th receiver timestamp, the i-th time synchronization function transmitter timestamp, the i-th time synchronization function receiver timestamp, the (i-1)-th time synchronization function receiver timestamp and the i-th transmitter timestamp: in: R i-1 is the (i-1)th receiver timestamp; R i is the i-th receiver timestamp; is the timestamp of the i-th time synchronization function transmitter; is the (i-1)th time synchronization function receiver timestamp; is the timestamp of the i-th time synchronization function receiver; and T i is the timestamp of the i-th transmitter.
9. The method according to claim 8, characterized in that Generating the first difference between the target phase difference and the phase difference includes subtracting the phase difference from the target phase difference to generate the first difference.
10. The method according to claim 9, characterized in that The fine tuning is performed according to the following equation: in: fd i is the i-th first difference; is the (i-1)th time synchronization function transmitter timestamp; T f is the frequency of the system clock; TSF f is the frequency of the time synchronization function clock; and n is an integer greater than 0.
11. The method according to claim 10, characterized in that The frequency of the system clock is 10 MHz, and the frequency of the time synchronization function clock is 1 MHz.
12. The method according to claim 7, characterized in that Further comprising discarding the i-th transmitter timestamp and the i-th time synchronization function transmitter timestamp when the following conditions are met: in: is the timestamp of the i-th time synchronization function transmitter; is the (i-1)th time synchronization function transmitter timestamp; and T ob is the time duration over which the emitter's timestamp is observed.
13. The method according to claim 1, characterized in that: The receiver timestamp and the transmitter timestamp are sampled at a frequency of 5 Hz.
14. A method for clock synchronization between a transmitter and a receiver via a wireless communication protocol, characterized in that: include: Periodically sampling at least two transmission time stamps at the transmitter in a reference time domain of a wireless communication protocol, wherein the at least two transmission time stamps are sampled at different time points and are separated from each other by a predetermined interval; sampling at least two receive timestamps at the receiver in a reference time domain of the wireless communication protocol; as well as A system clock frequency of the receiver is adjusted based on an offset derived from the at least two transmit timestamps, the at least two receive timestamps, and the predetermined interval.
15. The method according to claim 14, characterized in that Further comprising periodically performing a coarse adjustment on the receiver system clock to compensate for the offset.
16. The method according to claim 14, characterized in that Further comprising periodically performing a fine adjustment on the receiver system clock to compensate for the offset.