# Clock Recovery MM

**URL:** <https://www.ruby-forum.com/t/clock-recovery-mm/231950>\
**Category:** GNU Radio\
**Created:** [September 8, 2014, 11:50pm UTC](https://www.ruby-forum.com/t/clock-recovery-mm/231950 "2014-09-08T23:50:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 8, 2014, 11:50pm UTC](https://www.ruby-forum.com/t/clock-recovery-mm/231950/1 "2014-09-08T23:50:39Z")

</div>

Hi all,

looking at the clock recovery MM code, I wonder if  
d\_omega\_relative\_limit is a relative or absolute deviation from d\_omega.

Here it looks like absolute  
[https://github.com/gnuradio/gnuradio/blob/next/gr-digital/lib/clock\_recovery\_mm\_ff\_impl.cc#L107](https://github.com/gnuradio/gnuradio/blob/next/gr-digital/lib/clock_recovery_mm_ff_impl.cc#L107)

Here it is relative  
[https://github.com/gnuradio/gnuradio/blob/next/gr-digital/lib/clock\_recovery\_mm\_ff\_impl.h#L57](https://github.com/gnuradio/gnuradio/blob/next/gr-digital/lib/clock_recovery_mm_ff_impl.h#L57)

(even though this code has no impact since d\_{min,max}\_omega is not  
used.)

I dont have access to the book linked in the docs atm.

Best,  
Bastian

---

<div class="post-metadata">

**Author:** ![Bastian\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/35a633/32.png) [@Bastian\_B](https://www.ruby-forum.com/u/Bastian_B)\
**Post date:** [September 9, 2014, 3:44pm UTC](https://www.ruby-forum.com/t/clock-recovery-mm/231950/2 "2014-09-09T15:44:29Z")

</div>

On Mon, Sep 8, 2014 at 5:49 PM, Bastian B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 

[https://github.com/gnuradio/gnuradio/blob/next/gr-digital/lib/clock\_recovery\_mm\_ff\_impl.h#L57](https://github.com/gnuradio/gnuradio/blob/next/gr-digital/lib/clock_recovery_mm_ff_impl.h#L57)

> (even though this code has no impact since d\_{min,max}\_omega is not used.)
> 
> I don’t have access to the book linked in the docs atm.
> 
> Best,  
> Bastian

It is supposed to be relative. I’d have to verify the math on that line  
107  
in the .cc file, but it’s supposed to adjust the center position of the  
current omega estimate and then apply the clipping. Then it adds the mid  
point back to get it back to where it’s centered. Try walking through  
that  
line one more time to verify that it’s doing that properly. But yes,  
it’s  
supposed to be relative to the original setting of omega.

Tom

---

<div class="post-metadata">

**Author:** ![Bastian\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/35a633/32.png) [@Bastian\_B](https://www.ruby-forum.com/u/Bastian_B)\
**Post date:** [September 9, 2014, 9:22pm UTC](https://www.ruby-forum.com/t/clock-recovery-mm/231950/3 "2014-09-09T21:22:31Z")

</div>

On 09 Sep 2014, at 15:42, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

So this line asserts that the current (absolute) deviation (d\_mega -  
d\_omega\_mid) is smaller than the maximum allowed absolute deviation  
(d\_omega\_mid \* d\_omega\_relative\_limit). AFAIS, the second argument is  
missing \* d\_omega\_mid.

I will create a patch, then you can check if I got you right.

Bastian
