Forum: GNU Radio Analysis_filterbank

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
998dbc3ac73d5487c59c0ee0f5baeeb1?d=identicon&s=25 Sebastiaan Heunis (Guest)
on 2009-01-13 19:46
(Received via mailing list)
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
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2009-01-13 20:08
(Received via mailing list)
On Tue, Jan 13, 2009 at 08:45:43PM +0200, Sebastiaan Heunis 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?
This topic is locked and can not be replied to.