Design Article

A New Method for Clock Recovery in MPEG Decoders

Hooman Hassanzadegan and Nima Sarshar

1/15/2002 12:00 AM EST


 

MPEG-2 Background
MPEG-2 is the de facto standard for audio and video compression. The MPEG-2 Systems Layer specifies two mechanisms to multiplex several audio, video, or private-data elementary streams for storage or transmission purposes: Program Stream for error-free environments and Transport Stream for data transmission in error-prone environments. An MPEG-2 Transport stream is a single packetized-format multiplex of several programs each composed of video, audio, or private-data elementary streams that you can modulate and transmit over communication networks.

Several tables defined by the MPEG-2 standard carry Program Specific Information (PSI) on the Transport Stream to demultiplex the stream at the receiver-end. For each transport packet, DTSs (Decoding Time Stamps) and PTSs (Presentation Time Stamps) specify the time instants at which the packet should be decoded and presented respectively. DTSs and PTSs are all referenced to the encoder's STC (System Time Clock), running at 27MHz. Samples of this clock, PCRs, are transmitted by the Transport Stream to the decoder and the reference time is reconstructed by means of these clock samples and a standard PLL (Phase Locked Loop), shown in Figure 1.

Figure 1:  A standard PLL structure

The counter (Figure 1) contains the reconstructed time. The time error, the difference between the counter value and the incoming PCR value, is fed to the LPF whose output controls the instantaneous frequency of the VCO that runs nominally at 27MHz.

Several effects contribute in the degradation of the reconstructed time:

  • The difference between the encoder clock frequency and the free-running frequency of the decoder's STC.
  • The network introduces a significant amount of jitter due to the variations in queuing delays in network switches.
  • The reconstructed time may suffer from the packetization process at the source, which may displace the time stamps within the stream.

You eliminate the first effect at the PLL by inserting a constant term to the input of the VCO. The required system-clock specifications should restrict the frequency variations of the reconstructed clock due to the network jitter and the packetization process, but at the expense of increasing the PLL locking-period. For example, frequency requirements of the NTSC specify a tolerance of ±10Hz around the central subcarrier frequency of 3.579545MHz (which corresponds to ±3ppm) while the corresponding tolerance for PAL signals is ±5Hz around the central subcarrier frequency of 4.433618MHz. You should use these specifications to design the LPF, which accordingly affects the locking-period of the PLL. On the other hand, the VCO should be precise enough to meet the required clock specifications.

In this article, we take a novel and quite different approach to reconstruct the clock time using the PCRs. In our proposed method, a fixed-frequency oscillator is utilized to store the incoming times of the PCRs and the reference clock is reconstructed by finding the LMS (least mean squares) best fit line for the last several hundred PCR values. Since a simple software program can perform the LMS process, you eliminate the need for the LPF and VCO, simplifying implementation of the new method. We also performed a detailed analysis to investigate the effects of the oscillator's inaccuracy on the precision of the recovered time. Computer simulations verify the viability of our proposed method.


LMS Best Fit Clock-Recovery Scheme
Our system is based on the LMS method, which utilizes the PCR values already received to reconstruct the transmitter clock at the receiver. This scheme gives the chance to eliminate the effects of the jitter present on PCR values due to channel noise and delays and buffering concepts both at the transmitter and receiver.

The system consists of a fixed frequency, rather accurate clock at the receiver demultiplexer. The value of this clock is read by receiving every new PCR. The ordered pairs of PCR values and their corresponding values of the fixed clock then perform the LMS Best Fit. The whole algorithm operates as follows:

  • The demultiplexer waits until a new PCR is received.

  • The fixed clock counter is read and its value is stored as the corresponding STC value derived for the new PCR.

  • If no jitter was present in the PCRs received and the fixed clock was exact, the set of the fixed clock values and the PCRs received would exhibit an exact linear relation. However, due to PCR and clock jitter, the points are slightly off a straight line. We propose that LMS best fit, if it applies to these points, resembles the recovered clock at the receiver with the real system clock, although jitter is present on both PCR and fixed clock values. Therefore, the best line passing through N previous (PCR, STC) pairs is calculated.

  • To find the jitter for the latest PCR received, its value is compared with that predicted by LMS Best Fit on the previous values. The difference is the PCR jitter, if enough points are used for the LMS Best Fit process.

  • The next time a PCR is received we repeat the process, now using N prior PCRs.

