discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] making local filter with more than "noutput_items


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] making local filter with more than "noutput_items" output length
Date: Thu, 10 Sep 2015 09:04:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

Hi Ratnesh,

what type is d_Shfilter?

Best regards,
Marcus

On 09.09.2015 20:43, ratnesh kumbhkar wrote:
Hi all,
I am trying to make an out-of-tree module using sync block. In which I want to make a local filter, i.e. output of this filter is not connected to an output port, but to be stored in a local variable.

int  ShortPNcorr_impl::work(int noutput_items,
                    gr_vector_const_void_star &input_items,
                    gr_vector_void_star &output_items)
            {
                const gr_complex *in = (const gr_complex *) input_items[0];
                gr_complex *out = (gr_complex *) output_items[0];
                gr_complex *tcorr = (gr_complex *) output_items[1];
                int *flag = (int *) output_items[2]; // this is calculated based on local filter

                std::vector<gr_complex> short_corr(noutput_items+history());
                gr_complex *corr = (gr_complex *) &(short_corr[0]);

                ......................


                d_Shfilter->filter(noutput_items+X, in, corr);
                // Where X>0
                // d_Shfilter is fft_filter_ccc filter of length 40 (number of taps)
                // Since I am saving a history of length 320, I am assuming that input buffer has atleast noutput_items+319 values available

                ......................
             }

I think that filter requires corr  to be a pointer to the vector (similar to 'in' or 'out'), and that is what I am trying to do. But this  results in an unstable operation and whenever I choose X>250, I get "double free or corruption" error. Can someone explain this? Is my understanding of "history" wrong?

Thanks

Ratnesh 


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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