Clock recovery in wireless media streaming

Abstract
There is provided, in accordance with some embodiments of the present invention, a system, method and circuit for clock recovery and synchronization in wireless media streaming. More specifically the adverse affect of jitter on the recovery of a wirelessly transmitted MPEG2 Transport Stream (TS) signal at a receiver is addressed through the implementation of algorithms based on observed empirical results, as well as introducing additional timing signals at the transmitter.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, both as to organization and method of operation, together with objects, features, and advantages thereof, may best be understood by reference to the following detailed description when read with the accompanying drawings in which:



FIG. 1A shows a functional block diagram of a receiver decoder utilizing buffer fullness to achieve video synchronization according to the prior art.



FIG. 1B shows a functional block diagram of a receiver decoder utilizing time stamps to achieve video synchronization according to the prior art.



FIG. 2A is diagram showing an exemplary system arrangement of media related devices, according to some embodiments of the present invention, wherein a multimedia device is connected to a wireless transmitter block of the present invention, and a wireless receiver block of the present invention is connected to a display device.



FIG. 2B is diagram showing an exemplary system arrangement of media related devices, according to some embodiments of the present invention, wherein a multimedia device has an embedded wireless transmitter block of the present invention, and the wireless receiver block of the present invention is embedded in a display device.



FIG. 3A is a block diagram illustrating the stages that comprise the wireless transmitter block of the present invention including an audio/video interface, video compression encoder, TX Video QoS Engine, and Wireless transmitter.



FIG. 3B is a block diagram illustrating the stages that comprise the wireless receiver block of the present invention including a Wireless receiver, RX Video QoS Engine, video compression decoder, and audio/video interface.



FIG. 3C is a block diagram illustrating the stages that comprise an alternative embodiment of the wireless transmitter block of the present invention in which the audio/video interface and video compression encoder are not required.



FIG. 3D is a block diagram illustrating the stages that comprise an alternative embodiment of the wireless receiver block of the present invention in which the video compression decoder and audio/video interface are not required.



FIG. 4 is a functional block diagram of the video QoS engine configured for the transmit mode and its placement in a transmit configuration of FIG. 3A, in accordance with some embodiments of the present invention.



FIG. 5 is a functional block diagram of the video QoS engine configured for the receive mode and its placement in a receive configuration of FIG. 3B, in accordance with some embodiments of the present invention.



FIG. 6 is a functional block diagram of the Clock Control Algorithm of the video QoS engine configured for the receive mode of FIG. 5. The Clock Control Algorithm is comprised of the Clock Messages Processing Block, Error Estimation Block, and the Control Value Correction Block, in accordance with some embodiments of the present invention.



FIG. 7 is a functional block diagram of the Clock Messages Block of FIG. 6, and its interrelation to the Error Estimation block and the Control Value Correction Block, in accordance with some embodiments of the present invention.



FIG. 8 is a representation of the components of a Clock Control Message that is an input to the Clock Control Algorithm Block, in accordance with some embodiments of the present invention.



FIG. 9 is a functional block diagram of the Error Estimation Block of FIG. 6 that is comprised of Phase Error Normalization stage, an Envelope Set Building Bock, and a Frequency and Phase Error Estimation stage, in accordance with some embodiments of the present invention.



FIG. 10 is a synthetic graph of error samples with the Sample Envelope outlined, in accordance with some embodiments of the present invention.



FIG. 11 illustrates the determination of Frequency Error Estimation based on the slope of the Sample Envelope of the graph in FIG. 10, in accordance with some embodiments of the present invention.



FIG. 12 is a functional block diagram of the Control Value Correction Block of FIG. 6 that is comprised of Control Value Correction Computing, Control Value Limiter, and Control Value Scaler stages, in accordance with some embodiments of the present invention.



FIG. 13 illustrates an example of a Voltage Controlled Crystal Oscillator (VCXO) characteristic curve for the transformation of ppm to Control Value, in accordance with some embodiments of the present invention.



FIG. 14 illustrates an example graph of a Frequency Correction Function, in accordance with some embodiments of the present invention.



FIG. 15 illustrates an example graph of a Phase Correction Function, in accordance with some embodiments of the present invention.





DETAILED DESCRIPTION

In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be understood by those skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.


Unless specifically stated otherwise, as apparent from the following discussions, it is appreciated that throughout the specification discussions utilizing terms such as “processing”, “computing”, “calculating”, “determining”, or the like, refer to the action and/or processes of a computer or computing system, or similar electronic computing device, that manipulate and/or transform data represented as physical, such as electronic, quantities within the computing system's registers and/or memories into other data similarly represented as physical quantities within the computing system's memories, registers or other such information storage, transmission or display devices.


Embodiments of the present invention may include apparatuses for performing the operations herein. This apparatus may be specially constructed for the desired purposes, or it may comprise a general purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs) electrically programmable read-only memories (EPROMs), electrically erasable and programmable read only memories (EEPROMs), magnetic or optical cards, or any other type of media suitable for storing electronic instructions, and capable of being coupled to a computer system bus.


The processes and displays presented herein are not inherently related to any particular computer or other apparatus. Various general purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct a more specialized apparatus to perform the desired method. The desired structure for a variety of these systems will appear from the description below. In addition, embodiments of the present invention are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the inventions as described herein.


There is provided, in accordance with some embodiments of the present invention, a system, method and circuit for clock recovery and synchronization in wireless media streaming. More specifically the adverse affect of jitter on the recovery of a wirelessly transmitted MPEG2 Transport Stream (TS) signal at a receiver is addressed through the implementation of algorithms (mathematical analysis and formulas) for accurate clock frequency and phase error estimation, based on real-time statistical evaluation of data at the receiver. The clock frequency and clock phase error estimation are achieved with an Envelope Set Building Algorithm based on real time samples of jitter values. Additional timing signals at the transmitter are also introduced to aid in signal synchronization.


According to some embodiments of the present invention, the media transmitter/transceiver may be adapted to transmit content bearing data from a media source to a media receiver functionally associated with a presentation device. The content bearing data may be a compressed media file stored on a source device's non-volatile memory, DVD, VHS, or other storage medium, or a live broadcast signal transmitted via cable or satellite. For purposes of this application, any of the above mentioned content bearing data, or any other data types which may be transmitted, received, and presented in accordance with any aspect of the present invention, may be referred to as: (1) content bearing data, (2) content bearing data stream, (3) media stream, or (4) any other term which would be understood by one of ordinary skill in the art at the time the present application is filed.


The present invention performs short distance wireless transmission using MPEG video compression and WLAN transmission technologies. However, WLAN was designed for data transfer and not the transmission of video. Packet error jitter introduced by the WLAN can range from 10 msec and approach 100 msec. The MPEG decoder requires jitter to be kept in the range of 1 to 30 μsec, which is several orders of magnitude less. Such high jitter levels cause the MPEG decoder to lose signal lock, and disrupt a displayed image. In addition, WLAN does not meet the quality of service (QoS) demanded by video applications. New high definition (HD) displays demand a high quality video signal. System delay techniques to compensate for transmission issues, such as excessive buffering are not acceptable to the viewer. Consumers expect agile channel response during channel/program searches, with delays of under 1 sec and preferably less than 0.5 sec between displayed channels. The present novel invention compensates for the WLANs lack of video performance, and in essence provides the receiver MPEG decoder with the equivalent signal quality of a wired connection to the MPEG encoder at the transmitter.


The present invention achieves the low level of jitter despite the use of the WLAN connection. WLAN implementations may have multiple transmit queues, of packets waiting to be transmitted, with different priorities for the different queues, and transmitter jitter is due to these variable delays. The transmit jitter can be mitigated by implementing packets that are just time stamps (Please see FIG. 4, TS Clock Timestamp packets 410). The TS Clock Timestamp packets 410 are independent and in addition to the Program Clock Reference (PCR) in the Transport Stream (TS) of the MPEG2 signal, and are used to create the recovered clock at the receiver. The TS Clock Timestamp packets 410 have a special transmit queue, and receive a higher priority than other packets to reduce jitter. There is no retransmission of the TS Clock Timestamp packets 410, which is another factor in controlling jitter. In addition, the TS Clock Timestamp packets 410 are given order. The receiver checks if the TS Clock Timestamp packets 410 are received in proper order, and special processing is done to either determine proper order of the packets, or to drop out of sequence packets. Fast interrupt processing at the receiver also contributes to a lower level of jitter. Optionally, to reduce transmit jitter on the TS Clock Timestamp packets 410, the timestamp message is prepared in advance, and the actual value of timestamp is inserted into the message, just before the WLAN transmits this message. (I.e. all the fields of the message except for the timestamp itself are prepared in advance). Alternatively, to reduce Tx jitter, the transmit queue (or queues) of the WLAN is monitored, and when a situation of an empty transmit queue (or queues) arises, a TS Clock Timestamp packet 410 is prepared and sent. In yet another alternative implementation, whenever a TS Clock Timestamp packet 410 is prepared, it is automatically placed at the head of the queue. Algorithms (mathematical analysis and formulas) are implemented for accurate clock frequency and phase error estimation, based on real-time statistical evaluation of data at the receiver. The clock frequency and clock phase error estimation are achieved with an Envelope Set Building Algorithm based on real time samples of jitter values. The novel Envelope Building Algorithm differs from current methods that only use arithmetic averaging. The estimated clock frequency and clock phase errors are used to compute an updated control voltage for the clock source.


Turning now to FIG. 2A, there is shown a diagram of an exemplary system 200 arrangement of media related devices, according to some embodiments of the present invention, wherein a multimedia device 202 is connected to a wireless transmitter block 204 of the present invention, and a wireless receiver block 206 of the present invention is connected to a display device 208. The multimedia device 202 may include (but is not limited to) a DVD, DVR, or VHS player with prerecorded content, or a STB relaying real-time media content. The wireless transmitter block 204 transmits a RF signal composed of information content from the multimedia device 202 to the wireless receiver block 206. The wireless receiver block 206 supplies the information content that originated from the multimedia device 202 to the display device 208. The display device 208 can take many forms including (but is not limited to) an analog TV, SDTV, HDTV, or a monitor.



FIG. 2B is a diagram of an exemplary system 250 arrangement of media related devices, according to some embodiments of the present invention, wherein a multimedia device 202 has the wireless transmitter block 204 of the present invention embedded, and a wireless receiver block 206 of the present invention is embedded in a display device 208. The multimedia device 202 may include (but is not limited to) a DVD, DVR, or VHS player with prerecorded content, or a STB relaying real-time media content. The embedded wireless transmitter block 204 transmits a RF signal composed of information content from the multimedia device 202 to the wireless receiver block 206 embedded in display device 208. The embedded wireless receiver block 206 supplies the information content that originated from the multimedia device 202 to the display device 208. The display device 208 can take many forms including (but is not limited to) an analog TV, SDTV, HDTV, or a monitor. By embedding the wireless transmitter block 204 and/or wireless receiver block 206, additional external connections are avoided, which results in the elimination of extra external wires or cabling. The elimination of external connections contributes to a neater and more reliable system. It should be understood that embedded transmitters can work with non-embedded receivers, or vice versa.



FIG. 3A is a block diagram illustrating the stages that comprise the wireless transmitter block 204 of the present invention including an audio/video interface 302, video compression encoder 304, TX Video QoS Engine 306, and Wireless Transmitter 308. The input audio/video interface 302 provides connection points to receive the information content from the multimedia device 202, and converts the signal into a format suitable for the video compression encoder 304. The video compression encoder 304 compresses the signal, which is then presented to the TX Video QoS Engine 306. The TX Video QoS Engine 306 serves as an interface between the video compression encoder 304 and the Wireless Transmitter 308. The TX Video QoS Engine 306 performs additional processing on the signal that is the subject of this disclosure, and will be developed in greater detail shortly. The Wireless Transmitter 308 can be made of 802.11a/b/g wireless chipsets, or chipsets of the emerging 802.11n, H.264 and UWB standards.



FIG. 3B is a block diagram illustrating the stages that comprise the wireless receiver block 206 of the present invention including a Wireless Receiver 310, RX video QoS engine 312, video compression decoder 314, and output audio/video interface 316. The Wireless Receiver 310 receives the wireless signal from the wireless transmitter block 204, and passes the signal to the RX video QoS engine 312. The RX Video QoS Engine 312 performs additional processing on the signal that is the subject of this disclosure, and will be developed in greater detail shortly. The RX Video QoS Engine 312 passes the signal to the video compression decoder 314. The video compression decoder 314 decompresses the compressed signal and passes the signal along to the output audio/video interface 316. The output audio/video interface 316 provides connection points to the display device 208.



FIG. 3C is a block diagram illustrating the stages that comprise the wireless transmitter block 204′, an alternative embodiment of the present invention, including a TX Video QoS Engine 306, and Wireless Transmitter 308. The audio/video interface 302, video compression encoder 304 are eliminated since the media input is already in a compressed video format. The wireless transmitter block 204′ would generally be used in the embedded context of FIG. 2B.



FIG. 3D is a block diagram illustrating the stages that comprise the wireless receiver block 206′, an alternative embodiment of the present invention, including a Wireless Receiver 310 and RX video QoS engine 312. The video compression decoder 314, and output audio/video interface 316 are eliminated since the required media output is a compressed video format. The wireless transmitter block 206′ would generally be used in the embedded context of FIG. 2B.


Clock Synchronization System Architecture



FIGS. 4 and 5 describe the video compression TS synchronization from a system level perspective. It should be understood that the figures are on a conceptual level only, and do not imply a specific Hardware (HW) or software (SW) implementation.



FIG. 4 is a functional block diagram of the Video QoS Engine 306 configured for the transmit mode and its placement in the transmit configuration of FIG. 3A. The Video Processing Block 400 is made up of the audio/video interface 302 and video compression encoder 304 (shown in FIG. 3A). The TX Video QoS Engine 306 further comprises a TX TS Engine 402, TS Clock Source 404, TS Clock Counter 406, and the Timestamp Clock Packet Generator 408. The TX TS Engine 402 packs the received TS data from the video compression encoder 304 into TS packets and timestamps these packets with a value derived from the TS Clock Source 404. The timestamped TS packets outputted by the TX TS Engine 402 are referred to as Timestamped TS Packets 412. The TS Clock Source 404 may be a crystal oscillator or voltage controlled oscillator (VCXO). The TS Clock Counter 406, which is also driven by the TS Clock Source 404, is used in conjunction with the Timestamp Clock Packet Generator 408 to generate a second set of time stamps that are unique to the present invention to be referred to as TS Clock Timestamp Packets 410. The TS Clock Timestamp Packets 410 are sent to the Wireless Transmitter 308 that transmits the TS Clock Timestamp Packets 410 to the Wireless Receiver 310 (see FIG. 5). The Wireless Receiver 310 sends the received TS Clock Timestamp Packets 410 to the receiver software (RX SW) of the RX Video QoS Engine 312 to obtain the synchronization of the RX VCXO 504 (please see FIG. 5) to the TX TS Clock Source 404. The RX SW passes the TS Clock Timestamp Packets 410 to the Clock Difference Calculation Block 512, which subtracts the Timestamp value received wirelessly from the wireless transmitter block 204 from the value sampled from Receiver TS Clock Counter 510 to compute a TS RX-TX clock difference value, The calculated TS RX-TX clock difference value is passed as a message to the Clock Control Algorithm 502 that performs clock synchronization work.



FIG. 5 is a functional block diagram of the video QoS engine 312 configured for the receive mode and its placement in the receiver configuration of FIG. 3B, The Video Processing Block 500 is made up of the audio/video interface 316 and video compression decoder 314 (shown in FIG. 3B). The RX Video QoS Engine 312 further comprises a Clock Control Algorithm 502 (to be explained in greater detail), VCXO 504, Rx TS Engine 506, RX Jitter Buffer 508, TS Clock Counter 510, and the Clock Difference Calculation 512. The Wireless Receiver 310 sends the received Timestamped TS Packets 412 to the RX Jitter Buffer 508. The VCXO 504 forms the heart of a phase-locked loop (PLL) that synchronizes the wireless receiver block 206 to the wireless transmitter block 204. The PLL is implemented in SW firmware (Clock Control Algorithm 502) that determines the voltage levels that control the VCXO.


Clock Control Algorithm Description


The clock synchronization algorithm of the present invention is a single-stage algorithm with fast response in case of sudden source clock frequency changes and smooth operation during periods of frequency stability. The phase corrections are performed with controlled limited frequency shift values, according to the requirements. The algorithm allows for no loss of phase synchronization, even when correcting large frequency shifts. The algorithm also provides for non-linear gain correction that filters efficiently the variance in the phase readings caused by residual jitter.



FIG. 6 is a functional block diagram of the Clock Control Algorithm 502 of the RX Video QoS engine 312 configured for the receive mode of FIG. 5. The Clock Control Algorithm 502 is comprised of the Clock Messages Processing Block 602, Error Estimation Block 604, and the Control Value Correction Block 606. The Clock Control Algorithm 502 receives Clock Control Messages based on the Clock Difference Calculation 512, and produces a control voltage to adjust the VCXO. In a preferred embodiment of the present invention, pulse width modulation (PWM) is the voltage means (Control Value) to control the VCXO. Therefore the control voltage would be referred to as a PWM Control value from the Control Value Correction Block 606.



FIG. 7 is a functional block diagram of the Clock Messages Block 602 of FIG. 6, and its interrelation to the Error Estimation Block 604 and Control Value Correction Block 606, in accordance with some embodiments of the present invention. The Clock Messages Processing Block 602 receives clock control messages and implements the following functionality: error control 702 for received messages by establishing a reference value, and computing a phase error 704 output value relative to this reference, and scaling the phase output value 704 into microseconds that is then passed to the Error Estimation block 604. The timestamp information received from the wireless transmitter block 204 is processed and transformed by the RX SW Entity (RX Video QoS engine 312) processing these messages into an RX Internal Clock Control Message. The Rx Clock Control Message is then sent to the Clock Messages Processing Block 602. The Clock Control Message (please see FIG. 8) contains a Sequence Number Field 802 and a Clock Difference Field 804. The Sequence Number Field 802 is wrap-around (resets to zero after full count cycle) message counter originated at TX and incremented with each TX clock timestamp message. In a preferred embodiment of the present invention the Sequence Number Field 802 is a 32 bit wrap around counter. The Sequence Number Field 802 is used by the Error Control Block 702 to check and ensure message continuity. The Clock Difference Field 804 is also a wrap-around variable equal to the TS RX-TX clock difference that is computed at the wireless receiver block 206 lowest possible processing level, where messages received from TX are handled in order to prevent any additional jitter at the wireless receiver block 206. The units and size of the clock difference field may differ as a function of implementation.


The Activate/Deactivate interface 608 is used by the upper level applications to control the operation of the clock synchronization subsystem The general lines of operation are the following:


When the RX Unit Receive Jitter Buffer is empty (Sleep mode, Session not established, Communication failure) the clock subsystem should be deactivated. When the media buffering is completed before starting to push the compressed video (MPEG) packets via the TS interface the clock subsystem shall be activated.


In extreme abnormal situations the RX Jitter Buffer may increase too much and the system delay control mechanism may perform one or more packet SKIPs. This may affect the phase error in the clock control mechanisms, and the clock subsystem shall be deactivated and re-activated again.


The operation control entity also performs identical operations on the downstream Error Estimation Block to properly initialize its functionality.


NOTE: When the clock control subsystem is not active, the initialization and refreshing of the VCXO Control Value is within the responsibility of the upper level applications. Once the Clock Control Subsystem has been activated, no other application should modify the Control Value since this will result in system inconsistent operation.


The Error Control Block 702 uses the Clock Control Message Sequence Number field 802 in order to ensure the message sequence continuity. It performs the following operations:


After an ACTIVATION operation performed by the upper SW entities (following link startup or link recovery), the Error Control Block 702 enters a continuity verification phase, where it checks that a significant series of consecutive messages are received without sequence violations. In a preferred embodiment of the present invention at least sixty consecutive messages are checked to determine if there are sequence violations. During this phase, the clock control messages are dropped and not passed down the processing chain.


Once this initial stage is passed, the Error Control Block 702 starts to pass received messages to the Phase Detector block 704, while continuing to verify the message sequence continuity.


If a message is duplicated (the previous sequence number is repeated) the redundant message is dropped.


For any other sequence number violation condition, the message passing to the following processing levels is discontinued until it is assured that messages are again arriving in proper sequence—one way to do this is to check that at least 2 additional messages are received in correct sequence.


Clock control messages contain clock difference values stored as wrap-around unsigned values. For the ease of further handling, they have to go through some pre-processing.


The Phase Detection 704 function transforms the received unsigned valued into a signed phase error value. Since the clock difference values are always in a range less than half of the full available scale, the first received clock difference value is used as reference offset and all values transmitted down the chain are calculated as signed values relative to this offset:





referenceOffset=clockDifference(0)





and





clockError(n)=clockDifference(n)−referenceOffset


Scaling 706 is carried out in order to have the clock error value in desired units of time. In a preferred embodiment of the present invention the clock error value is scaled to microseconds.



FIG. 9 is a functional block diagram of the Error Estimation Block 604 of FIG. 6 that is comprised of Phase Error Normalization stage 902, an Envelope Set Building Bock 904, and a Frequency and Phase Error Estimation 906 stage.


Because of the inherent packet jitter in the WLAN networks, the per-sample timestamp information cannot provide accurate estimations of the phase and frequency difference between the TX and RX clocks. This functionality is provided by the Error Estimation Block 604 that uses a large batch of samples to obtain an accurate estimate.


The Clock synchronization mechanism is supposed to keep the clock phase error close to zero. In order to do so we need to declare the initial phase error as an offset reference value and calculate clock error values relative to this offset. This is referred to as Phase Error Normalization 902.


However, the first phase error value received from the pre-processing block may be affected by jitter and can be actually quite far away from the current minimum phase error values. In order to deal with this issue the following algorithm has been implemented. The first estimation cycle is used in order to calculate the phaseReferenceOffset, and is not used for correcting the VCXO control. The details of the algorithm are as follows:

  • 1. The initial value of the phase reference offset is set to 0.
  • 2. During the first batch of samples, the received phase error values are passed down unmodified to the rest of the Error Estimation Block 604—that by the end of the batch of samples will produce frequency error and phase error estimations.
  • 3. The first value of the phase error is used as reference offset, and from now on all phase error values are calculated relative to this value.





phaseReferenceOffset=Filtered Phase Error(of first batch of samples)phaseError(k)=phaseError(k)−phaseReferenceOffset

  • 4. In the first correction value correction step, the filtered phase error is set to 0.


The Envelope Set Building Algorithm 904 is at the core of the error detection mechanism. This block receives phase error samples and keeps only those samples that satisfy certain properties—defined below—and are called the Sample Envelope (please see FIG. 10). The resulting envelope curves are then used to make accurate estimations of the phase and frequency errors.


Simulations showed that building multiple Sample Envelopes and performing weighted averages of the frequency estimates resulted in more precise results compared to building only a Sample Envelope of order zero. Additionally, building multiple Sample Envelopes enabled the calculation of frequency error statistics, which yielded a reliability measure for the frequency error, and gave a criterion for determining which frequency estimates are invalid and should be ignored.


Sample Envelope Definition


For each clock error sample received we shall define a sample point si as the pair (si−x, sy), where x is the time at which the sample has been received, and y is the sample value (the phase error value). We shall use the notation Si=(Si−x, Sy) for the sample points on the Sample Envelope defined below.


A Sample Envelope is an ordered subset of sample points E={S0 . . . Sn} that have the following properties.


SE1. Si−x<Si+1·x for any i=0 . . . n−2, where n is the number Envelope points [i.e. an ordered set]


SE2. Having the slope of an Envelope segment Si, Si+1 defined as





slope(Si, Si+1)=(Si+1·y−Sy)/(Si+1·x−Si−x),


the following relation shall hold:





slope(Si+1, Si+2)>slope(Si, Si+1) for any i=0 . . . n−3.


[i.e. the sample envelope is a concave shape pointing upwards]


SE3. For any sample point s not part of the Sample Envelope subset, there is an envelope point Ei such as:





Sx<s.x<Si+1·x, and


slope (Si, s)≧slope (Si, Si+1)


[i.e. all other points are contained within the Sample Envelope concavity—The curve is defined so that all samples are on or above the curve.]



FIG. 10 is a synthetic illustration of a samples batch with the Sample Envelope outlined. It should be noted that the graphical representation are for illustrative purposes only and do not reflect real process data.


Envelope Set


The very first envelope built using all the samples is called the envelope of order zero E(0). If all E(0) points are put aside, a new envelope may be built, E(1), and so on until all points are exhausted.


An Envelope Set of order N is the set of envelopes {E(0), E(1), . . . E(N−1)}. For practical frequency and phase error estimation purposes, only the first envelope orders are useful since they reflect the statistics of large number of samples.


The current algorithm of the preferred embodiment of the present invention uses an order 4 envelope set made of {E(0), E(1), E(2), E(3)}. However, it should be noted that N (the number of envelopes) can vary from one to any user defined number.


Building the Envelope Set


The building of the Envelope Set is a process that starts from adding the new samples to the outmost envelope, E(0). At the level of E(0), the algorithm may decide that certain points are no longer on E(0) and pass them to E(1) for processing. E(1) may keep them and perhaps pass its own previous points to E(2), and so on.


Since the algorithm is iterative, let's suppose that currently we have already built an Envelope E(k)={S0 . . . Sn} and a new sample s is processed:


Step 1. Find the sample horizontal location.


