Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********************
- GNU Radio C++ Flow Graph Source File
- Title: top_block
- Generated: Sun Aug 13 21:45:51 2017
- ********************/
- #include "tb.hpp"
- using namespace gr;
- tb::tb () : top_block("top_block") {
- // Variables:
- self.samp_rate = samp_rate = 32000
- // Blocks:
- this->blocks_throttle_0 = blocks::throttle::make(gr.sizeof_gr_complex*1, samp_rate, True);
- this->blocks_null_sink_0 = blocks::null_sink::make(gr.sizeof_gr_complex*1);
- this->analog_sig_source_x_0 = analog::sig_source_c::make(samp_rate, analog.GR_SIN_WAVE, 1000, 1, 0);
- // Connections:
- this->connect((this->analog_sig_source_x_0, 'out0'), (this->blocks_throttle_0, 'in0'));
- this->connect((this->blocks_throttle_0, 'out0'), (this->blocks_null_sink_0, 'in0'));
- }
- tb::~tb () {
- }
- // Callbacks:
- tb::get_samp_rate () const {
- return this->samp_rate;
- }
- void tb::set_samp_rate (samp_rate) {
- this->samp_rate = samp_rate;
- this->analog_sig_source_x_0.set_sampling_freq(this->samp_rate);
- this->blocks_throttle_0.set_sample_rate(this->samp_rate);
- }
- int main (int argc, char **argv) {
- tb = new tb();
- tb->start();
- tb->stop();
- tb->wait();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement