discuss-gnuradio
[Top][All Lists]
Advanced

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

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


From: ratnesh kumbhkar
Subject: [Discuss-gnuradio] making local filter with more than "noutput_items" output length
Date: Wed, 9 Sep 2015 14:43:35 -0400

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 

reply via email to

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