[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Question about inputs and outputs of a block
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Question about inputs and outputs of a block |
Date: |
Tue, 2 Mar 2010 09:44:48 -0800 |
User-agent: |
Mutt/1.5.20 (2009-08-17) |
On Thu, Feb 25, 2010 at 05:35:32PM +0100, address@hidden wrote:
>
>
> >----Messaggio originale----
> >Da: address@hidden
> >Data: 25-feb-2010 15.57
> >A: "address@hidden"<address@hidden>
> >Cc: <address@hidden>
> >Ogg: Re: [Discuss-gnuradio] Question about inputs and outputs of a block
> >
> >On Thu, Feb 25, 2010 at 9:26 AM, address@hidden
> ><address@hidden> wrote:
> >> Hi all,
> >>
> >> I'd like to know if it's possible to create a block with two inputs (or two
> >> outputs) having different sizes.
> >> For example, a block that takes a vector of N numbers on one of its two
> inputs
> >> and a stream (a vector which has only one element) on the other input.
> >> I already tried to create a block with these characteristics, but I failed.
> >> Please tell me if this is possible.
> >>
> >> Best Regards,
> >>
> >> Elettra.
> >
> >Yes, this is possible (in C++ blocks). You will make the IO signature
> >using "gr_make_io_signature2", which takes the standard (min inputs,
> >max inputs) as the first two arguments and the next two arguments are
> >the item sizes for the different inputs/outputs. You can also use
> >"gr_make_io_signature3" or "gr_make_io_signaturev", which takes a
> >vector for the signature to have different stream sizes for any number
> >of ports.
> >
> >We used this extensively in the OFDM code. For example, in
> >gr_ofdm_sampler, on the input, we take in a stream of complex values
> >on input 0 and a stream of characters (that act as flags) on input 1.
> >The IO signature looks like:
> >
> >gr_make_io_signature2 (2, 2, sizeof (gr_complex), sizeof(char))
> >
> >
> >Tom
> >
>
> Thank you Tom, but probably I have not expressed correctly.
> I'd like to create a block that takes as first input a vector of N float and
> as second input only one float.
> Is it possible?
>
> Elettra
gr_make_io_signature2 (2, 2, N*sizeof(float), sizeof(float))
Works in C++ or python mod syntax.
Eric