# Error in "Constellation Decoder" block

**URL:** <https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563>\
**Category:** GNU Radio\
**Created:** [March 4, 2014, 10:18pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563 "2014-03-04T22:18:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [March 4, 2014, 10:18pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/1 "2014-03-04T22:18:44Z")

</div>

Hi All,

I am manipulating GNU Radio Companion.  
While using the “Constellation Decoder” block, I have put  
_digital.constellation\_qpsk_ as a “Constellation Object” argument. But,  
I  
have found an error when I have executed the flow graph:

_Traceback (most recent call last):_

- File “/users/anb10/metrics/error\_rate.py”, line 342, in \*
- tb = error\_rate()\*
- File “/users/anb10/metrics/error\_rate.py”, line 225, in **init** \*
- self.digital\_constellation\_decoder\_cb\_0 =  
digital.constellation\_decoder\_cb(digital.constellation\_qpsk)\*
- File  
“/usr/lib64/python2.6/site-packages/gnuradio/digital/digital\_swig.py”,  
line  
3096, in constellation\_decoder\_cb\*
- return \_digital\_swig.constellation\_decoder\_cb(\*args, \*_kwargs)_  
_TypeError: in method ‘constellation\_decoder\_cb’, argument 1 of type  
‘digital\_constellation\_sptr’_

I don’t know what went wrong. I have even tried  
_digital.psk.psk\_constellation(m=4,mod\_code=‘gray’)_,  
\*digital.constellation\_8psk \*and  
_digital.psk.psk\_constellation(m=8,mod\_code=‘gray’)_ as a “Constellation  
Object” argument.

So, what is the proper way to define the argument (Constellation Object)  
in  
the “Constellation Decoder” block?

I hope you can give me some ideas. Any help is appreciated. Thank you.  
Regards,  
Azza

---

<div class="post-metadata">

**Author:** ![Azza\_Ben\_Mosbah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Azza\_Ben\_Mosbah](https://www.ruby-forum.com/u/Azza_Ben_Mosbah)\
**Post date:** [March 4, 2014, 11:17pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/2 "2014-03-04T23:17:34Z")

</div>

On Tue, Mar 4, 2014 at 4:17 PM, Azza Ben Mosbah  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> File “/users/anb10/metrics/error\_rate.py”, line 225, in **init**  
> digital.psk.psk\_constellation(m=4,mod\_code=‘gray’),  
> Azza  
> Azza,

Check out the documentation page:

> **[GNU Radio Manual and C++ API Reference: gr::digital::constellation\_decoder\_cb...](https://www.gnuradio.org/doc/doxygen/classgr_1_1digital_1_1constellation __decoder__ cb.html)**

It’s not entirely clear (unless you know to look for it). You want to  
pass the constellation object using the base() parameter to get to the  
parent class. Basically, you’d call it:

digital.constellation\_decoder\_cb(digital.constellation\_qpsk.base())

Tom

---

<div class="post-metadata">

**Author:** ![Azza\_Ben\_Mosbah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Azza\_Ben\_Mosbah](https://www.ruby-forum.com/u/Azza_Ben_Mosbah)\
**Post date:** [March 5, 2014, 3:01pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/3 "2014-03-05T15:01:07Z")

</div>

Tom,

Thank you for the help. But, even that didn’t work.

I tried a different approach. I configured the “Constellation Object”  
block  
with the\* symbol map \*and the _constellation points_. Then, I called it  
in  
the argument of the “Constellation Decoder” block. And it worked.

I am still wondering what is the right way to define a\*  
‘digital\_constellation\_sptr’  
\*type in the “Constellation Decoder” argument without passing by the  
“Constellation  
Object” block.

Regards,  
Azza

---

<div class="post-metadata">

**Author:** ![Azza\_Ben\_Mosbah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Azza\_Ben\_Mosbah](https://www.ruby-forum.com/u/Azza_Ben_Mosbah)\
**Post date:** [March 6, 2014, 5:07pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/4 "2014-03-06T17:07:00Z")

</div>

Thank you.  
Actually, I am doing it in the GRC interface.

When I use the .base(), it returns the following error:

_Param - Constellation Object(constellation):_

- Value “digital.constellation\_qpsk.base()” cannot be evaluated:\*
- ‘function’ object has no attribute ‘base’\*

I don’t know what is the matter. But, maybe, there is some issues with  
my  
GRC version (GNU Radio Companion 3.6.2).

Regards,

* * *

Azza Ben Mosbah

---

<div class="post-metadata">

**Author:** ![Azza\_Ben\_Mosbah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Azza\_Ben\_Mosbah](https://www.ruby-forum.com/u/Azza_Ben_Mosbah)\
**Post date:** [March 6, 2014, 4:56pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/5 "2014-03-06T16:56:03Z")

</div>

On Wed, Mar 5, 2014 at 8:59 AM, Azza Ben Mosbah  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ‘digital\_constellation\_sptr’ type in the “Constellation Decoder” argument  
> without passing by the “Constellation Object” block.
> 
> Regards,  
> Azza

Yes, that Constellation Object in GRC returns the .base()  
automatically for you so that you can pass it to the Constellation  
Decode/Receiver blocks easily.

You really should be able to use the .base() method of those  
constellation blocks this way. Are you in GRC doing this or doing your  
own Python? There could be some issues with GRC properly interpreting  
your casting using base() (which is likely related to why the  
Constellation Objects just return the.base() method for you).

Tom

---

<div class="post-metadata">

**Author:** ![Azza\_Ben\_Mosbah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Azza\_Ben\_Mosbah](https://www.ruby-forum.com/u/Azza_Ben_Mosbah)\
**Post date:** [March 6, 2014, 6:46pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/6 "2014-03-06T18:46:36Z")

</div>

Try changing:  
“digital.constellation\_qpsk.base()”  
to:  
“digital.constellation\_qpsk().base()”

Note the brackets after the constellation\_qpsk constructor.

On Thu, Mar 6, 2014 at 9:05 AM, Azza Ben Mosbah

---

<div class="post-metadata">

**Author:** ![Azza\_Ben\_Mosbah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Azza\_Ben\_Mosbah](https://www.ruby-forum.com/u/Azza_Ben_Mosbah)\
**Post date:** [March 6, 2014, 7:04pm UTC](https://www.ruby-forum.com/t/error-in-constellation-decoder-block/239563/7 "2014-03-06T19:04:13Z")

</div>

Yes, sure.  
Thank you.  
Now it is working.

Regards,

* * *

Azza Ben Mosbah
