Skip to content

Commit

Permalink
test debug
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Feb 19, 2016
1 parent a06c028 commit 9bf5196
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
29 changes: 29 additions & 0 deletions debug_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,31 @@ debug_recorder::debug_recorder(Source *src, long t, int n)
boost::filesystem::create_directories(path_stream.str());
sprintf(filename, "%s/%ld-%ld_%g.raw", path_stream.str().c_str(),talkgroup,starttime,freq);
raw_sink = gr::blocks::file_sink::make(sizeof(float), filename, true);
null_sink = gr::blocks::null_sink::make(sizeof(float));
// Perform Differential decoding on the constellation
diffdec = gr::digital::diff_phasor_cc::make();

// take angle of the difference (in radians)
to_float = gr::blocks::complex_to_arg::make();

// convert from radians such that signal is in -3/-1/+1/+3
rescale = gr::blocks::multiply_const_ff::make( (1 / (pi / 4)) );

const float l[] = { -2.0, 0.0, 2.0, 4.0 };
std::vector<float> levels( l,l + sizeof( l ) / sizeof( l[0] ) );
slicer = gr::op25_repeater::fsk4_slicer_fb::make(levels);

int udp_port = 0;
int verbosity = 10;
const char * wireshark_host="127.0.0.1";
bool do_imbe = 1;
bool do_output = 1;
bool do_msgq = 0;
bool do_audio_output = 1;
bool do_tdma = 0;
op25_frame_assembler = gr::op25_repeater::p25_frame_assembler::make(wireshark_host,udp_port,verbosity,do_imbe, do_output, do_msgq, rx_queue, do_audio_output, do_tdma);

converter = gr::blocks::short_to_float::make(1, 8192.0);

connect(self(),0, valve,0);
connect(valve,0, prefilter,0);
Expand All @@ -150,6 +174,11 @@ debug_recorder::debug_recorder(Source *src, long t, int n)
connect(costas_clock,0, diffdec, 0);
connect(diffdec, 0, to_float, 0);
connect(to_float,0, raw_sink,0);
connect(to_float,0, rescale, 0);
connect(rescale, 0, slicer, 0);
connect(slicer,0, op25_frame_assembler,0);
connect(op25_frame_assembler, 0, converter,0);
connect(converter, 0, null_sink,0);

}

Expand Down
9 changes: 7 additions & 2 deletions debug_recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@
#include <gnuradio/block.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/copy.h>

#include <op25_repeater/p25_frame_assembler.h>
#include <op25_repeater/gardner_costas_cc.h>
#include <op25_repeater/fsk4_slicer_fb.h>
#include <gnuradio/blocks/short_to_float.h>
#include <gnuradio/filter/pfb_arb_resampler_ccf.h>
#include <gnuradio/analog/feedforward_agc_cc.h>
#include <gnuradio/digital/diff_phasor_cc.h>
#include <gnuradio/blocks/complex_to_arg.h>

#include <gnuradio/msg_queue.h>

//Valve
//#include <gnuradio/blocks/null_sink.h>
Expand Down Expand Up @@ -109,6 +111,7 @@ class debug_recorder : public gr::hier_block2 , public Recorder
std::vector<float> sym_taps;
std::vector<float> lpf_coeffs;
std::vector<float> arb_taps;
gr::msg_queue::sptr rx_queue;

Source *source;

Expand Down Expand Up @@ -140,7 +143,9 @@ class debug_recorder : public gr::hier_block2 , public Recorder
gr::analog::feedforward_agc_cc::sptr agc;
gr::filter::pfb_arb_resampler_ccf::sptr arb_resampler;
gr::digital::diff_phasor_cc::sptr diffdec;

gr::op25_repeater::p25_frame_assembler::sptr op25_frame_assembler;
gr::op25_repeater::fsk4_slicer_fb::sptr slicer;
gr::blocks::multiply_const_ff::sptr rescale;

};

Expand Down

0 comments on commit 9bf5196

Please sign in to comment.