DSPRelated.com
Forums

Gardner Timing Error Detector - Loop Filter

Started by Gracchus July 10, 2013
On Wed, 10 Jul 2013 18:38:10 +0000, Eric Jacobsen wrote:

> On Wed, 10 Jul 2013 13:01:53 -0500, Tim Wescott > <tim@seemywebsite.really> wrote: > >>On Wed, 10 Jul 2013 10:40:08 -0700, Kevin Neilson wrote: >> >>> The Gardner TED is simple, but it works so well. I sympathize with >>> your efforts making a loop filter, though. It's pretty simple, but >>> most of the literature gets really bogged down in theory and all of >>> the diagrams are in terms of Laplace transforms, none of which helps >>> if you just want to build something now. >>> >>> Look at p. 339 of this doc: http://tinyurl.com/l64wjyt >>> >>> This shows a diagram of the PI (proportional-integral) loop filter you >>> want. It's just a couple of multipliers (which can be shifters in >>> hardware) and an integrator. In your case, the phase detector will be >>> replaced with the Gardner TED, and the output of the loop filter will >>> be connected probably to an NCO/interpolator that determines when to >>> sample the input. >>> >>> You just need to pick K1 and K2 (proportional and integral) loop >>> constants. First you'll pick zeta (this is the squiggly Greek >>> character), which is the damping factor, which you can probably set to >>> 1, and wn, the natural freq, which you can start by setting to about >>> 250 times your sampling freq. After you pick zeta and wn you can get >>> K1,K2. >>> The formulas in the paper will help, but it's not very concise. >> >>Just some caveats: >> >>* You don't want to pick a natural frequency above your sampling rate. >>You want one below your sampling rate. For that matter, you want a >>natural frequency that's well below the symbol rate. >> >>* Be careful when choosing zeta, and when calculating your TED gain. >>Timing error detectors only get valid information when there are >>transitions in the data for them to work from -- so your effective TED >>gain is data dependent. With a proportional-integral loop filter, the >>damping factor goes down as the loop gain goes down. You probably want >>to choose a damping factor that's above 1 for the average TED gain so >>that it won't be too low when timing information is sparse. > > Many TEDs, including Gardner's, put out zero or something close to it > when there's no transition, so using the actual slope of the detector > when it's active is the most accurate way to do the analysis. > > Transitions shouldn't be sparse in a comm system because the loop will > unlock on things like constant ones or zeros, so a scrambler is almost > always used. This makes transition densities high enough that it > should be a non-issue in most systems. > > On the other hand, one thing that does flatten the phase detector > S-curve in a comm system is noise, and if the system has to work at low > SNR the loop characteristics will change as you're describing. How much > the curve flattens is predictable, so it can be taken into account > during design and analysis.
Even in a noise free environment you still have to figure that half the time you won't see a transition, and take that into account in your calculations. I guess if I really had a point that I should have made explicit it's that you have to be careful about just what you choose as a gain for your timing error detector when you go to do your calculations. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On 7/10/2013 2:13 PM, Tim Wescott wrote:
> On Wed, 10 Jul 2013 18:38:10 +0000, Eric Jacobsen wrote: > > Even in a noise free environment you still have to figure that half the > time you won't see a transition, and take that into account in your > calculations.
But, in the unlikely however still probable case of max. transitions at every symbol, the loop should not wind up. And the loop should hold if no transitions at all.
> I guess if I really had a point that I should have made explicit it's > that you have to be careful about just what you choose as a gain for your > timing error detector when you go to do your calculations.
Simple ways to improve that are huge averaging and some sort of data feedback into detector. However since I implemented Kalman algorithm instead of PLL, it worked much better especially in acquisition phase. So I dismissed digital PLLs as remnants of analogue technology. Vladimir Vassilevsky DSP and Mixed Signal Designs www.abvolt.com
On Wed, 10 Jul 2013 14:13:00 -0500, Tim Wescott
<tim@seemywebsite.really> wrote:

