# Designing a loop filter for software PLL with following known information

Started by October 3, 2011
```Hi,
I want to design a software PLL to correct a frequency offset in a baseband
BPSK signal and after referring to the book Phase Locked Loops by Ronald
Best I understand most of it. I still have questions regarding designing of
the loop filter.

L(s) = tau2*s + 1
___________
tau1*s

The laplace transform of the loop filter is as shown above and I can use
bilinear transform to convert this into a time-domain equation. The
question is how do I design the values of tau2 and tau1 when I have the
following information available to me.

Center frequency = 0Hz (Baseband signal)
Frequency offset can be in the range of +/- 5000Hz.
Sampling frequency = 1MHz.

tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
noise bandwidth with the information that I have?

Thanks
```
```On Mon, 03 Oct 2011 16:36:51 -0500, "johnlovestohate"
<aliatolemiss@n_o_s_p_a_m.gmail.com> wrote:

>Hi,
>I want to design a software PLL to correct a frequency offset in a baseband
>BPSK signal and after referring to the book Phase Locked Loops by Ronald
>Best I understand most of it. I still have questions regarding designing of
>the loop filter.
>
>L(s) = tau2*s + 1
>       ___________
>         tau1*s
>
>The laplace transform of the loop filter is as shown above and I can use
>bilinear transform to convert this into a time-domain equation. The
>question is how do I design the values of tau2 and tau1 when I have the
>following information available to me.
>
>Center frequency = 0Hz (Baseband signal)
>Frequency offset can be in the range of +/- 5000Hz.
>Sampling frequency = 1MHz.
>
>tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
>noise bandwidth with the information that I have?
>
>Thanks

It's kind of the other way around, i.e., the loop noise bandwidth will
be a result of the parameters selected that lead to the implementation
of tau1 and tau2.   You select the damping ratio and loop bandwidth,
which determines tau1 and tau2, and then you can sort out the noise
bandwidth parameter and work it the other way, too.

I haven't looked at Best's book in a long time (I used to borrow
somebody else's copy), but that treatment isn't really very different
than others, e.g., Gardner's.  It could be that Best has specific
definitions for noise BW, etc., in which case it should be
straightforward to work from that.

Do you want a loop to remove frequency offset or a loop to lock the
carrier phase?   You stated that you just want to remove frequency
offset, which you can do with an FLL, but Best's book describes PLLs.
A PLL can also be used to remove frequency offset, but that's sort of
a by-product of its main task.

Setting the loop parameters which lead to tau1 and tau2 will likely be
different depending on whether you want an FLL or PLL.   Generally,
though, picking a damping ratio and loop bandwidth that suits your
task and application will lead to selection of tau1 and tau2 in the
implementation.

Eric Jacobsen
Anchor Hill Communications
www.anchorhill.com
```
```>On Mon, 03 Oct 2011 16:36:51 -0500, "johnlovestohate"
><aliatolemiss@n_o_s_p_a_m.gmail.com> wrote:
>
>>Hi,
>>I want to design a software PLL to correct a frequency offset in a
baseband
>>BPSK signal and after referring to the book Phase Locked Loops by Ronald
>>Best I understand most of it. I still have questions regarding designing
of
>>the loop filter.
>>
>>L(s) = tau2*s + 1
>>       ___________
>>         tau1*s
>>
>>The laplace transform of the loop filter is as shown above and I can use
>>bilinear transform to convert this into a time-domain equation. The
>>question is how do I design the values of tau2 and tau1 when I have the
>>following information available to me.
>>
>>Center frequency = 0Hz (Baseband signal)
>>Frequency offset can be in the range of +/- 5000Hz.
>>Sampling frequency = 1MHz.
>>
>>tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
>>noise bandwidth with the information that I have?
>>
>>Thanks
>
>It's kind of the other way around, i.e., the loop noise bandwidth will
>be a result of the parameters selected that lead to the implementation
>of tau1 and tau2.   You select the damping ratio and loop bandwidth,
>which determines tau1 and tau2, and then you can sort out the noise
>bandwidth parameter and work it the other way, too.

I want to track the carrier phase. So if my offset is in the range
+/-5000Hz, what will the loop bandwidth be? I read somewhere that it should
be at least equal to the maximum frequency content which in my case will be
5000Hz. Am I right?
>
>I haven't looked at Best's book in a long time (I used to borrow
>somebody else's copy), but that treatment isn't really very different
>than others, e.g., Gardner's.  It could be that Best has specific
>definitions for noise BW, etc., in which case it should be
>straightforward to work from that.
>
>Do you want a loop to remove frequency offset or a loop to lock the
>carrier phase?   You stated that you just want to remove frequency
>offset, which you can do with an FLL, but Best's book describes PLLs.
>A PLL can also be used to remove frequency offset, but that's sort of
>a by-product of its main task.
>
>Setting the loop parameters which lead to tau1 and tau2 will likely be
>different depending on whether you want an FLL or PLL.   Generally,
>though, picking a damping ratio and loop bandwidth that suits your
>task and application will lead to selection of tau1 and tau2 in the
>implementation.
>
>
>
>Eric Jacobsen
>Anchor Hill Communications
>www.anchorhill.com
>
```
```On Oct 4, 10:58=A0am, eric.jacob...@ieee.org (Eric Jacobsen) wrote:
> On Mon, 03 Oct 2011 16:36:51 -0500, "johnlovestohate"
>
>
>
> <aliatolemiss@n_o_s_p_a_m.gmail.com> wrote:
> >Hi,
> >I want to design a software PLL to correct a frequency offset in a baseb=
and
> >BPSK signal and after referring to the book Phase Locked Loops by Ronald
> >Best I understand most of it. I still have questions regarding designing=
of
> >the loop filter.
>
> >L(s) =3D tau2*s + 1
> > =A0 =A0 =A0 ___________
> > =A0 =A0 =A0 =A0 tau1*s
>
> >The laplace transform of the loop filter is as shown above and I can use
> >bilinear transform to convert this into a time-domain equation. The
> >question is how do I design the values of tau2 and tau1 when I have the
> >following information available to me.
>
> >Center frequency =3D 0Hz (Baseband signal)
> >Frequency offset can be in the range of +/- 5000Hz.
> >Sampling frequency =3D 1MHz. =A0
>
> >tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
> >noise bandwidth with the information that I have?
>
> >Thanks
>
> It's kind of the other way around, i.e., the loop noise bandwidth will
> be a result of the parameters selected that lead to the implementation
> of tau1 and tau2. =A0 You select the damping ratio and loop bandwidth,
> which determines tau1 and tau2, and then you can sort out the noise
> bandwidth from that. =A0 I suppose you could start with a noise
> bandwidth parameter and work it the other way, too.
>
> I haven't looked at Best's book in a long time (I used to borrow
> somebody else's copy), but that treatment isn't really very different
> than others, e.g., Gardner's. =A0It could be that Best has specific
> definitions for noise BW, etc., in which case it should be
> straightforward to work from that.
>
> Do you want a loop to remove frequency offset or a loop to lock the
> carrier phase? =A0 You stated that you just want to remove frequency
> offset, which you can do with an FLL, but Best's book describes PLLs.
> A PLL can also be used to remove frequency offset, but that's sort of
> a by-product of its main task. =A0
>
> Setting the loop parameters which lead to tau1 and tau2 will likely be
> different depending on whether you want an FLL or PLL. =A0 Generally,
> though, picking a damping ratio and loop bandwidth that suits your
> task and application will lead to selection of tau1 and tau2 in the
> implementation.
>
> Eric Jacobsen
> Anchor Hill Communicationswww.anchorhill.com

I don't. The best way to work out the unity-gain bandwidth is from the
free-running frequency. The max bandwidth is approx 2X this frequency
over 10! This makes the loop fast enough to track and yet not too
large a bandwidth so as to attenuate the 2f feedthrough terms.
Normally I find the parameters of the loop by making it oscillate.
This gives you the gain of the VCO etc. From that you can sketch a
Bode-Plot. I don't believe in all the 2nd order stuff. Better to use a
Bode plot and define phase-margin. So what is your VCO setup to?

Hardy
```
```On Mon, 03 Oct 2011 17:10:12 -0500, "johnlovestohate"
<aliatolemiss@n_o_s_p_a_m.gmail.com> wrote:

>>On Mon, 03 Oct 2011 16:36:51 -0500, "johnlovestohate"
>><aliatolemiss@n_o_s_p_a_m.gmail.com> wrote:
>>
>>>Hi,
>>>I want to design a software PLL to correct a frequency offset in a
>baseband
>>>BPSK signal and after referring to the book Phase Locked Loops by Ronald
>>>Best I understand most of it. I still have questions regarding designing
>of
>>>the loop filter.
>>>
>>>L(s) = tau2*s + 1
>>>       ___________
>>>         tau1*s
>>>
>>>The laplace transform of the loop filter is as shown above and I can use
>>>bilinear transform to convert this into a time-domain equation. The
>>>question is how do I design the values of tau2 and tau1 when I have the
>>>following information available to me.
>>>
>>>Center frequency = 0Hz (Baseband signal)
>>>Frequency offset can be in the range of +/- 5000Hz.
>>>Sampling frequency = 1MHz.
>>>
>>>tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
>>>noise bandwidth with the information that I have?
>>>
>>>Thanks
>>
>>It's kind of the other way around, i.e., the loop noise bandwidth will
>>be a result of the parameters selected that lead to the implementation
>>of tau1 and tau2.   You select the damping ratio and loop bandwidth,
>>which determines tau1 and tau2, and then you can sort out the noise
>>bandwidth parameter and work it the other way, too.
>
>I want to track the carrier phase. So if my offset is in the range
>+/-5000Hz, what will the loop bandwidth be? I read somewhere that it should
>be at least equal to the maximum frequency content which in my case will be
>5000Hz. Am I right?

Much depends on the symbol rate, assuming you update the loop once per
symbol or so.   If the frequency offset is a large fraction of the
symbol rate it's a different problem than if it is a very small
fraction of the symbol rate.  Generally the loop parameters are set to
best perform the task of the loop, in this case tracking carrier
phase.   This is a generally a separate design parameter from the
frequency acquisition capability, of which the loop pull range may
only be a part.

If the frequency offset is larger than the pull range of the loop,
you'll need to do something else to pull the frequency offset within
the pull range.   Opening up the loop parameters solely to increase
the pull range may degrade the performance of the carrier tracking
function.   So there's potentially a tradeoff between managing the
frequency offset correction, the pull range of the loop, and the
carrier phase tracking performance.   Those all depend on how you want
the system to work and what it has to do, so you'll have to answer
those within the context of your project.

There is a lot of literature out there on signal acquisition and
tracking, and BPSK is one of the simpler cases.   You should be able
to find what you need via searches.

Eric Jacobsen
Anchor Hill Communications
www.anchorhill.com
```
```On Oct 3, 2:36&#2013266080;pm, "johnlovestohate"
<aliatolemiss@n_o_s_p_a_m.gmail.com> wrote:
> Hi,
> I want to design a software PLL to correct a frequency offset in a baseband
> BPSK signal and after referring to the book Phase Locked Loops by Ronald
> Best I understand most of it. I still have questions regarding designing of
> the loop filter.
>
> L(s) = tau2*s + 1
> &#2013266080; &#2013266080; &#2013266080; &#2013266080;___________
> &#2013266080; &#2013266080; &#2013266080; &#2013266080; &#2013266080;tau1*s
>
> The laplace transform of the loop filter is as shown above and I can use
> bilinear transform to convert this into a time-domain equation. The
> question is how do I design the values of tau2 and tau1 when I have the
> following information available to me.
>
> Center frequency = 0Hz (Baseband signal)
> Frequency offset can be in the range of +/- 5000Hz.
> Sampling frequency = 1MHz. &#2013266080;
>
> tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
> noise bandwidth with the information that I have?
>
> Thanks

Setting PLL loop bandwidth is always application dependent.

For example if your tracking a dirty short term but stable long term
source you will use a narrow loop, i.e., GPS clock.

If you&#2013266066;re tracking a good short term reference you&#2013266066;ll open up the
bandwidth, i.e., want to transfer good phase noise performance of a
TXCO to a high frequency VCO.

Where you set the cross over point is dictated by your requirements
and the components used, i.e., phase noise.

By definition, in a  PLL system, you are tracking you&#2013266066;re reference
phase if the loop is locked.

Inside the loop bandwidth, you have a lowpass function outside it&#2013266066;s a
highpass function.

Picking the compensation specs, (filter), is a function of the loop
gain and cross over pt, i.e., your chosen bandwidth.

Regards
```
```> Where you set the cross over point is dictated by your requirements
> and the components used, i.e., phase noise.
>

should change -->  "i.e., the phase noise plot of your reference, VCO
and eventual noise profile transfered to the output of your PLL."

>
> Inside the loop bandwidth, you have a lowpass function outside it&#2013266066;s a
> highpass function.
>

should change ---> "highpass function from the VCO outside the loop
bandwidth"

```
```On Mon, 03 Oct 2011 16:36:51 -0500, johnlovestohate wrote:

> Hi,
> I want to design a software PLL to correct a frequency offset in a
> baseband BPSK signal and after referring to the book Phase Locked Loops
> by Ronald Best I understand most of it. I still have questions regarding
> designing of the loop filter.
>
> L(s) = tau2*s + 1
>        ___________
>          tau1*s
>
> The laplace transform of the loop filter is as shown above and I can use
> bilinear transform to convert this into a time-domain equation. The
> question is how do I design the values of tau2 and tau1 when I have the
> following information available to me.
>
> Center frequency = 0Hz (Baseband signal) Frequency offset can be in the
> range of +/- 5000Hz. Sampling frequency = 1MHz.
>
> tau2 and tau1 are dependent upon the noise-bandwidth. How do I set the
> noise bandwidth with the information that I have?

Since you don't have enough information to do a good job, just pick
numbers that look right and run with them.

You would like for your loop bandwidth to be greater than 5000Hz, to
assist in locking to your frequency offset.  But if your SNR is too low
for that then a wide-open loop bandwidth will result in too much carrier
jitter.  What you really need is to know your SNR and the expected
dynamics of the difference between your local reference oscillator and
the carrier frequency of your signal.  If you don't know these absolutely
(which you often don't in a mobile system), then you least need to decide
on design values outside of which you won't guarantee the system to work.

--
www.wescottdesign.com
```
```On Oct 5, 4:19&#2013266080;am, Tim Wescott <t...@seemywebsite.com> wrote:

>
> Since you don't have enough information to do a good job, just pick
> numbers that look right and run with them.
>
Love that - there speaks an engineer!
```
```On Tue, 04 Oct 2011 10:26:17 -0700, HardySpicer wrote:

> On Oct 5, 4:19&nbsp;am, Tim Wescott <t...@seemywebsite.com> wrote:
>
>
>> Since you don't have enough information to do a good job, just pick
>> numbers that look right and run with them.
>>
> Love that - there speaks an engineer!

OK -- you might want to think about how the system is going to perform,
first.

--
www.wescottdesign.com
```