# Analysis\_filterbank

**URL:** <https://www.ruby-forum.com/t/analysis-filterbank/157621>\
**Category:** GNU Radio\
**Created:** [January 13, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/analysis-filterbank/157621 "2009-01-13T19:46:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastiaan\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Sebastiaan\_H](https://www.ruby-forum.com/u/Sebastiaan_H)\
**Post date:** [January 13, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/analysis-filterbank/157621/1 "2009-01-13T19:46:53Z")

</div>

Hi

I think I have found what might be my problem with the  
analysis\_filterbank. When using it as a polyphase channeliser, you  
need to start feeding samples in from the bottom channel, upwards.  
The gr.analysis\_filterbank uses gr.stream\_to\_streams to split the  
input into a number of streams starting at the top. For a polyphase  
channeliser, this should be the other way round. I guess I need to  
make a different version of stream\_to\_streams to do this. Can someone  
please just help me with some c++ code? In particular the work()  
function of gr\_stream\_to\_streams:

const char \*in = (const char \*) input\_items[0];  
char \*\*outv = (char \*\*) &output\_items[0];  
int nstreams = output\_items.size();

for (int i = 0; i \< noutput\_items; i++){  
for (int j = 0; j \< nstreams; j++){  
memcpy(outv[j], in, item\_size);  
outv[j] += item\_size;  
in += item\_size;  
}  
}

Firstly, why do we use a pointer to a pointer for the output data?  
For what I intend to do, I need to do the following, right?

memcpy(outv[nstreams-j-1],in,item\_size);  
outv[nstreams-j-1] -= item\_size; //or out[nstreams-j-1] +=  
item\_size?  
in += item\_size;

Thanks

Sebastiaan

---

<div class="post-metadata">

**Author:** ![Sebastiaan\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Sebastiaan\_H](https://www.ruby-forum.com/u/Sebastiaan_H)\
**Post date:** [January 13, 2009, 8:08pm UTC](https://www.ruby-forum.com/t/analysis-filterbank/157621/2 "2009-01-13T20:08:06Z")

</div>

On Tue, Jan 13, 2009 at 08:45:43PM +0200, Sebastiaan H. wrote:

> function of gr\_stream\_to\_streams:  
> Sebastian, I think you’re confused about what’s going on.  
> Even if the output is backwards (I’m not convinced), you can just  
> rewire the output with connect. No reason to code a block.

> }
> 
> Firstly, why do we use a pointer to a pointer for the output data?

Uhh, because it’s the correct type?

Look at the type of output\_items. It’s

gr\_vector\_void\_star &output\_items

which is a typedef (gr\_types.h) for

std::vector\<void \*\>

There’s a distinct pointer for each output stream. The code writes N  
output streams.

Eric

> For what I intend to do, I need to do the following, right?
