Re: [Discuss-gnuradio] Problems using gnuradio blocks

2009-05-25 Thread Eric Blossom
On Mon, May 25, 2009 at 09:34:51PM +0300, Alysson Menezes wrote:
> 
> Hello everybody. I was trying to use the gnuradio complex_to_float
> () block just to understand its functioning. Unfortunately, the
> conversion not happened and apparently there was no problem. The
> code is below. What's the problem with this so simple code?

Hi Alysson,

I've attach a modified version of your code that works with GNU Radio
3.1 and 3.2.  I suggest that you try using the 3.2 release.

If you happen to be running Ubuntu 9.04 (Jaunty) you can download
prebuilt binaries:

  http://gnuradio.org/trac/wiki/DebianPackages

Otherwise, please download the source and build it:

  http://gnuradio.org/trac/wiki/Download
  http://gnuradio.org/trac/wiki/BuildGuid


> One more thing, it would be so helpful a dictionary with all the
> gnuradio blocks and usage examples. Examples are fundamental to help
> us reach a good level to be able to contribute for the gnuradio
> project, without waste so much time. Thank you very much.

http://gnuradio.org/doc/doxygen/index.html
http://gnuradio.org/doc/doxygen/modules.html

There are many examples, see

  gnuradio-examples/python/*/*


If you haven't already, please take a look at

  http://gnuradio.org/trac/wiki
  http://gnuradio.org/trac/wiki/ReportingErrors

Welcome!
Eric
#!/usr/bin/env python

from gnuradio import gr, eng_notation, gru, window, blks2
from gnuradio import audio
from gnuradio import usrp
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from gnuradio import gr_unittest


class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
self.data = (1+2j, 3+4j, 5+6j)
self.src = gr.vector_source_c (self.data)
self.converte = gr.complex_to_float()
self.re_sink = gr.vector_sink_f ()
self.im_sink = gr.vector_sink_f ()
self.connect (self.src, (self.converte,0))
self.connect ((self.converte,0), self.re_sink)
self.connect((self.converte,1), self.im_sink)

if __name__ == '__main__' :
tb = my_top_block()
try:
tb.run()
except KeyboardInterrupt:
pass

print "src data: ", tb.data
print "real: ", tb.re_sink.data()
print "imag: ", tb.im_sink.data()


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Problems using gnuradio blocks

2009-05-25 Thread Alysson Menezes


Hello everybody. I was trying to use the gnuradio complex_to_float 
() block just to understand its functioning. Unfortunately, the conversion not 
happened and apparently there was no problem. The code is below. What's the 
problem with this so simple code?
One more thing, it would be so helpful a dictionary with all the 
gnuradio blocks and usage examples. Examples are fundamental to help us reach a 
good level to be able to contribute for the gnuradio project, without waste so 
much time. Thank you very much. 

#!/usr/bin/env python

from gnuradio import gr, eng_notation, gru, window, blks
from gnuradio import audio
from gnuradio import usrp
from gnuradio.eng_option import eng_option
from optparse import OptionParser
from gnuradio import gr_unittest


class my_graph(gr.flow_graph):

def __init__(self):
gr.flow_graph.__init__(self)

self.data = (1, 2, 3)
self.converte = gr.complex_to_float()
self.src = gr.vector_source_c (self.data)
self.vetor2 = gr.vector_sink_f ()

raw_input (self.data)

self.connect (self.src, (self.converte,0))
self.connect ((self.converte,0), self.vetor2)

self.rst = self.vetor2.data ()

raw_input (self.rst)



if __name__ == '__main__':
try:
my_graph().run()
except KeyboardInterrupt:
pass

--

Alysson Vasconcelos Gomes de Menezes
Graduando em Engenharia Elétrica
Universidade Federal de Campina Grande - www.ufcg.edu.br
Centro de Engenharia Elétrica e Informática - www.ceei.ufcg.edu.br



_
Emoticons e Winks super diferentes para o Messenger. Baixe agora, é grátis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio