Re: [Discuss-gnuradio] on the fly set_output_multiple()
On 02/21/2014 12:38 AM, Activecat wrote: Problem: Says, the instantaneous interpolation_factor is 3. As inherited from gr::block, the scheduler may call the general_work() with noutput_items=2 (any number is possible). When this happen, there is nothing to be done except to consume_each(0) and return 0 in the general_work(). You could tweak forecast() to require more input. But then the scheduler will repeat calling general_work() many times with noutput_items=2. This is fatal. Solution: On the fly, set_min_noutput_items(3) Then the scheduler will not call general_work() with noutput_items equals a value less than 3. This solves the problems ! Question: Does this function work on the fly?set_min_noutput_items() It should, that's what it was made for. MB ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
[Discuss-gnuradio] on the fly set_output_multiple()
Dear Sir, I need to create a interpolator block which has a callback function to change its interpolation factor on the fly. If this block is inherited from gr::sync_interpolator, its interpolation factor cannot be changed on the fly because the interpolation factor is an argument of its constructor. The alternative is to inherit from gr::block instead. If the set_output_multiple() could be called on the fly, then the problem is solved. The problem is, the set_output_multiple() could not be changed on the fly ! http://lists.gnu.org/archive/html/discuss-gnuradio/2010-11/msg00504.html Any solution to this? The objective is to create an interpolator block that its interpolation factor could be changed on the fly. Thanks in advance. Regards, Activecat ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] on the fly set_output_multiple()
On 02/20/2014 01:46 PM, Activecat wrote: I need to create a interpolator block which has a callback function to change its interpolation factor on the fly. If this block is inherited from gr::sync_interpolator, its interpolation factor cannot be changed on the fly because the interpolation factor is an argument of its constructor. The alternative is to inherit from gr::block instead. If the set_output_multiple() could be called on the fly, then the problem is solved. The problem is, the set_output_multiple() could not be changed on the fly ! http://lists.gnu.org/archive/html/discuss-gnuradio/2010-11/msg00504.html Any solution to this? The objective is to create an interpolator block that its interpolation factor could be changed on the fly. Well, in a ::block you can do whatever you like with your in- and output buffers. Also, forecast() is called all the time, and its behaviour can by dynamic. So, between those you should be able to figure something out. 1) Edit forecast() 2) in general_work(), check if buffer sizes work 3) produce() and consume() as required MB ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Re: [Discuss-gnuradio] on the fly set_output_multiple()
Dear Martin, Thanks for the hints. I think this function helps: set_min_noutput_items() Problem: Says, the instantaneous interpolation_factor is 3. As inherited from gr::block, the scheduler may call the general_work() with noutput_items=2 (any number is possible). When this happen, there is nothing to be done except to consume_each(0) and return 0 in the general_work(). But then the scheduler will repeat calling general_work() many times with noutput_items=2. This is fatal. Solution: On the fly, set_min_noutput_items(3) Then the scheduler will not call general_work() with noutput_items equals a value less than 3. This solves the problems ! Question: Does this function work on the fly?set_min_noutput_items() Thank you very much. Regards, Activecat On Fri, Feb 21, 2014 at 3:31 AM, Martin Braun martin.br...@ettus.comwrote: On 02/20/2014 01:46 PM, Activecat wrote: I need to create a interpolator block which has a callback function to change its interpolation factor on the fly. If this block is inherited from gr::sync_interpolator, its interpolation factor cannot be changed on the fly because the interpolation factor is an argument of its constructor. The alternative is to inherit from gr::block instead. If the set_output_multiple() could be called on the fly, then the problem is solved. The problem is, the set_output_multiple() could not be changed on the fly ! http://lists.gnu.org/archive/html/discuss-gnuradio/2010-11/msg00504.html Any solution to this? The objective is to create an interpolator block that its interpolation factor could be changed on the fly. Well, in a ::block you can do whatever you like with your in- and output buffers. Also, forecast() is called all the time, and its behaviour can by dynamic. So, between those you should be able to figure something out. 1) Edit forecast() 2) in general_work(), check if buffer sizes work 3) produce() and consume() as required MB ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio ___ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio