discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Manually decoding output from ZMQ PUB Sink


From: Cinaed Simson
Subject: Re: [Discuss-gnuradio] Manually decoding output from ZMQ PUB Sink
Date: Fri, 21 Jul 2017 18:15:48 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/21/2017 06:09 AM, Kjetil Wormnes wrote:
> Hi everyone,
> 
> Firstly, just a disclaimer. I am  particularly familiar with GnuRadio at
> all. However I need to interface with a GnuRadio project.
> 
> I am trying to manually decode the output of a ZMQ PUB Sink. In other
> words, I have, in a completely different non-gnuradio project, a bit of
> code that uses the standard python-zmq library to subscribe to the zmq
> socket.
> 
> 
> The ZMQ PUB Sink block is sitting just before the USRP block in the Tx
> chain. And what I eventually want to do is effectively replicate the
> spectrum display from Gnu Radio in a web app.

The file should have a complex data type.

You should be able to read file using

#!/usr/bin/env python
import scipy
f=scipy.fromfile(open("filename"),dtype=scipy.complex64)
print f,

which will print out a couple of complex values.

If you only want real data, put a Complex to Real block after the tap in
from of the USRP, and change ZMQ PUB SINK to data type float.

I'm assuming the flowgraph is using complex data types and you know how
to read a binary file containing floats.

I didn't download the binary you sent.

-- Cinaed

> 
> In my long google searches someone said the trick to decode things from
> gnuradio is to use the PMT library. Now from what I could see I should
> use pmt.deserialize_string(). However that does not seem to work.
> 
>>>> pmt.deserialize_str(d)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.7/dist-packages/pmt/pmt_swig.py", line 3373, in
> deserialize_str
>     return _pmt_swig.deserialize_str(str)
> RuntimeError: pmt::deserialize: malformed input stream, tag value = : 243
> 
> I thought perhaps there would be an alignment issue, but it doesn't seem
> to matter where (in d) I start the deserialize command.
> 
> By the way, d above is a recording of what I saw come out of that ZMQ
> PUB Sink block. I created a python-zmq socket and connected it to the
> ZMQ Sink Block port and recorded everything.You can find the file here:
> https://www.dropbox.com/s/9r6390lwd3kdc9o/port_5551.bin?dl=1
> 
> Any pointers would be most appreciated. Thanks in advance.
> 
> Kjetil
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]