# Possible bug with PATH/gr-channels/lib/cfo\_model\_impl.h

**URL:** <https://www.ruby-forum.com/t/possible-bug-with-path-gr-channels-lib-cfo-model-impl-h/238971>\
**Category:** GNU Radio\
**Created:** [February 5, 2014, 8:42pm UTC](https://www.ruby-forum.com/t/possible-bug-with-path-gr-channels-lib-cfo-model-impl-h/238971 "2014-02-05T20:42:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [February 5, 2014, 8:42pm UTC](https://www.ruby-forum.com/t/possible-bug-with-path-gr-channels-lib-cfo-model-impl-h/238971/1 "2014-02-05T20:42:43Z")

</div>

Dear All,

I suspect there is a bug in cfo\_model\_impl.h, where calling set\_std\_dev  
to  
set the std\_dev back to 0 causes undesirable effects.

How to reproduce the bug:

a) Standard OFDM TX-RX example in GRC. Connect the TX block to the RX  
block  
through this channel model block.

b) Use a variable slider to control the std\_dev of the CFO model block.

c) Start the flowgraph, with 0 as the initial value of the std\_dev. All  
should be fine.

d) Bump up the std\_dev and observe high packet errors.

e) Drop the std\_dev back to 0. While we expect the packet error rate to  
drop back to 0, but that does not happen.

Reason: The value of d\_cfo might be a high non-zero value. Even though  
we  
drop std\_dev back to 0, d\_cfo remains high, and continues to create CFO.

How to fix it:

In the function set\_std\_dev, reset the value of d\_cfo to 0.

If someone could verify that this is indeed a bug, that would be very  
helpful. Thank you in advance for your help.

Best regards,  
Aditya

---

<div class="post-metadata">

**Author:** ![hungry-fish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a3d4f5/32.png) [@hungry-fish](https://www.ruby-forum.com/u/hungry-fish)\
**Post date:** [February 7, 2014, 3:24pm UTC](https://www.ruby-forum.com/t/possible-bug-with-path-gr-channels-lib-cfo-model-impl-h/238971/2 "2014-02-07T15:24:11Z")

</div>

On Wed, Feb 5, 2014 at 7:40 PM, Aditya D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> b) Use a variable slider to control the std\_dev of the CFO model block.  
> drop std\_dev back to 0, d\_cfo remains high, and continues to create CFO.
> 
> How to fix it:
> 
> In the function set\_std\_dev, reset the value of d\_cfo to 0.
> 
> If someone could verify that this is indeed a bug, that would be very  
> helpful. Thank you in advance for your help.
> 
> Best regards,  
> Aditya

Nope, not a bug. You’re reducing the standard deviation, but the  
actual CFO value is not this value but is adjusted based on it.

I think more of what you are looking for is a direct way to set the  
value of the CFO (or something like a reset() function).

Tom

---

<div class="post-metadata">

**Author:** ![hungry-fish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a3d4f5/32.png) [@hungry-fish](https://www.ruby-forum.com/u/hungry-fish)\
**Post date:** [February 7, 2014, 5:11pm UTC](https://www.ruby-forum.com/t/possible-bug-with-path-gr-channels-lib-cfo-model-impl-h/238971/3 "2014-02-07T17:11:24Z")

</div>

> Nope, not a bug. You’re reducing the standard deviation, but the  
> actual CFO value is not this value but is adjusted based on it.
> 
> I think more of what you are looking for is a direct way to set the  
> value of the CFO (or something like a reset() function).

Hi Tom, thanks for the clarification!

best regards,  
aditya
