discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Vector average with decimate block


From: Glen I Langston
Subject: Re: [Discuss-gnuradio] Vector average with decimate block
Date: Thu, 15 Mar 2018 18:19:49 -0400

Hi Marcus,

Thanks for your suggestion.   I was wandering around lost because I thought
input_items[0] was a list of vectors.  Your hint made me realize it
is a list of inputs.

The list of vectors are accessed with

in0 = input_items[0]

To get an individual vector we need two steps 

nv = len(in0)

to get the number of vectors and

for i in range(nv):
        v = in0[i]

…

This is really, really not obvious in the guides (to me anyway).

The qa_vav test now passes

Now to make the block callable in grc …

Thanks again,

Glen

Attachment: qa_vave.py
Description: Text Data

Attachment: vave.py
Description: Text Data



> On Mar 15, 2018, at 4:32 PM, Müller, Marcus (CEL) <address@hidden> wrote:
> 
> Hi Glen, 
> 
> you can't be a complete failure. Else you wouldn't be part of this
> community :) and you very certainly wouldn't be writing GNU Radio
> blocks after only four weeks!
> 
> Quick look at your work:
> 
>        out = output_items[0]
>        # get the number of input vectors
>        n = len( input_items)
>        print 'Number of work input vectors: ',n
> 
> hey, what's good for output_items is good for input_items, too!
> Point I'm trying to make: "output_items" is in the end a container of
> all output streams; remember, blocks can have multiple output streams.
> You have exactly one, so you take that by saying 
> out = output_items[0]
> 
> Same goes for input_items; you want the first one, so use
> input_items[0] instead of input_items.
> 
> Hope that helps a bit!
> 
> Best regards,
> Marcus
> 
> On Thu, 2018-03-15 at 16:23 -0400, Glen I Langston wrote:
>> Hello GnuRadio fans,
>> 
>> I’m afraid I’m a complete failure at creating my own vector average
>> with decimate block.  This is my 4th week at this endeavor...
>> 
>> I’ve run through a number of c++ and python web examples and each time am 
>> getting
>> hung up somewhere.
>> 
>> I’ve been following the examples from many gnu radio 
>> web sites and trying to get them to complete
>> 
>> Including:
>> https://wiki.gnuradio.org/index.php/OutOfTreeModules
>> 
>> I got the C++ example to work but could not get the python qa test to pass.
>> 
>> In any case, the vector average with decimate must be an easy example
>> but I can not get the qa part to work.
>> 
>> Is there anyone out there who could create the very rudimentary
>> vector average with decimate that they could share?
>> 
>> Please find my code attached.  The python part is simple. 
>> The QA part is not running yet.
>> 
>> I’ve started with:
>> 
>> gr_modtool create vave
>> cd gr-vave
>> gr_modtool add -t decimator -l python vave  
>> 
>> 
>> 
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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