discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Re: max_streams problem in own module


From: Charles Clancy
Subject: [Discuss-gnuradio] Re: max_streams problem in own module
Date: Wed, 2 Mar 2005 10:32:33 -0500 (EST)

Correction -- I'm using gnuradio 2.4, not 2.2 as I mistyped in my previous message. This is on a RHEL-AS3 system.

[ t. charles clancy ]--[ address@hidden ]--[ www.cs.umd.edu/~clancy ]
[ computer science ]-----[ university of maryland | college park ]


On Wed, 2 Mar 2005, Charles Clancy wrote:

I'm trying to write a gnuradio 2.2 module that computes the phase of a complex baseband signal, mostly as a learning excercise in developing a 4-FSK receiver. (Is there an existing module that could do this for me?) I know my installation works, because I've used it for lots of other fun stuff so far.

I have mypkg.i that defines the package and the mypkg_phase_cf class. Then there are the associated mypkg_phase_cf.[cc|h] files defining the class. It all compiles properly using the following:

 CXXFLAGS = -I$(GNURADIO) -I$(GNURADIO)/swig -I$(PYTHON)
 LDFLAGS = -lgnuradio-core -lcppunit -lm -lrt -lpthread

 swig -c++ -python $(CXXFLAGS) -module mypkg -o mypkg.cc mypkg.i
 g++ $(CXXFLAGS) -c mypkg.cc -o mypkg.o
 g++ $(CXXFLAGS) -c mypkg_phase_cf.cc -o mypkg_phase_cf.o

 ar rv _mypkg.la mypkg.o mypkg_phase_cf.o
 ld -shared $(LDFLAGS) -o _mypkg.so -lc mypkg.o mypkg_phase_cf.o

The constructor for mypkg_phase_cf is:

 mypkg_phase_cf::mypkg_phase_cf ()
   : gr_block ( "phase_cf",
                gr_make_io_signature (1,1,sizeof(gr_complex)),
                gr_make_io_signature (1,1,sizeof(float)) ) {}

In my script I have:

 from gnuradio import gr
 from gnuradio import mypkg
 ...
 arctan = mypkg.phase_cf ()
 fg.connect (baseband, arctan)
 fg.connect (arctan, sink)

When I run the script, everything links happily, and I am able to import the package. However, when I get to "fg.connect (baseband, arctan)", I get the following error:

File "/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_graph.py",
 line 180, in _check_port
   if signature.max_streams () == -1: # infinite
 AttributeError: 'str' object has no attribute 'max_streams'

Any ideas?

[ t. charles clancy ]--[ address@hidden ]--[ www.cs.umd.edu/~clancy ]
[ computer science ]-----[ university of maryland | college park ]





reply via email to

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