I am trying to connect a block that (written in cpp) and outputs a gr_complex value, to a block (written in python) that uses a numpy.complex as input.
I get the following error,
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/runtime_swig.py", line 4569, in primitive_connect return _runtime_swig.top_block_sptr_primitive_connect(self, *args) ValueError: itemsize mismatch: ofdm_sync_long0:0 using 8, gen_diff_fft_win0:0 using 16
sizeof(gr_complex) is 8 bytes and sys.getsize(numpy.complex) returns 32 bytes. Could this be the reason for the error ?
Is it possible to use gr_complex type in python ? It would be easier for me to make changes in the python block as opposed to the CPP block.
Use numpy.complex64 as dtype instead; that's the native type identical to gr_complex (which is a complex composed of two 32 bit floats).