discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Using gr_sync_decimator [was: How to use forecast


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Using gr_sync_decimator [was: How to use forecast()?]
Date: Fri, 6 Aug 2010 10:21:38 -0700
User-agent: Mutt/1.5.20 (2009-08-17)

On Fri, Aug 06, 2010 at 06:32:32AM -0700, Sammour wrote:
> 
> Hi Eric,
> I have a similar issue as the one described above and I have read some of
> the examples in the directory provided but they seem to be different from
> what I want to implement. I want to collect L samples from N channels and
> store them in a buffer, do processing and output a vector of length N. I
> wrote the following code but it doesn't seem to be working properly. Some of
> them use loops from i=0 to noutput_items*vlen while others use from 0 to
> noutput_items. Also some of them don't use the function memcpy.
> 
> I am using gr_sync_decimator with set_decimation(L) is written in the block
> constructor.

gr_sync_decimator with decimation == L correct, given what you've described.

Can you please show the beginning of your constructor, where you pass the
arguments to gr_sync_decimator's constructor?

Eric




> ---------------------------------------------------
> int my_package::work(.....) {
> 
>             gr_complexd *out =(gr_complexd *) output_items[0];
>             const gr_complex *in[N];
> 
>             for (unsigned int i = 0; i<N; i++)
>                 in[i] = (const gr_complex *) input_items[i];
>             
>             for (int i = 0; i <noutput_items; i++){
>                 for(unsigned int k=0; k<N; k++)
>                       
> memcpy(&inbuffer[k][0],&in[k][i*L],L*sizeof(gr_complex)); //inbuffer is
> NxL matrix
> 
>                 //Signal processing of inbuffer and storing the result in a
> vector 
>               // out_vector of length vect_lengx;
> 
>                 memcpy(out, &out_vector.at(0),
> vect_lengx*sizeof(gr_complexd));
>                 out+=vect_lengx;
>                 
>             }//end for
>  
>     return noutput_items;
> }
> ------------------------------------------------------
> Can you help me with this please?
> 
> Thanks a lot.
> 
> Sammour
> -- 
> View this message in context: 
> http://old.nabble.com/How-to-use-forecast%28%29--tp28705301p29356450.html
> Sent from the GnuRadio mailing list archive at Nabble.com.



reply via email to

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