Assuming fairly general conditions regarding PCR and reference-clock jitter, by increasing the number of LMS points (in other words, increasing the width of the LMS window) you can achieve any degree of accuracy in calculating PCR jitter at the expense of slowing down system response. To further modify system performance, you can use a double LMS scheme. That means at the arrival of the Nth PCR, we predict its value by performing LMS best fit on this PCR and the N-1 previously predicted PCRs. We thus have two sets of PCRs—the first set represents the actual PCR values while the second set represents the predicted PCRs. We can make use of the second set to do the clock-recovery process. Simulations show that using the second set of PCRs to do the clock recovery, we have a much smoother response with lower steady-state error, but with more delay relative to the previous method.


Formulation
We assume that P represents the set of pairs consisting of PCR values and fixed clock values read respectively:

Where Yi is the ith PCR value and Xi is the fixed clock counter value according to the ith PCR received.

For the moment, let's assume that the PCR values have no jitter and examine the effects of fixed-clock inaccuracies on the LMS Best Fit's result. Assume we have got a set P (Equation 1), Y values are noise-free, and X values are noisy. The LMS Best Fit to the set of data in Equation 1 is easily shown to be

Where:

We denote the ideal (jitter-free) value of the reference clock by X' and the zero-mean noise vector by n:

For simplicity, assume bn = 0. A finite value of bn merely corresponds to an overall shift in reference-clock value, which is insignificant. Equation 2 now reads:

Where:

Substituting this into Equation 5 gives us:

Remembering Equation 4, we get:

Where m is the slope we got in the case of no noise, so Y= mX' + b, and is the vector consisting of the mean of vector n:

If we define then you can easily convert Equation 8 to:

Equation 9 is a very appropriate representation of the problem. It states the difference between the ideal slope and that obtained with LMS, in terms of the known vector X and the unknown noise vector n. You can then define a random process as follows: Take N samples of the fixed clock according to N PCRs received and call these samples X. By neglecting high-order terms of n:

Equation 9 defines a process for each N. Let's suppose that PCRs are received in equal times and that X' = (1,2,3,...,N) is the vector of the ideal reference-clock samples. For large N:

Assuming ni is Gaussian and independent, you can readily evaluate the last term in Equation 12 as:

where sc is the standard deviation of the fixed-frequency clock noise and we assume N to be large. Using Equations 12 and 13 we get:

The worst error occurs for the furthest point. In other words, the error process for each N is:

This is the equation for the STD of the error resulted from performing the LMS Best Fit on the last N points received. We can easily calculate the number of LMS points needed to make the error deviation fall within a predefined value of sd:

So far, we have calculated the number of points that are necessary for the LMS scheme in order to recover the ideal transmitter clock within a specified accuracy when the received PCRs are ideal (no jitter), but the reference clock is not accurate. The slope (m) is the ratio of the transmitter clock (27MHz) to that of the reference clock.

Now, let's turn to the real case where the PCRs contain jitter. The above calculations are still valid provided that the reference clock noise is added with PCR noise divided by the slope that, in terms of their STDs, is:

Then, the final form of Equation 16 is:

As an example, if we use a 27MHz fixed clock with 1µs uncertainty and are about to measure the jitter within 200ns error limit in a 27MHz DVB receiver, then, N = 84(5)²(1)² = 2100 points are needed to do the LMS Best Fit.


Simulating the LMS Best Fit Method
We used MATLAB software and the Simulink toolbox to perform the simulations. We used the jitter model in the simulations as shown in Figure 2.

Figure 2:  System used for simulation

A random value is added to the PCR value generated in the PCR Generation block to indicate the jitter. In the simulations, the time spacing between every two consecutive PCRs is 0.1 sec., which is the minimum PCR rate mentioned in the MPEG specifications.

Figure 3:  The X axis is the number of PCRs used for the LMS process, while the Y axis is the recovery error in units of 1/27MHz. The jitter present on the PCRs was a normal one with zero mean and STD=1e-6. The red graph shows the result for normal LMS, while the blue line is the result of double LMS.

The difference between the jitter-free time and the reconstructed time is displayed in Figure 3, which shows the system has been locked after receiving approximately 2000 PCRs. This is well in accordance with the 2100 theoretically calculated. Figure 3 also displays the response for the two-level LMS method. The recovered time for the double LMS method is smoother and the time-error is less than that of the single LMS method. However, the locking period increases from approximately 2000 to 3000 PCRs with the double LMS method.





Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)

Feedback Form