>On Wed, 10 Jul 2013 18:38:10 +0000, Eric Jacobsen wrote: > >> On Wed, 10 Jul 2013 13:01:53 -0500, Tim Wescott >> <tim@seemywebsite.really> wrote: >> >>>On Wed, 10 Jul 2013 10:40:08 -0700, Kevin Neilson wrote: >>> >>>> The Gardner TED is simple, but it works so well. I sympathize with >>>> your efforts making a loop filter, though. It's pretty simple, but >>>> most of the literature gets really bogged down in theory and all of >>>> the diagrams are in terms of Laplace transforms, none of which helps >>>> if you just want to build something now. >>>> >>>> Look at p. 339 of this doc: http://tinyurl.com/l64wjyt >>>> >>>> This shows a diagram of the PI (proportional-integral) loop filter you >>>> want. It's just a couple of multipliers (which can be shifters in >>>> hardware) and an integrator. In your case, the phase detector will be >>>> replaced with the Gardner TED, and the output of the loop filter will >>>> be connected probably to an NCO/interpolator that determines when to >>>> sample the input. >>>> >>>> You just need to pick K1 and K2 (proportional and integral) loop >>>> constants. First you'll pick zeta (this is the squiggly Greek >>>> character), which is the damping factor, which you can probably set to >>>> 1, and wn, the natural freq, which you can start by setting to about >>>> 250 times your sampling freq. After you pick zeta and wn you can get >>>> K1,K2. >>>> The formulas in the paper will help, but it's not very concise. >>> >>>Just some caveats: >>> >>>* You don't want to pick a natural frequency above your sampling rate. >>>You want one below your sampling rate. For that matter, you want a >>>natural frequency that's well below the symbol rate. >>> >>>* Be careful when choosing zeta, and when calculating your TED gain. >>>Timing error detectors only get valid information when there are >>>transitions in the data for them to work from -- so your effective TED >>>gain is data dependent. With a proportional-integral loop filter, the >>>damping factor goes down as the loop gain goes down. You probably want >>>to choose a damping factor that's above 1 for the average TED gain so >>>that it won't be too low when timing information is sparse. >> >> Many TEDs, including Gardner's, put out zero or something close to it >> when there's no transition, so using the actual slope of the detector >> when it's active is the most accurate way to do the analysis. >> >> Transitions shouldn't be sparse in a comm system because the loop will >> unlock on things like constant ones or zeros, so a scrambler is almost >> always used. This makes transition densities high enough that it >> should be a non-issue in most systems. >> >> On the other hand, one thing that does flatten the phase detector >> S-curve in a comm system is noise, and if the system has to work at low >> SNR the loop characteristics will change as you're describing. How much >> the curve flattens is predictable, so it can be taken into account >> during design and analysis. > >Even in a noise free environment you still have to figure that half the >time you won't see a transition, and take that into account in your >calculations.
But when there's no transition the phase detector contributes a zero, i.e., a locked signal (or thereabouts), to the loop, so it doesn't perturb it. Using the curve of the detector in the presence of a transition to determine the gain, Kd, results in a loop implementation that behaves consistent with that analysis at high SNR. We typically then apply a safety factor to Kd for the gain change that occurs at low SNR and that bounds the expected loop characteristics so that the loop behaves nicely at all expected SNRs. We've swept loops in the past to verify our analysis techniques and found this to be consistent for timing recovery loops.
>I guess if I really had a point that I should have made explicit it's >that you have to be careful about just what you choose as a gain for your >timing error detector when you go to do your calculations.
That was the a big part of the point of the presentation I linked previously: properly handling Ko and Kd is key, and it includes keeping track of the arithmetic through the loop (i.e., where the binary point lands).
> >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com >
Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
The paper doesn't refer to TEDs specifically, just freq-locking PLLs, so there may be caveats.  The last time I did a Gardner loop I have to admit I tweaked the loop gains the old-fashioned way:  adjusting them in a model until it looked good.  I promised myself I'd be more scientific next time.  To do it right, yes, you have to know the detector gain of the Gardner TED, which you could get from a sim with random data.  I think this is going to be roughly (1/2)*A/2 Volts/radian in the linear region, where A is the amplitude of the real/imag part of a QPSK/QAM symbol in "Volts" and the 1/2 is for the rate of transitions.  It probably depends a little on the rolloff of the shaping filter.
On Wed, 10 Jul 2013 13:58:49 -0700 (PDT), Kevin Neilson
<kevin.neilson@xilinx.com> wrote:

>The paper doesn't refer to TEDs specifically, just freq-locking PLLs, so th= >ere may be caveats. The last time I did a Gardner loop I have to admit I t= >weaked the loop gains the old-fashioned way: adjusting them in a model unt= >il it looked good. I promised myself I'd be more scientific next time. To= > do it right, yes, you have to know the detector gain of the Gardner TED, w= >hich you could get from a sim with random data. I think this is going to b= >e roughly (1/2)*A/2 Volts/radian in the linear region, where A is the ampli= >tude of the real/imag part of a QPSK/QAM symbol in "Volts" and the 1/2 is f= >or the rate of transitions. It probably depends a little on the rolloff of= > the shaping filter.
There are a several possible implementations of Gardner's TED, but for now I'll just point out two. Using si for the current symbol, sl for the next (late) symbol, and sh for the inter-symbol sample: g1 = sh*(sgn(si)-sgn(sl)) and g2 = if(sgn(si)!=sgn(sl), sh*(sgn(si)-sgn(sl)),0) the second forces the output to zero if there is no transition, which makes it consistent with other TEDs like M&M and has the desirable effect of zero output for the no transition case. When we use Gardner's TED we use g2. For the first, using the MSB/rads units described in the presentation linked below (same as previous), the gain is Kd = 1/pi and the second Kd = 1/(2*pi) As mentioned, we usually put a safety factor, sigma, in the denominator that scales the gain down for low SNR operation. This results in a little more damping at high SNR, which is usually okay. You're right that there's some dependence on pulse shape, but unless it's something radical the Kds shown will be close. I have my notes for g2, but not handy for the calc for the gain for g1, or I'd give more detail on the differences. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
> > g2 = if(sgn(si)!=sgn(sl), sh*(sgn(si)-sgn(sl)),0) >
This sounds good, except I think it would only work for BPSK/QPSK, not QAM or 8-PSK.
> >> >> g2 = if(sgn(si)!=sgn(sl), sh*(sgn(si)-sgn(sl)),0) >> > >This sounds good, except I think it would only work for BPSK/QPSK, not QAM
or 8-PSK.
>
That is an example of decision-directed Gardner TED if the modulation is BPSK/QPSK. But I can't see why it shouldn't work for higher order QAM too. Also, the other, non-data-aided version, without taking the signs, might help in that case. Obviously it will have high amount of self noise injected into the loop. _____________________________ Posted through www.DSPRelated.com
On Wed, 10 Jul 2013 16:14:18 -0700 (PDT), Kevin Neilson
<kevin.neilson@xilinx.com> wrote:

> >> >> g2 = if(sgn(si)!=sgn(sl), sh*(sgn(si)-sgn(sl)),0) >> > >This sounds good, except I think it would only work for BPSK/QPSK, not QAM or 8-PSK.
Gardner's detector works for m-PSK/m-QAM, but the gain may change a bit between modulations. As long as the modulation is symmetric around zero the oddball transitions still wind up contributing to the output on average, which is all you need. Often for higher-order modulations only a single sample/symbol is available and M&M is a more suitable detector. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
>On Wed, 10 Jul 2013 16:14:18 -0700 (PDT), Kevin Neilson ><kevin.neilson@xilinx.com> wrote: > >> >>> >>> g2 = if(sgn(si)!=sgn(sl), sh*(sgn(si)-sgn(sl)),0) >>> >> >>This sounds good, except I think it would only work for BPSK/QPSK, not
QAM or 8-PSK.
> >Gardner's detector works for m-PSK/m-QAM, but the gain may change a >bit between modulations. As long as the modulation is symmetric >around zero the oddball transitions still wind up contributing to the >output on average, which is all you need. Often for higher-order >modulations only a single sample/symbol is available and M&M is a more >suitable detector. > > >Eric Jacobsen >Anchor Hill Communications >http://www.anchorhill.com >
Is there any specific logic behind working with only 1 sample/symbol for higher-order QAMs? _____________________________ Posted through www.DSPRelated.com
On Wed, 10 Jul 2013 18:57:55 -0500, "commsignal" <58672@dsprelated>
wrote:

>>On Wed, 10 Jul 2013 16:14:18 -0700 (PDT), Kevin Neilson >><kevin.neilson@xilinx.com> wrote: >> >>> >>>> >>>> g2 = if(sgn(si)!=sgn(sl), sh*(sgn(si)-sgn(sl)),0) >>>> >>> >>>This sounds good, except I think it would only work for BPSK/QPSK, not >QAM or 8-PSK. >> >>Gardner's detector works for m-PSK/m-QAM, but the gain may change a >>bit between modulations. As long as the modulation is symmetric >>around zero the oddball transitions still wind up contributing to the >>output on average, which is all you need. Often for higher-order >>modulations only a single sample/symbol is available and M&M is a more >>suitable detector. >> >> >>Eric Jacobsen >>Anchor Hill Communications >>http://www.anchorhill.com >> > >Is there any specific logic behind working with only 1 sample/symbol for >higher-order QAMs?
There's nothing stopping anyone from using more than 1 sample/symbol if they really want to, but it usually (in my experience) incurs unnecessary complexity. So a system designed with cost and/or power sensitivity in mind may opt to go with 1 sample/symbol, especially if the symbol rate is high. Since higher-order modulations are typically used at reasonable SNRs, there's often not a compelling reason to use more than 1 sample/symbol. Gardner's TED was originally developed for systems where rotational invariance is necessary, i.e., there's no phase lock. That's generally not possible with higher-order modulations. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com