diff options
Diffstat (limited to 'docs/doxygen/other/main_page.dox')
-rw-r--r-- | docs/doxygen/other/main_page.dox | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox index 916ac9bdd1..498e2f5803 100644 --- a/docs/doxygen/other/main_page.dox +++ b/docs/doxygen/other/main_page.dox @@ -70,7 +70,7 @@ done. A single source and sink are used with a FIR filter between them. \code - from gnuradio import gr, filter + from gnuradio import gr, filter, analog class my_topblock(gr.top_block): def __init__(self): @@ -79,9 +79,9 @@ them. amp = 1 taps = filter.firdes.low_pass(1, 1, 0.1, 0.01) - self.src = gr.noise_source_c(gr.GR_GAUSSIAN, amp) + self.src = analog.noise_source_c(gr.GR_GAUSSIAN, amp) self.flt = filter.fir_filter_ccf(1, taps) - self.snk = gr.null_sink(gr.sizeof_gr_complex) + self.snk = blocks.null_sink(gr.sizeof_gr_complex) self.connect(self.src, self.flt, self.snk) @@ -203,7 +203,7 @@ buffer, which may be different than what was initially specified. It is possible to reconfigure the flowgraph at runtime. The reconfiguration is meant for changes in the flowgraph structure, not individual parameter settings of the blocks. For example, changing the -constant in a gr_add_const_cc block can be done while the flowgraph is +constant in a gr::blocks::add_const_cc block can be done while the flowgraph is running using the 'set_k(k)' method. Reconfiguration is done by locking the flowgraph, which stops it from @@ -211,23 +211,24 @@ running and processing data, performing the reconfiguration, and then restarting the graph by unlocking it. The following example code shows a graph that first adds two -gr_noise_source_c blocks and then replaces the gr_add_cc block with a -gr_sub_cc block to then subtract the sources. +gr::analog::noise_source_c blocks and then replaces the +gr::blocks::add_cc block with a gr::blocks::sub_cc block to then +subtract the sources. \code -from gnuradio import gr +from gnuradio import gr, analog, blocks import time class mytb(gr.top_block): def __init__(self): gr.top_block.__init__(self) - self.src0 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) - self.src1 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) - self.add = gr.add_cc() - self.sub = gr.sub_cc() - self.head = gr.head(gr.sizeof_gr_complex, 1000000) - self.snk = gr.file_sink(gr.sizeof_gr_complex, "output.32fc") + self.src0 = analog.noise_source_c(analog.GR_GAUSSIAN, 1) + self.src1 = analog.noise_source_c(analog.GR_GAUSSIAN, 1) + self.add = blocks.add_cc() + self.sub = blocks.sub_cc() + self.head = blocks.head(gr.sizeof_gr_complex, 1000000) + self.snk = blocks.file_sink(gr.sizeof_gr_complex, "output.32fc") self.connect(self.src0, (self.add,0)) self.connect(self.src1, (self.add,1)) @@ -270,19 +271,19 @@ The following example expands the previous example but sets and resets the max noutput_items both locally and globally. \code -from gnuradio import gr +from gnuradio import gr, analog, blocks import time class mytb(gr.top_block): def __init__(self): gr.top_block.__init__(self) - self.src0 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) - self.src1 = gr.noise_source_c(gr.GR_GAUSSIAN, 1) - self.add = gr.add_cc() - self.sub = gr.sub_cc() - self.head = gr.head(gr.sizeof_gr_complex, 1000000) - self.snk = gr.file_sink(gr.sizeof_gr_complex, "output.32fc") + self.src0 = analog.noise_source_c(analog.GR_GAUSSIAN, 1) + self.src1 = analog.noise_source_c(analog.GR_GAUSSIAN, 1) + self.add = blocks.add_cc() + self.sub = blocks.sub_cc() + self.head = blocks.head(gr.sizeof_gr_complex, 1000000) + self.snk = blocks.file_sink(gr.sizeof_gr_complex, "output.32fc") self.connect(self.src0, (self.add,0)) self.connect(self.src1, (self.add,1)) @@ -327,8 +328,9 @@ The \ref volk_guide page provides an overview of how to incorporate and use Volk in GNU Radio blocks. Many blocks have already been converted to use Volk in their calls, so -they can also serve as examples. See the gr_complex_to_xxx.h file for -examples of various blocks that make use of Volk. +they can also serve as examples. See the +gr::blocks::complex_to_<type>.h files for examples of various blocks +that make use of Volk. \section prefs Configuration / Preference Files |