diff options
Diffstat (limited to 'gr-atsc/src/lib')
-rw-r--r-- | gr-atsc/src/lib/atsc.i | 1 | ||||
-rw-r--r-- | gr-atsc/src/lib/atsc_bit_timing_loop.cc | 8 | ||||
-rw-r--r-- | gr-atsc/src/lib/atsc_equalizer.h | 5 | ||||
-rw-r--r-- | gr-atsc/src/lib/atsci_equalizer.h | 5 | ||||
-rw-r--r-- | gr-atsc/src/lib/atsci_equalizer_lms.h | 3 | ||||
-rw-r--r-- | gr-atsc/src/lib/atsci_sssr.cc | 8 |
6 files changed, 27 insertions, 3 deletions
diff --git a/gr-atsc/src/lib/atsc.i b/gr-atsc/src/lib/atsc.i index 6e5662ae6..6b83a2315 100644 --- a/gr-atsc/src/lib/atsc.i +++ b/gr-atsc/src/lib/atsc.i @@ -225,6 +225,7 @@ class atsc_equalizer : public gr_sync_block public: void reset(); + std::vector<double> taps(); }; // ---------------------------------------------------------------- diff --git a/gr-atsc/src/lib/atsc_bit_timing_loop.cc b/gr-atsc/src/lib/atsc_bit_timing_loop.cc index 7abd907cc..dc43d28bc 100644 --- a/gr-atsc/src/lib/atsc_bit_timing_loop.cc +++ b/gr-atsc/src/lib/atsc_bit_timing_loop.cc @@ -44,7 +44,7 @@ atsc_make_bit_timing_loop() atsc_bit_timing_loop::atsc_bit_timing_loop() : gr_block("atsc_bit_timing_loop", gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(2, 2, sizeof(float))), + gr_make_io_signature3(2, 3, sizeof(float), sizeof(float), sizeof(float))), d_interp(ratio_of_rx_clock_to_symbol_freq), d_next_input(0), d_rx_clock_to_symbol_freq (ratio_of_rx_clock_to_symbol_freq), d_si(0) @@ -82,6 +82,7 @@ atsc_bit_timing_loop::work (int noutput_items, const float *in = (const float *) input_items[0]; float *out_sample = (float *) output_items[0]; atsc::syminfo *out_tag = (atsc::syminfo *) output_items[1]; + float *out_timing_error = (float *) output_items[2]; assert(sizeof(float) == sizeof(atsc::syminfo)); @@ -110,12 +111,15 @@ atsc_bit_timing_loop::work (int noutput_items, } d_sssr.update (interp_sample, &seg_locked, &symbol_index, &timing_adjustment); + if (output_items.size() == 3) { + out_timing_error[k] = timing_adjustment; + } out_sample[k] = interp_sample; tag.valid = seg_locked; tag.symbol_num = symbol_index; out_tag[k] = tag; } - + return k; } diff --git a/gr-atsc/src/lib/atsc_equalizer.h b/gr-atsc/src/lib/atsc_equalizer.h index 32b449b62..aca5e63b4 100644 --- a/gr-atsc/src/lib/atsc_equalizer.h +++ b/gr-atsc/src/lib/atsc_equalizer.h @@ -25,6 +25,7 @@ #include <atsc_api.h> #include <gr_sync_block.h> #include <atsci_equalizer.h> +#include <vector> class atsc_equalizer; typedef boost::shared_ptr<atsc_equalizer> atsc_equalizer_sptr; @@ -47,6 +48,10 @@ class ATSC_API atsc_equalizer : public gr_sync_block public: void forecast (int noutput_items, gr_vector_int &ninput_items_required); + std::vector<double> taps() { + return d_equalizer->taps(); + } + int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); diff --git a/gr-atsc/src/lib/atsci_equalizer.h b/gr-atsc/src/lib/atsci_equalizer.h index a0a1fc674..b0c243b51 100644 --- a/gr-atsc/src/lib/atsci_equalizer.h +++ b/gr-atsc/src/lib/atsci_equalizer.h @@ -25,6 +25,7 @@ #include <atsc_api.h> #include <atsci_syminfo.h> +#include <vector> /*! * \brief abstract base class for ATSC equalizer @@ -54,6 +55,10 @@ public: atsci_equalizer (); virtual ~atsci_equalizer (); + virtual std::vector<double> taps () { + return std::vector<double>(); + } + // MANIPULATORS /*! diff --git a/gr-atsc/src/lib/atsci_equalizer_lms.h b/gr-atsc/src/lib/atsci_equalizer_lms.h index 68aa34ca5..eac72f75b 100644 --- a/gr-atsc/src/lib/atsci_equalizer_lms.h +++ b/gr-atsc/src/lib/atsci_equalizer_lms.h @@ -37,6 +37,9 @@ public: virtual void reset (); virtual int ntaps () const; virtual int npretaps () const; + std::vector<double> taps () { + return d_taps; + } protected: FILE *trainingfile; diff --git a/gr-atsc/src/lib/atsci_sssr.cc b/gr-atsc/src/lib/atsci_sssr.cc index 48c0c51fb..56a0c6a00 100644 --- a/gr-atsc/src/lib/atsci_sssr.cc +++ b/gr-atsc/src/lib/atsci_sssr.cc @@ -29,6 +29,7 @@ #include <gr_math.h> #include <stdio.h> #include <boost/math/special_functions/sign.hpp> +#include <iostream> /* * ---------------------------------------------------------------- @@ -142,7 +143,11 @@ atsci_sssr::update (sssr::sample_t sample_in, // input double qo = d_quad_filter.update (sample_in); d_quad_output[d_counter] = qo; - int bit = boost::math::signbit (sample_in) ^ 1; // slice on sign: + => 1, - => 0 + int bit = boost::math::signbit (sample_in); + if (bit != 0) + bit = 0; + else + bit = 1; int corr_out = d_correlator.update (bit); int weight = sipp (corr_out); int corr_value = d_integrator.update (weight, d_counter); @@ -153,6 +158,7 @@ atsci_sssr::update (sssr::sample_t sample_in, // input int best_correlation_value; best_correlation_index = d_integrator.find_max (&best_correlation_value); d_seg_locked = best_correlation_value >= MIN_SEG_LOCK_CORRELATION_VALUE; + //std::cout << "best = " << best_correlation_value << " min is " << MIN_SEG_LOCK_CORRELATION_VALUE << std::endl; d_timing_adjust = d_quad_output[best_correlation_index]; d_symbol_index = SYMBOL_INDEX_OFFSET - 1 - best_correlation_index; |