discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Constructing a signal processing block


From: Martin Braun (CEL)
Subject: Re: [Discuss-gnuradio] Constructing a signal processing block
Date: Mon, 10 Dec 2012 13:01:59 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Dec 10, 2012 at 10:23:32AM +0000, virgil passas wrote:
> I want to create a signal processing block that it will have variable number 
> of
> inputs/outputs AND variable type of inputs/outputs depending the needs of the
> user. (Example1: 3 inputs/ports [complex,double,int] and the same outputs/
> ports. Example2: 4 inputs/ports [double,double,short,complex]  and the same
> outputs/ports.) My problems are: 

OK, to get this straight:
You can have variable number of inputs/outputs (all of what you're
describing is possible), but you CANNOT change that during runtime.

Also, how would you drive this kind of block? The input data type would
have to change, as well.

What *is* quite common is that the block can serve different data types,
which is configured during instantiation. You must have some kind of
check in the constructor, and then pass different io_signatures
depending on your use case.
In the work() function, run the same check again. All the input_items
pointers are void pointers, after all--so you simply cast them to
whatever you set in the constructor.

>  1. How to create an instance of this block with the appropriate size
>     (gr.sizeof_double + gr.sizeof_complex is ok?)

You need to return different io_signatures depending on your config.
Read these:
http://gnuradio.org/doc/doxygen/gr__io__signature_8h.html
http://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials

>  2. In function work() how to define the different type of inputs (every time
>     that the block is called the type of inputs will be different) before
>     passing them to the function that I want.

See above.

>  3. How to connect in python two or more blocks to a third block.

This is the same as usual, and is covered in the tutorials.

MB

-- 
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

Attachment: pgpyZRMrrhA1x.pgp
Description: PGP signature


reply via email to

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