Adding a set_sensitivity() function to VCO_C block
Hi all, I am working with GNURADIO 3.7 and realized that the VCO blocks do not have functionality to change the sensitivity parameter during operation. I wanted to use them for generating FSK signals. I realized I can do that equivalently with the Frequency Mod block, so this is fine. However I decided to add the set_sensitivity functionality to the VCO_c block. So I did the following: 1) edited the vco_c_impl.h file public: vco_c_impl(double sampling_rate, double sensitivity, double amplitude); ~vco_c_impl(); void set_sensitivity(double sensitivity); . 2) I edited the vco_c_impl.cc file: vco_c_impl::~vco_c_impl() { } void vco_c_impl::set_sensitivity(double sensitivity) { d_sensitivity = sensitivity; d_k = d_sensitivity / d_sampling_rate; } 3) I edited the blocks_vco_c.xml file: ... blocks.vco_c($samp_rate, $sensitivity, $amplitude) set_sensitivity($sensitivity) ... 4) After remaking/reinstalling gnuradio I do the following test in python: >>> from gnuradio import blocks >>> x=blocks.vco_c(1,2,3) >>> x.set_sensitivity(4) Traceback (most recent call last): File "", line 1, in AttributeError: 'vco_c_sptr' object has no attribute 'set_sensitivity' 5) In addition when I use the block in GRC and try to change the sensitivity I get similar errors. So I know that somehow the python bindings are not generated. I feel I have forgotten to edit some file before compilation, but do not remember which one has to be changed (it has been some time since I last did development work on the gnuradio code). What am I missing? thanks Achilleas
Re: Adding a set_sensitivity() function to VCO_C block
You didn't mention editing gr-blocks/include/gnuradio/blocks/vco_c.h. On Fri, Feb 12, 2021 at 9:39 AM Achilleas Anastasopoulos wrote: > Hi all, > > I am working with GNURADIO 3.7 and realized that the VCO blocks do not > have functionality to change the sensitivity parameter during operation. > I wanted to use them for generating FSK signals. > I realized I can do that equivalently with the Frequency Mod block, so > this is fine. > > However I decided to add the set_sensitivity functionality to the VCO_c > block. > So I did the following: > > 1) edited the vco_c_impl.h file > > > public: > vco_c_impl(double sampling_rate, double sensitivity, double > amplitude); > ~vco_c_impl(); > void set_sensitivity(double sensitivity); > . > > 2) I edited the vco_c_impl.cc file: > > vco_c_impl::~vco_c_impl() > { > } > > void > vco_c_impl::set_sensitivity(double sensitivity) > { > d_sensitivity = sensitivity; > d_k = d_sensitivity / d_sampling_rate; > } > > > > 3) I edited the blocks_vco_c.xml file: > > ... > blocks.vco_c($samp_rate, $sensitivity, $amplitude) > set_sensitivity($sensitivity) > ... > > > 4) After remaking/reinstalling gnuradio I do the following test in python: > > >>> from gnuradio import blocks > >>> x=blocks.vco_c(1,2,3) > >>> x.set_sensitivity(4) > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'vco_c_sptr' object has no attribute 'set_sensitivity' > > 5) In addition when I use the block in GRC and try to change the > sensitivity I get similar errors. > > So I know that somehow the python bindings are not generated. > I feel I have forgotten to edit some file before compilation, but do not > remember which one has to be changed (it has been some time since I last > did development work on the gnuradio code). > > What am I missing? > > thanks > Achilleas > > > > > > > >
Re: Adding a set_sensitivity() function to VCO_C block
So editing the vco_c.h file : ... static sptr make(double sampling_rate, double sensitivity, double amplitude); //! Sets the sensitivity. virtual void set_sensitivity(double sensitivity) =0; did the job! thanks again, Achilleas