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
Work call: 0
Length of input in current work call: 4096
First few elements in in0 in current work call: [ 0.+0.j  1.+0.j  2.+0.j  
3.+0.j  4.+0.j]
Last few elements in in0 in current work call: [ 4091.+0.j  4092.+0.j  
4093.+0.j  4094.+0.j  4095.+0.j]
Work call: 1
Length of input in current work call: 4095
First few elements in in0 in current work call: [ 4096.+0.j  4097.+0.j  
4098.+0.j  4099.+0.j  4100.+0.j]
Last few elements in in0 in current work call: [ 8186.+0.j  8187.+0.j  
8188.+0.j  8189.+0.j  8190.+0.j]
Work call: 2
Length of input in current work call: 4096
First few elements in in0 in current work call: [ 8191.+0.j  8192.+0.j  
8193.+0.j  8194.+0.j  8195.+0.j]
Last few elements in in0 in current work call: [ 12282.+0.j  12283.+0.j  
12284.+0.j  12285.+0.j  12286.+0.j]
Work call: 3
Length of input in current work call: 4095
First few elements in in0 in current work call: [ 12287.+0.j  12288.+0.j  
12289.+0.j  12290.+0.j  12291.+0.j]
Last few elements in in0 in current work call: [ 16377.+0.j  16378.+0.j  
16379.+0.j  16380.+0.j  16381.+0.j]
Work call: 4
Length of input in current work call: 4096
First few elements in in0 in current work call: [ 16382.+0.j  16383.+0.j  
16384.+0.j  16385.+0.j  16386.+0.j]
Last few elements in in0 in current work call: [ 20473.+0.j  20474.+0.j  
20475.+0.j  20476.+0.j  20477.+0.j]
Work call: 5
Length of input in current work call: 4095
First few elements in in0 in current work call: [ 20478.+0.j  20479.+0.j  
20480.+0.j  20481.+0.j  20482.+0.j]
Last few elements in in0 in current work call: [ 24568.+0.j  24569.+0.j  
24570.+0.j  24571.+0.j  24572.+0.j]
Work call: 6
Length of input in current work call: 4096
First few elements in in0 in current work call: [ 24573.+0.j  24574.+0.j  
24575.+0.j  24576.+0.j  24577.+0.j]
Last few elements in in0 in current work call: [ 28664.+0.j  28665.+0.j  
28666.+0.j  28667.+0.j  28668.+0.j]
Work call: 7
Length of input in current work call: 4095
First few elements in in0 in current work call: [ 28669.+0.j  28670.+0.j  
28671.+0.j  28672.+0.j  28673.+0.j]
Last few elements in in0 in current work call: [ 32759.+0.j  32760.+0.j  
32761.+0.j  32762.+0.j  32763.+0.j]
Work call: 8
Length of input in current work call: 4096
First few elements in in0 in current work call: [ 32764.+0.j  32765.+0.j  
32766.+0.j  32767.+0.j  32768.+0.j]
Last few elements in in0 in current work call: [ 36855.+0.j  36856.+0.j  
36857.+0.j  36858.+0.j  36859.+0.j]
Work call: 9
Length of input in current work call: 4095
First few elements in in0 in current work call: [ 36860.+0.j  36861.+0.j  
36862.+0.j  36863.+0.j  36864.+0.j]
Last few elements in in0 in current work call: [ 40950.+0.j  40951.+0.j  
40952.+0.j  40953.+0.j  40954.+0.j]
Work call: 10
Length of input in current work call: 4096
First few elements in in0 in current work call: [ 40955.+0.j  40956.+0.j  
40957.+0.j  40958.+0.j  40959.+0.j]
Last few elements in in0 in current work call: [ 45046.+0.j  45047.+0.j  
45048.+0.j  45049.+0.j  45050.+0.j]
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to