discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Trouble decimating after averaging 4 vectors? Hel


From: Jeff Long
Subject: Re: [Discuss-gnuradio] Trouble decimating after averaging 4 vectors? Help?
Date: Sun, 11 Mar 2018 16:23:34 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

You are already telling GR that you are decimating (nave in decim_block init). BTW, you are setting self.nave to 0 in init, instead of using the value passed in.

GR should always give you a multiple of 4 vectors (I think) since you've specified a decim of 4.

On 03/11/2018 04:03 PM, Glen I Langston wrote:
Thanks Jeff,

I’ll give that a try.

I think I’m also missing something that tells gnu radio what the expected 
decimation is (?),
beyond the decimate = 4 parameter(?).

Also concerning your point, then if I have a non-multiple of 4 vectors I guess 
I need
to keep the sum and count, but I guess that is already a part of the code.

Best regards

Glen




On Mar 11, 2018, at 3:54 PM, Jeff Long <address@hidden> wrote:

in[0] is not the first vector, it is all of the available input for port 0. So, 
you feed in 4 vectors in your test program, and the shape of in[0] is (4,1024). 
You're missing a loop that iterates over the input vectors.

On 03/11/2018 02:06 PM, Glen I Langston wrote:
Hello Gnuradio experts,
I'm following the gnuradio tutorial for creating an out of tree python block.
My intention is fairly simple.  To have a input stream of 4 vectors
and average these 4 vectors, outputting a single average vector
after the 4th vector arrives.  Right now my vectors are 1024 channel
total power spectra.
My code is attached, along with the quality control code.
I've been at this for a while, but I must have the wrong model
in my head on how gnuradio holds these samples.
I'm not getting the proper size matches.   I can not find any
decimation help, despite hours of googling...
Suggestions?
THanks
Glen
My intention is to make this 4 vector average with decimate a
part of the .grc environment, but the problems are easier to diagnose,
as the QA code is stands alone.   Here are the messages I’m getting:
ESMU:vdecimate glangsto$ python qa_vdecimate.py
handler caught exception: could not broadcast input array from shape (4,1024) 
into shape (1,1024)
Traceback (most recent call last):
   File 
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/gr/gateway.py",
 line 55, in eval
     try: self._callback()
   File 
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/gr/gateway.py",
 line 160, in __gr_block_handle
     ) for i in self.__out_indexes],
   File "/Users/glangsto/Desktop/Research/vdecimate/vdecimate.py", line 58, in 
work
     out[:] = self.sum/float(self.count)
ValueError: could not broadcast input array from shape (4,1024) into shape 
(1,1024)
thread[thread-per-block[1]: <block vdecimate (2)>]: SWIG director method error. 
Error detected when calling 'feval_ll.eval'
_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

_______________________________________________
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]