[Top][All Lists]

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

flowgraph ret -11 when oot block calls gr::filter::firdes::low_pass_2

From: John Murphy
Subject: flowgraph ret -11 when oot block calls gr::filter::firdes::low_pass_2
Date: Sat, 26 Jun 2021 09:14:52 -0400

I am having difficulty using gr::filter::firdes in my OOT cpp block.

(Trying to use code block in notorious webmail editor for gmail, sorry if this gets a little garbled)

I am calling my setter function as follows...
      set_filter( 31.25f, 50.0f, 96.0f );
And this is the setter function at the moment while I am troubleshooting...
    my_sink_c_impl::set_filter( float passband, float stopband, float attenuation ) {
      std::printf( "set_filter samp_rate %f passband %f stopband %f attenuation %f\n", d_samp_rate, passband, stopband, attenuation );
      delete d_in_decim_lpf;
      std::printf( "set_filter 1\n" );
      gr_vector_float taps = gr::filter::firdes::low_pass_2( 1, 1, 0.2, 0.1, 60 );
      gr_vector_float taps = gr::filter::firdes::low_pass_2(
        ( stopband - passband ) / 2, // 'cutoff' (center of transition band) or just passband (beginning of transition band)?
        stopband - passband,
      std::printf( "set_filter 2\n" );
      //d_in_decim_lpf = new gr::filter::kernel::fft_filter_ccf( d_samp_per_sym, taps, 1 );
      std::printf( "set_filter 3\n" );
      //d_in_filt_samp_per_step = d_in_decim_lpf->set_taps( taps );
      std::printf( "set_filter 4\n" );

Note that my block does not do anything with d_in_decim_lpf (or d_in_filt_samp_per_step for that matter) yet except try to set it up by calling this from the constructor.

When I make clean / make / sudo make install / sudo ldconfig, then reload blocks in grc and try to run my flowgraph...
It prints the first printf (with the params) and then stops with a return value of -11 (segfault?)
My guess is that the second printf ('1') works but is interrupted before executing by an error in the next line
It does this regardless of whether I uncomment/comment the firdes call the way I want it (the multline version) or use the firdes call I copied from Tom Rondeau's (albeit pythonic - maybe I am goofing my translation to cpp) ageless example shown.

I tried leaving off the window type (using the default Hamming) but that was not it.
Since the values might be a little extreme for my 2k sample rate I am using (64 x cutoff freq) I also tried it with Tom's old example.

If I comment out both versions of trying to call firdes to generate taps, then it prints all the goodies and the flowgraph runs fine.
I must be doing something wrong at a basic level here. Any ideas?

reply via email to

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