DSPRelated.com
Forums

Gardner Timing Error Detector - Loop Filter

Started by Gracchus July 10, 2013
Hi!

I'm simulating a burst QPSK modulation and demodulation through a canal
with distortion and additive white Gaussian noise.

Thus far everything is going as planned and I can retrieve the data.

I've decided to implement a gardner timing error detector in order to
compensate for some very small clock drift. So I've read some documentation
and I now compute the Gardner TED error.

But in every book I read the next thing to do after computing the error is
to filter it using a "Loop Filter". Alas I've not yet read a book that
would explain how to design this loop filter.

I should mention that I tried to read "Phase Locked Loops for Wireless
Communications" by Donald R. Stephens but I got lost and felt like it was
more theoretical than anything else.

Basically any help or indication on where to search/what to read would be
very much appreciated!

	 

_____________________________		
Posted through www.DSPRelated.com
On Wed, 10 Jul 2013 11:29:00 -0500, Gracchus wrote:

> Hi! > > I'm simulating a burst QPSK modulation and demodulation through a canal > with distortion and additive white Gaussian noise.
I know you mean "channel", and I'm sorry to tease -- but QPSK through a canal would be interesting. Do the boats rock?
> Thus far everything is going as planned and I can retrieve the data. > > I've decided to implement a gardner timing error detector in order to > compensate for some very small clock drift. So I've read some > documentation and I now compute the Gardner TED error. > > But in every book I read the next thing to do after computing the error > is to filter it using a "Loop Filter". Alas I've not yet read a book > that would explain how to design this loop filter. > > I should mention that I tried to read "Phase Locked Loops for Wireless > Communications" by Donald R. Stephens but I got lost and felt like it > was more theoretical than anything else. > > Basically any help or indication on where to search/what to read would > be very much appreciated!
Are you reading Gardner's PLL book? It should say. What you are doing is making a phase locked loop (PLL). A PLL is a closed-loop control system with a phase detector of some sort (a timing error detector in your case) that supplies information about the error between the local oscillator and the remote timing reference, a local oscillator, and a controller in between that steers the local oscillator to minimize the phase (or timing) error. That controller, in PLL parlance, is called the "loop filter". I good book on PLL theory should say how to design the loop filter. There's a lot that goes into it when you're recovering timing, but things can be simplified. At minimum your loop filter can just be a fixed gain from the timing error to the local oscillator's frequency command input. Worst case you'll want to have low-pass filtering, a fixed gain, and an integrator. Most PLL's probably just have a proportional-integral loop filter, or possibly a proportional term and a leaky integrator, to keep the loop from wandering far when there is no signal. I don't know what book to recommend -- I have a very nice book that's written by and for confirmed analog circuit designers, that doesn't even admit to the possibility of digital signal processing. When I need to make an old-style PLL in software, I just pull out that book and translate to DSP in my head -- but that's probably not a good approach for anyone but me, if it's even a good approach for me. The book is Dan Wolavar, "Phase Locked Loop Circuit Design". I can't remember the publisher, but a search on "Wolavar" and "Phase locked loop" should cough up references. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Wed, 10 Jul 2013 11:29:00 -0500, "Gracchus" <98125@dsprelated>
wrote:

>Hi! > >I'm simulating a burst QPSK modulation and demodulation through a canal >with distortion and additive white Gaussian noise. > >Thus far everything is going as planned and I can retrieve the data. > >I've decided to implement a gardner timing error detector in order to >compensate for some very small clock drift. So I've read some documentation >and I now compute the Gardner TED error. > >But in every book I read the next thing to do after computing the error is >to filter it using a "Loop Filter". Alas I've not yet read a book that >would explain how to design this loop filter. > >I should mention that I tried to read "Phase Locked Loops for Wireless >Communications" by Donald R. Stephens but I got lost and felt like it was >more theoretical than anything else. > >Basically any help or indication on where to search/what to read would be >very much appreciated!
Gardner's PLL book is also very good, but also not necessarily the easiest to read or learn how to do an application from. Some other good search terms are "clock recovery" or "clock recovery loop" or even "Costas loop". As Tim mentioned, you're basically trying to design a 2nd-order (usually) Phase-Locked Loop using the TED that you have as the phase detector. This presentation may be useful to you and goes into some detail regarding implementation: http://www.compdsp.com/presentations/Jacobsen/abineau_dpll_analysis.pdf Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
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.
> I know you mean "channel", and I'm sorry to tease -- but QPSK through a > canal would be interesting. Do the boats rock?
Might be a language thing. "Kanal" in German means "canal" and "channel".
Kevin Neilson <kevin.neilson@xilinx.com> writes:

> 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.
Nice paper, Kevin. Sufficient theory but also to the point. Cool stuff. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
I'm not taking any credit.  I found it when I was doing research recently.  In my notes I summarized the process of making a PI loop filter in one page.  I need to post it somewhere for all the poor souls getting swamped by Laplace theory when all they want is a PLL that doesn't oscillate wildly.
On Wed, 10 Jul 2013 10:42:55 -0700, Kevin Neilson wrote:

>> I know you mean "channel", and I'm sorry to tease -- but QPSK through a >> canal would be interesting. Do the boats rock? > > Might be a language thing. "Kanal" in German means "canal" and > "channel".
I know. I shouldn't have said anything -- but I had this image of communication via waves on a canal, at 1/10th baud or something. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
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. I haven't read the paper, so it may all be covered. But read it carefully! -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
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.
>I haven't read the paper, so it may all be covered. But read it >carefully! > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com >
Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com