# Modifying C++ Files

**URL:** <https://www.ruby-forum.com/t/modifying-c-files/218746>\
**Category:** GNU Radio\
**Created:** [April 10, 2012, 8:35pm UTC](https://www.ruby-forum.com/t/modifying-c-files/218746 "2012-04-10T20:35:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 10, 2012, 8:35pm UTC](https://www.ruby-forum.com/t/modifying-c-files/218746/1 "2012-04-10T20:35:13Z")

</div>

Hello,

I am attempting to modify the bpsk.py file in order to obtain OOK  
modulation. I would like to change my constellation points to 1+0i and  
0+0i.  
I understand that the digital\_costellation.cc file is being used to set  
these parameters. I have tried to modify the digitial\_constellation.cc  
file  
in the gr-digital folder, but I am not able to see any changes. I have  
made  
sure that I make and make install every time I change the file. I was  
hoping  
someone could tell me what I am doing wrong. I would greatly appreciate  
any  
help or advice that anyone could give me. Thank you for your time and  
help.

Sam

–  
View this message in context:  
[http://old.nabble.com/Modifying-C%2B%2B-Files-tp33663518p33663518.html](http://old.nabble.com/Modifying-C%2B%2B-Files-tp33663518p33663518.html)  
Sent from the GnuRadio mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![sibar002](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sibar002](https://www.ruby-forum.com/u/sibar002)\
**Post date:** [April 11, 2012, 4:10am UTC](https://www.ruby-forum.com/t/modifying-c-files/218746/2 "2012-04-11T04:10:46Z")

</div>

Hi Sam,

In bpsk.py you’ll see the line

constellation = digital\_swig.constellation\_bpsk()

If you change this to:

constellation = digital.constellation\_calcdist((1+0i, 0+0i), [], 1, 1)

, you should get the change in modulation you want.

You only need to mess with the digital\_constellation.cc file if you  
want to implement an efficient non-generic  
decision maker for this modulation.

To know why what you’re doing isn’t working, I’d need to know what  
modifications you’re making to the .cc file. It sounds like you’re  
doing everything right.

Cheers,  
Ben

---

<div class="post-metadata">

**Author:** ![sibar002](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sibar002](https://www.ruby-forum.com/u/sibar002)\
**Post date:** [April 12, 2012, 12:31am UTC](https://www.ruby-forum.com/t/modifying-c-files/218746/3 "2012-04-12T00:31:02Z")

</div>

Hello Ben,

Thank you for your help. I was able to get the result I wanted with  
the line of code you suggested. I was changing d\_constellation[0] =  
gr\_complex(-1,0) to d\_constellation[0]= gr\_complex(0,0). In order to  
demodulate my signal, I should be able to make the same change in the  
demodulator part of the code, correct? Thank you very much for your help  
and time.

Thanks  
Sam

---

<div class="post-metadata">

**Author:** ![sibar002](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sibar002](https://www.ruby-forum.com/u/sibar002)\
**Post date:** [April 12, 2012, 5:33am UTC](https://www.ruby-forum.com/t/modifying-c-files/218746/4 "2012-04-12T05:33:31Z")

</div>

On Wed, Apr 11, 2012 at 3:29 PM, Samuel I. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello Ben,
> 
> Thank you for your help. I was able to get the result I wantedwith theline  
> of code you suggested. I was changing d\_constellation[0] = gr\_complex(-1,0)  
> to d\_constellation[0]= gr\_complex(0,0). In order to demodulate my signal,I  
> should be able to make the same change in the demodulator part of the code,  
> correct?

Yes.

On the off chance that you decide you want to edit the  
digital\_constellation.cc file (rather than using the generic  
constellation\_calcdist) make sure that you also edit the  
decision\_maker method.