The sample may be outside the envelope limits, or be within the time period covered by an envelope segment (let's call this segment Si, Si+1).


Step 2. Add the sample to the current segment, if applicable.


If the sample is outside the E(k) time span, it is always added to E(k), otherwise it is added only if the associated phase error value is located under the corresponding envelope segment. If the sample is not added to E(k), pass it to E(k−1) for processing and terminate.


Step 3. Eliminate additional points from envelope.


The inserted Sample Sj is taken as the reference and the 2 envelope segments to the left are checked for the envelope rule SE2. If SE2 does not hold, point Sj−1 is eliminated from E(k) and passed to E(k+1) for processing. The step is repeated until SE holds.


The same procedure is applied to the right side of Sj by eliminating Sj+1 points if necessary and passing them to E(k+1) processing.


Termination Condition


To support the cases when the clock jitter distribution is more scattered because of wireless noise, each sample batch used to build the Envelope Set takes 12 sec. The sample frequency used in the algorithm of the preferred embodiment of the present invention is 60 Hz (resulting in batches of 720 samples). Other embodiments or implementations of the present algorithm may use different sampling frequency rate as well as different sample intervals to build the Envelope Set. In addition the samples are not required to be uniformly spaced. A varying or random sampling rate may be used.


Both the frequency error and phase error estimations algorithms use the fact that for large sample batches the slope of the long envelope segments approximate fairly well the difference in the clocks speed—namely the frequency error. Such a large envelope segment is pictured in FIG. 11.


Frequency Error Estimation


The Frequency error freqErr(n) based on Envelope of order n is defined as follows:


Find the envelope segment which has the largest time span, for example find the value i that maximizes Si.x−Si−1.x.


Calculate the slope of segment i:





freqErr(n)=(Si.y−Si−1.y)/(Si.x−Si−1.x)


Scale this value to ppm units


In order to increase the accuracy of the estimation, the frequency error estimations obtained from the envelopes E(0) . . . E(n−1) are used in a weighted formula:





freqErr=W0*freqErr(0)+W1*freqErr(1)+W2*freqErr(2)+ . . . +Wn−1*freqErr(n−1)


The weighting of the envelopes is based on observed results and can be varied according to a particular system performance. A simplified version of the algorithm may consist of just a single envelop with no weighting applied. In an example of a preferred embodiment of the present invention employing an order of four envelope, estimations obtained from the first four envelopes E(0) . . . E(3) are used in the following weighted formula:





freqErr=0.30*freqErr(0)+0.37*freqErr(1)+0.22*freqErr(2)+0.11*freqErr(3)


where freqErr(k) corresponds to the frequency error estimation based on the E(k) longest segment in time. The frequency error is calculated in 27 MHz ppm units.


Frequency Error Statistics


It may happen that the frequency error estimation obtained from different envelops do not match; in such situations the estimation of the current batch is dropped and not used for corrections.


The level of fitness of the individual estimations is computed using the weighted average deviation from the freqErr calculated above:





avrgDeviation=W0*ABS(freqErr−freqErr(0))+W1*ABS(freqErr−freqErr(1))+W2*ABS(freqErr−freqErr(2))+ . . . +Wn−1*ABS(freqErr−freqErr(n−1))


where ABS( )=absolute value( ).


If the weighted average deviation is larger than a deviation threshold value, the frequency error evaluation is considered not valid and ignored. In an example of a preferred embodiment of the present invention, a deviation threshold value of 5 ppm is used.


The weighting of the average deviation is based on observed results and can be varied according to a particular system performance. In an example of a preferred embodiment of the present invention employing an order of four envelope, frequency error estimations obtained from the first four envelopes E(0) . . . E(3) are used in the following weighted formula:





avrgDeviation=0.30*ABS(freqErr−freqErr(0))+0.37*ABS(freqErr−freqErr(1))+0.22*ABS(freqErr−freqErr(2))+0.11*ABS(freqErr−freqErr(3))


where ABS( )=absolute value( ).


Other weighting values and even alternative weighting functions including mean square error or maximum absolute error may be used.


Phase Error Estimation


The phase error (clock difference) is estimated using a similar procedure.


First, the phase error corresponding to individual envelopes is computed taking as reference the longest envelope segment and extrapolating from it the phase error corresponding to the last envelope sample. If the envelope E(k) segment used for frequency estimation is Si, Si+1, and the last sample s, then





phaseError(k)=Si+1·y+slope(Si, Si+1)*(s.x−Si+1x)


The phase error is then calculated using:





phaseErr=W0*phaseErr(0)+W1*phaseErr(1)+W2*phaseErr(2)+ . . . +Wn−1*phaseErr(n−1)


The weighting of the phase error is based on observed results and can be varied according to a particular system performance. In an example of a preferred embodiment of the present invention employing an order of four envelope, phase error estimations obtained from the first four envelopes E(0) . . . E(3) are used in the following weighted formula:





phaseErr=0.30*phaseErr(0)+0.37*phaseErr(1)+0.22*phaseErr(2)+0.11*phaseErr(3)


Representation Units


The units of the output values of the Error Estimation Block 604 are as follows.


The phase error is represented in microseconds units.


The frequency error units are hundreds of 27 MHz ppb units (i.e. 0.1 ppm units).


Other units may be chosen depending on system implementation requirements.



FIG. 12 is a functional block diagram of the Control Value Correction Block 606 of FIG. 6 that is comprised of Control Value Correction Computing 1200, Control Value Limiter 1202, and Control Value Scaler 1204 stages.


The Control Value Correction Computing Block 1200 carries out the following computation:


The Loop Control Algorithm computes a new Control Value (CVAL) correction value based on the phase and frequency errors, as follows:






CVAL
n
=CVAL
n−1CVAL(freqErrn, phaseErrn),


where CVALn is the next Control Value and CVALn−1 is the previous Control Value.


To preserve accuracy in the preferred embodiment, the Control Values are calculated using units of an order of magnitude (×10) larger than the actual value. The correction function δCVAL is using the VCXO device characteristic curve (please see FIG. 13) to convert into Control Value units a computed frequency error expressed in ppm units:





δCVAL=−ppmToCVAL(ppm1(freqErrn)+ppm2(phaseErrn))


The ppmToCVAL is device dependent and has to be fit to the particular VCXO component. For the example of FIG. 13, the simplest approach is to define ppmToCVAL(x) as multiplying x by the reciprocal of the average slope of the graph, or alternatively as multiplying x by the reciprocal of the average slope of the region around the center of the graph.


In ideal conditions (no jitter), the function ppm1 would replicate identically the frequency error (i.e. ppm1(x)=x). In this case the Control Value correction formula would be:





δCVAL=−ppmToCVAL(freqErrn+ppm2(phaseErrn))


However, because of the remaining jitter influencing the freqErr values, the ppm1 function is non-linear to attenuate jitter.



FIG. 14 illustrates an example graph of a Frequency Correction Function. The Frequency correction function is non-linear and acts in a gradual manner to avoid oscillation.


Mathematically:




for x<=−6.4 ppm1(x)=x+4





for −6.4<x<−3.2 ppm1(x)=x/2+0.8





for −3.2<=x<=3.2 ppm1(x)=x/4





for 3.2<x<6.4 ppm1(x)=x/2−0.8





for x>=6.4 ppm1(x)=x−4


The formulas have as input the frequency error in 27 MHz ppm units, and have as output a ppm correction value. As in the case of the phase correction, the Control Value units are obtained using the specific VCXO characteristic curve slope.



FIG. 15 illustrates an example graph of a Phase Correction Function. The Phase correction function is non-linear.


Mathematically:




for x<=−250 ppm2(x)=−4





for −250<x<−60 ppm2(x)=(x+50)/50





for −60<=x<=60 ppm2 (x)=x/100





for 60<x<250 ppm2(x)=(x−50)/50





for x>=250 ppm2(x)=4


The phase error units are microseconds and the output units are computed in 27 MHz clock ppm units.


Since calculations may sometimes exceed the actual scale, the Control Value has to be corrected to minimum and maximum values. The limits are set by the Control Value Limiter 1202 of FIG. 12:





If (CVALn<MINCVAL)CVALn=MINCVAL





If (CVALn>MAXCVAL)CVALn=MAX_CVAL





The MIN_CVAL and MAX_CVAL values have to take into account the current scaling (see below).


As mentioned before, the CVAL values are calculated using an order of magnitude larger than the actual values. To perform actual commands, the CVAL values are scaled down with a factor of 10: This is carried out by the CVAL Scaler Block 1204 of FIG. 12.






CVALControlValuen=CVALn/10


Please note that the original CVALn values are left intact by scaling for use in the next control calculation step.


CVALControlValue is used as a control voltage of the VCXO.


If Pulse Width Modulation is employed in the correction process then a pwmControlValue is used to drive a Pulse Width Modulation modulator that is connected to the control voltage of the VCXO.


Alternatively, if the CVALControlValue feeds a D/A (digital to analog converter) that is connected to the control voltage input of the VCXO; the changing of the control voltage of the VCXO will change the output frequency of the VCXO.


In yet another alternative implementation, the wireless receiver block 206, instead of using a VCXO, may have a fixed frequency clock source that is divided down to the required frequency. The division ratio is varied over a small range, and thus the required frequency can also vary over a small range. In this case, the CVALControlValue will be scaled appropriately and will be used to determine the division ratio, and in this manner will control the output frequency.


Video Streaming Description


The Rx TS Engine 506 derives timestamp values from the clock output generated by the VCXO 504, or from the fixed frequency clock source of the alternative embodiment. The application specific delay of a particular multimedia signal implementation will dictate to the Rx TS Engine 506 what the required difference between the derived timestamp value and the timestamps that are part of the received Timestamped TS Packets 412. Subsequently, the Rx TS Engine 506 processes the received Timestamped TS Packet 412 that is first in the Rx Jitter Buffer 508. As explained earlier, the received Timestamped TS Packet 412 is composed of a Timestamp and of a TS packet. The RX TS Engine 506 examines the Timestamp of the received Timestamped TS Packet 412. At the instant the difference between the Timestamp of the received Timestamped TS Packet 412 and the Rx TS Engine 506 derived timestamp equals the required difference, the RX TS Engine 506 sends the TS packet of the received Timestamped TS Packet 412 to the video compression decoder 314, and clears the first entry in the Rx Jitter Buffer 508.


In an alternative embodiment, according to the delay required by the multimedia signal application, the Rx TS Engine 506 will determine a range of required difference values between the Rx TS Engine 506 derived timestamp and the timestamps that are part of the received Timestamped TS Packets 412. Subsequently, the Rx TS Engine 506 processes the received Timestamped TS Packet 412 that is first in the Rx Jitter Buffer 508. The RX TS Engine 506 examines the Timestamp of the received Timestamped TS Packet 412. At the instant the difference between the Timestamp of the received Timestamped TS Packet 412 and of the Rx TS Engine 506 derived timestamp falls into the range of required difference, the RX TS Engine 506 sends the TS packet of the received Timestamped TS Packet 412 to the video compression decoder 314, and clears the first entry in the Rx Jitter Buffer 508.


In both of the aforementioned video streaming embodiments, the Rx TS Engine 506 keeps repeating the process with respect to the received Timestamped TS Packet 412 that is first in the Rx Jitter Buffer 508. In this manner the Rx TS Engine 506 manages to supply the TS packets to the video compression decoder 314 with minimal jitter.


While certain features of the invention have been illustrated and described herein, many modifications, substitutions, changes, and equivalents will now occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the invention.

Claims
  • 1. A system for wireless streaming of a multimedia signal between a media source and a display device, wherein said system comprises a transmitting means in functional contact with said media source, and a receiving means in functional contact with said display device, and wherein clock synchronization is maintained between said transmitting means and said receiving means through the use of a Clock Control algorithm and a series of first time stamped signals and a series of second time stamped signals generated by said transmitting means for the proper encoding and decoding of said multimedia signal; and wherein said series of first time stamped signals and said second series of time stamped signals are in addition to the timing signals that are part of said multimedia signal; andwherein said multimedia signal is transmitted in packets of information between said transmitting means and said receiving means.
  • 2. The system of claim 1 wherein said multimedia signal is compressed in the MPEG-2 Transport Stream standard.
  • 3. The system of claim 1 wherein said media source provides an analog signal to said transmitting means.
  • 4. The system of claim 1 wherein said media source provides a digital signal to said transmitting means.
  • 5. The system of claim 1 wherein said transmitting means further comprises: a transmit (TX) Video QoS Engine; anda wireless transmitter block; andwherein said TX Video QoS Engine derives and provides said series of first time stamped signals and said second series of time stamped signals to said wireless transmitter block.
  • 6. The system of claim 5 wherein said TX Video QoS Engine further comprises the following functional blocks: a TX TS Engine;a TS Clock Source;a TS Clock Counter; anda Timestamp Clock Packet Generator;wherein said TS Clock source is functionally connected to said TS Clock Counter; andsaid TS Clock Counter is functionally connected to said TX TS Engine and said Timestamp Clock Packet Generator; andwherein said TX TS Engine timestamps said packets with values derived from said TS Clock Source and said TS Clock Counter to form said series of first time stamped signals; andwherein said Timestamp Clock Packet Generator produces said second series of time stamped signals based on values derived from said TS Clock Source and said TS Clock Counter.
  • 7. The system of claim 1 wherein said receiving means further comprises: a wireless receiver block;a Receive (RX) Video QoS Enginewherein said wireless receiver block receives said series of first time stamped signals and said series of second time stamped signals and sends said series of first time stamped signals and said series of second time stamped signals to said RX Video QoS Engine; andwherein said RX Video QoS Engine further comprises the following functional blocks:a RX VCXO;a RX Jitter Buffer;a RX TS Engine;a TS Clock Counter;a Clock Difference Calculation block; andsaid Clock Control Algorithm; andwherein said TS Clock Counter generates a series of receiver time stamp signals; andwherein said series of first timestamp signals is further comprised of said packets and a series of time stamp signals generated by said transmitting means; andwherein said RX Video QoS Engine obtains synchronization of said RX VCXO to said transmitting means by taking said series of second time stamped signals that has been sent by said transmitting means and said series of receiver time stamp signals to compute a TS TX-RX clock difference; andwherein said clock difference value is passed as a message to said Clock Control Algorithm that performs said synchronization.
  • 8. The system of claim 7 wherein said Clock Control Algorithm further comprises the following functional blocks and signals: a Clock Messages Processing Block;an Error Estimation Block; anda Voltage Correction Block; anda Clock Control Message signal;a Phase Error Sample Signal;an Envelope Set Building Block Algorithm; anda control voltage; andwherein said Clock Control Message further comprises a Clock Difference value obtained from said Clock Difference Calculation block; andwherein said Clock Messages Processing Block is inputted said Clock Control Message signal from said Clock Difference Calculation Block, and said Clock Messages Processing Block derives a Phase Error Sample signal based on said Clock Difference value; andwherein said Phase Error Sample signals are inputted into said Error Estimation Block to calculate an accurate estimate of phase and frequency difference between said transmitting means and said receiving means; andwherein said Error Estimation Block uses an Envelope Set Building Block algorithm to determine said estimate of phase and frequency differences; andwherein said estimates of phase and frequency differences are inputted into the Voltage Correction Block that provides a control voltage to adjust said VCXO; andwherein said VCXO is functionally connected to said RX TS Engine that draws said packets from said RX Jitter Buffer and forwards said packets to said functionally connected display device; andwherein the timing of the drawing of said packets from said RX Jitter Buffer is determined by said VCXO together with the timestamps which are part of said series of first time stamped signals.
  • 9. The system of claim 8 wherein in said Clock Control Message signal has a sequence number that is derived from the timestamp information received from said transmitting means; and wherein said Clock Messages Processing Block checks for message sequence continuity, and when a message sequence discontinuity is detected, certain messages are ignored.
  • 10. The system of claim 9 wherein in said Clock Messages Processing Block checks that a predefined number of consecutive Clock Control Messages are received without sequence violations, and that during this sequence checking phase said Clock Control Messages are dropped.
  • 11. The system of claim 9 wherein if a Clock Control Message sequence number is duplicated, the redundant message is dropped.
  • 12. The system of claim 9 wherein if there is Clock Control Message sequence violation condition, message passing to the following processing levels is discontinued, until it is determined that received messages have arrived in correct sequence.
  • 13. The system of claim 8 wherein said Envelope Set Building Block Algorithm comprises the building of a sample envelope curve, wherein all sample phase error points lie essentially on or above said sample envelope curve.
  • 14. The system of claim 8 wherein said Envelope Set Building Block Algorithm comprises the building of a sample envelope curve with a concave (bath tub) shape,
  • 15. The system of claim 8 wherein said Envelope Set Building Block Algorithm comprises the building of a sample envelope curve with a monotonically increasing slope,
  • 16. The system of claim 8 wherein said Envelope Set Building Block Algorithm has sample points that are a function of the time the sample was received (x-coordinate), and sample value (phase error) (y-coordinate).
  • 17. The system of claim 8 wherein said sample envelope curve is built by an iterative process.
  • 18. The system of claim 8 wherein the slope of the longest sample envelope segment that joins consecutive sample points approximates the difference in said transmitting means and receiver means clock speed (frequency error).
  • 19. The system of claim 8 wherein the slope of the longest sample envelope segment that joins consecutive sample points can be used to estimate the clock difference (phase error).
  • 20. A method for clock recovery and synchronization of a wireless streamed multimedia signal between a media source and a display device in a system, wherein said system comprises a transmitting means in functional contact with said media source, and a receiving means in functional contact with said display device, and wherein clock synchronization is maintained between said transmitting means and said receiving means through the use of an algorithm and a series of first time stamped signals and a series of second time stamped signals generated by said transmitting means for the proper encoding and decoding of said multimedia signal; and wherein said series of first time stamped signals and said second series of time stamped signals are separate from the synchronization signals that are part of said multimedia signal; andwherein said algorithm determines clock frequency and clock phase error; andwherein said algorithm is based on Envelope Set Building.
  • 21. The method of claim 20 wherein said multimedia signal is compressed in the MPEG-2 Transport Stream standard.
  • 22. The method of claim 20 wherein said Envelope Set Building Block Algorithm comprises the building of a sample envelope curve, wherein all sample phase error points lie essentially on or above said sample envelope curve.
  • 23. The method of claim 20 wherein said Envelope Set Building Block Algorithm comprises the building of a sample envelope curve with a concave (bath tub) shape,
  • 24. The method of claim 20 wherein said Envelope Set Building Block Algorithm has sample points that are a function of the time the sample was received (x-coordinate), and sample value (phase error) (y-coordinate).
  • 25. The method of claim 20 wherein said sample envelope curve is built by an iterative process.
  • 26. The method of claim 20 wherein said sample envelope curve has a monotonically increasing slope.
  • 27. The method of claim 20 wherein the slope of the longest sample envelope segment that joins consecutive sample envelope points approximates the difference in said transmitter and receiver clocks speed (frequency error).
  • 28. The method of claim 20 wherein the slope of the longest sample envelope segment that joins consecutive sample envelope points can be used to estimate the clock difference (phase error).
  • 29. The method of claim 20 wherein said Envelope Set Building Block Algorithm uses a plurality of envelope sets.
  • 30. A method to minimize jitter in a system that wirelessly streams a multimedia signal between a media source and a display device, wherein said system comprises a transmitting means in functional contact with said media source, and a receiving means in functional contact with said display device, and wherein said method comprises: using special timestamp packets; andmeans for providing higher priority to said special timestamp packets at said transmitting means than other packets of said multimedia signal.
  • 31. The method of claim 30 further comprising fast interrupt processing at said receiving means of said special timestamp packets that reduces jitter in said system.
  • 32. The method of claim 30 wherein said special timestamp packet is prepared in advance, however the actual value of said timestamp is inserted into said special timestamp packet only upon transmission by said transmitting means.
  • 33. The method of claim 30 wherein when there are no packets of said multimedia signal to be transmitted by said transmitter, said special timestamp packet is prepared and sent by said transmitting means.
  • 34. The method of claim 30 wherein whenever said special timestamp packet is prepared, said special timestamp packet is given priority so that it will be transmitted before any other packet that may already be waiting to be transmitted.
  • 35. The method of claim 30 wherein said transmitting means further comprises a plurality of transmit queues; and wherein said method further comprises providing a special transmit queue for said special timestamp packets; andwherein said special transmit queue is assigned a higher priority than some of the other transmit queues in said plurality of transmit queues.
  • 36. The method of claim 30 wherein there is no retransmission of said special timestamp packets that are not received by said receiver means.