[Top][All Lists]

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

Re: [Discuss-gnuradio] Analysis_filterbank

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Analysis_filterbank
Date: Tue, 13 Jan 2009 11:06:33 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Jan 13, 2009 at 08:45:43PM +0200, Sebastiaan Heunis wrote:
> 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:

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.

> 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?

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.


> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]