[use of gr.vector_source_b]


#1

Hello!
What I want to do is coding a string with trellis. This is the code I
wrote.
(…)
f = trellis.fsm(“rita.fsm”)
class my_top_block (gr.top_block):
def init (self):
gr.top_block.init(self)
cadena= ‘asdf’
src = gr.vector_source_b(cadena,False)
tre = trellis.encoder_bb(f,0)
sink_cod_vector = gr.vector_sink_b ()
self.connect(src,tre,sink_cod_vector)
/////*
And this is what I get:
don’t know why I got this message, because I think the use of the
gr.vector_source is ok.
Traceback (most recent call last):
File “./prueba2.py”, line 21, in
my_top_block().run()
File “./prueba2.py”, line 13, in init
src = gr.vector_source_b(cadena,False)
File
“/usr/local/lib/python2.5/site-packages/gnuradio/gr/gnuradio_swig_py_gengen.py”,
line 9306, in vector_source_b
return _gnuradio_swig_py_gengen.vector_source_b(*args)
NotImplementedError: Wrong number of arguments for overloaded function
‘vector_source_b’.
Possible C/C++ prototypes are:
gr_make_vector_source_b(std::vector<unsigned
char,std::allocator > const &,bool,int)
gr_make_vector_source_b(std::vector<unsigned
char,std::allocator > const &,bool)
gr_make_vector_source_b(std::vector<unsigned
char,std::allocator > const &)

I don’t what I’m doing wrong. Can someone help me?

Thanks

View this message in context:
http://www.nabble.com/-use-of-gr.vector_source_b--tp23837912p23837912.html
Sent from the GnuRadio mailing list archive at Nabble.com.


#2

On Tue, Jun 02, 2009 at 11:15:35AM -0700, Rita’s pfc wrote:

Hello!
What I want to do is coding a string with trellis. This is the code I wrote.
(…)
f = trellis.fsm(“rita.fsm”)
class my_top_block (gr.top_block):
def init (self):
gr.top_block.init(self)
cadena= ‘asdf’

Use this instead:

cadena = map(ord, 'asdf')

#3

Thanks Eric.
But now, I want to print, or just simply get into a vector or file the
result of coding. I use the subfunction, vector_sink_x.data() . The code
I
have is:

            s='asdf'
cadena = map(ord, s)
src = gr.vector_source_b(cadena,False)
tre = trellis.encoder_bb(f,0)
sink_cod_vector = gr.vector_sink_b()
sin = gr.file_sink(gr.sizeof_char,"fichero.log")
self.connect(src, tre)
self.connect(tre, sink_cod_vector)
self.connect(tre, sin)
print "...               ", sink_cod_vector.data()
print "datas cod len     ", len(sink_cod_vector.data())

and the output was:

… ()
datas cod len 0

but it creates the file fichero.log whose size is 4 bytes, what is
normal (4
chars to code)

My question is:
is there another way to get the encoded data ?


View this message in context:
http://www.nabble.com/-use-of-gr.vector_source_b--tp23837912p23869249.html
Sent from the GnuRadio mailing list archive at Nabble.com.


#4

Thanks a lot Eric

In the end I could do a small part of what I wanted, at least I have
made
some progress.
It’s very probable that I will have some new troubles…

Thanks again

Eric B. wrote:

            s='asdf'

The vector_sink is empty because you have not yet run the graph.


View this message in context:
http://www.nabble.com/-use-of-gr.vector_source_b--tp23837912p24033480.html
Sent from the GnuRadio mailing list archive at Nabble.com.


#5

On Thu, Jun 04, 2009 at 05:50:03AM -0700, Rita’s pfc wrote:

tre = trellis.encoder_bb(f,0)

… ()
datas cod len 0

but it creates the file fichero.log whose size is 4 bytes, what is normal (4
chars to code)

The vector_sink is empty because you have not yet run the graph.
Take a look at pretty much any of the qa_*.py files for examples.

Eric