# ValueError: operands could not be broadcast together with shapes (4095) (4081)

**URL:** <https://www.ruby-forum.com/t/valueerror-operands-could-not-be-broadcast-together-with-shapes-4095-4081/238963>\
**Category:** GNU Radio\
**Created:** [February 5, 2014, 7:00pm UTC](https://www.ruby-forum.com/t/valueerror-operands-could-not-be-broadcast-together-with-shapes-4095-4081/238963 "2014-02-05T19:00:26Z")\
**Posts on this page:** 2\
**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:** [February 5, 2014, 7:00pm UTC](https://www.ruby-forum.com/t/valueerror-operands-could-not-be-broadcast-together-with-shapes-4095-4081/238963/1 "2014-02-05T19:00:26Z")

</div>

Hi everybody,

I am also facing this problem. I am running a GMSK modulation and  
sometimes  
I get the error:

Exception in thread Thread-915:  
Traceback (most recent call last):  
File “/usr/lib/python2.7/threading.py”, line 808, in \_\_bootstrap\_inner  
self.run()  
File “/usr/lib/python2.7/site-packages/grc\_gnuradio/blks2/packet.py”,  
line 144, in run  
ok, payload = packet\_utils.unmake\_packet(msg.to\_string(),  
int(msg.arg1()))  
File  
“/usr/lib/python2.7/site-packages/gnuradio/digital/packet\_utils.py”,  
line 187, in unmake\_packet  
payload\_with\_crc = dewhiten(whitened\_payload\_with\_crc,  
whitener\_offset)  
File  
“/usr/lib/python2.7/site-packages/gnuradio/digital/packet\_utils.py”,  
line 95, in dewhiten  
return whiten(s, o) # self inverse  
File  
“/usr/lib/python2.7/site-packages/gnuradio/digital/packet\_utils.py”,  
line 91, in whiten  
z = sa ^ random\_mask\_vec8[o:len(sa)+o]  
ValueError: operands could not be broadcast together with shapes (4095)  
(4081)

I really dont know what could be happening. What I have realize is that  
everytime this happens, even though the code keeps running, the flow  
does  
not keep working as is suposed to.

Any idea???  
Thanks

---

<div class="post-metadata">

**Author:** ![Mauricio\_Olivera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@Mauricio\_Olivera](https://www.ruby-forum.com/u/Mauricio_Olivera)\
**Post date:** [February 6, 2014, 11:20am UTC](https://www.ruby-forum.com/t/valueerror-operands-could-not-be-broadcast-together-with-shapes-4095-4081/238963/2 "2014-02-06T11:20:12Z")

</div>

On Wed, Feb 5, 2014 at 5:59 PM, Mauricio Olivera  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 144, in run  
> z = sa ^ random\_mask\_vec8[o:len(sa)+o]  
> ValueError: operands could not be broadcast together with shapes (4095)  
> (4081)
> 
> I really dont know what could be happening. What I have realize is that  
> everytime this happens, even though the code keeps running, the flow does  
> not keep working as is suposed to.
> 
> Any idea???  
> Thanks

My guess would be that there is some data corruption that’s causing  
the size of the packet to become skewed. The code isn’t properly  
checking for that condition, which should be considered a packet error  
and dropped, and instead trying to process it like it was correct. You  
can try a “try/catch” block around this call to the whitener to catch  
that exception and ignore it.

Though really, there should be more robust error handling in these  
things, anyways.

Tom
