discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] PMT to Float32


From: Luis Felipe Albarracin Sanchez
Subject: [Discuss-gnuradio] PMT to Float32
Date: Thu, 27 Dec 2018 22:20:24 -0500

Hello all,

I am trying to create an OOT take a value from a Blob type in GNU Radio, and put it out on an output as Float Data type, I have tried the following:

x = pmt.dict_ref (pmt.car(msg), y, pmt.from_double(100)) #this is suppose to take "y" and make "x" equals the value of "y"
z = pmt.to_double(x) #this is suppose to make z the double value of x (which is PMT still)
self.a = numpy.float32(z) # this makes the double to a float 32
.
.
.
def work(self, input_items, output_items):
   in0 = input_items[0]
   out0 = output_items[0]

   out[:] =self.a
return len(output_items[0])

I have tried this but it does not work, when i connect it to a "number sink" in a flowgraph it shows an error , saying that the output of my "new block" is length 8 and the input of the "number sink" is 4.

Can anyone please help me, to find what is the problem?

Also, if there are any examples or blocks in GIT created to convert Blobs to float or to INT, I would appreciate it.

Once again thanks.

Kind regards. 

reply via email to

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