Hi Activecat, Thanks for providing the flowgraph_01.grc example. Now I understand that how to set sample rate of a customized block. For others, sample rate of a customized block can be initialized in the make() function of the block. Details of setting the sample rate can be found in Activecat's example. Thanks.
make(float samp_rate) { return gnuradio::get_initial_sptr (new reader_impl(samp_rate)); } Pengyu On Sun, Jun 1, 2014 at 1:30 AM, Activecat <active...@gmail.com> wrote: > On Sat, May 31, 2014 at 11:47 PM, Activecat <active...@gmail.com> wrote: > >> I've created a sample for you at https://github.com/activecat/gr-test1 >> You could run the flowgraph found in the "examples" directory. >> Try to change the samp_rate of the flowgraph from 32kHz to different >> values (64kHz, 200kHrz etc). >> You will observe via the GUI Scope Sink, that the block consistently >> produces two 1ms pulse for every 10ms. >> > > > Try to run gr-test1/examples/flowgraph_02.grc, you may try setting > different values to samp_rate of the flowgraph. > The outcomes indicates that this "pulse1" block is very consistent with > the built-in Signal Source block, in term of how it works respecting to the > samp_rate variable. > > https://github.com/activecat/gr-test1 >
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio