|
From: | Anil Kumar Yerrapragada |
Subject: | [Discuss-gnuradio] Question on number of input items per work call |
Date: | Wed, 15 Nov 2017 20:56:41 -0600 |
Hi all
I am experimenting with my own python block. I started by simply interrogating each variable to see their types and shapes.
I connected a vector source that just generates increasing numbers (0, 1, 2, 3, 4, 5 and so on upto a big number).
I noticed that the length of (input_items[0]) seems to oscillate between 4096 and 4095 in successive work calls. I also noticed that in each work call, a NEW set of samples appear. (attached file)
Here are my questions:
If I were just doing something really simple like squaring each element, in each work call I'd just square every element in the vector input_items[0]. No problem.
Suppose I need to do an FFT. (I know it can be done with stream to vector followed by FFT) But suppose I wanted to make it work with streams.
In each work call, I’d divide the input_items[0] vector into chunks of size = FFT size and take the FFT of each chunk. Again no problem. Since 4096 will divide perfectly by a power of 2 FFT size.
But what about the case when I have 4095? If I do FFT = 512, I will get 7 chunks of 512 and I will be left over with 511. Would I have to save those 511 elements and use them in the next work call when input_items[0] gets new elements?
Thanks
Anil
testData.txt
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |