diff --git a/decode.cc b/decode.cc index 89dd397..4960be3 100644 --- a/decode.cc +++ b/decode.cc @@ -9,8 +9,8 @@ Copyright 2021 Ahmet Inan #include #include namespace DSP { using std::abs; using std::min; using std::cos; using std::sin; } +#include "repeated_median.hh" #include "bip_buffer.hh" -#include "theil_sen.hh" #include "xorshift.hh" #include "trigger.hh" #include "complex.hh" @@ -193,7 +193,7 @@ struct Decoder DSP::BlockDC blockdc; DSP::Hilbert hilbert; DSP::BipBuffer input_hist; - DSP::TheilSenEstimator tse; + DSP::RepeatedMedianEstimator rme; SchmidlCox correlator; CODE::CRC crc0; CODE::CRC crc1; @@ -519,13 +519,13 @@ struct Decoder index[i] = i + code_off; phase[i] = arg(cons[cons_cols*j+i] * conj(mod_map(tmp))); } - tse.compute(index, phase, cons_cols); - //std::cerr << "Theil-Sen slope = " << tse.slope() << std::endl; - //std::cerr << "Theil-Sen yint = " << tse.yint() << std::endl; - sum_slope += tse.slope(); - sum_yint += tse.yint(); + rme.compute(index, phase, cons_cols); + //std::cerr << "rme slope = " << rme.slope() << std::endl; + //std::cerr << "rme yint = " << rme.yint() << std::endl; + sum_slope += rme.slope(); + sum_yint += rme.yint(); for (int i = 0; i < cons_cols; ++i) - cons[cons_cols*j+i] *= DSP::polar(1, -tse(i+code_off)); + cons[cons_cols*j+i] *= DSP::polar(1, -rme(i+code_off)); } value avg_slope = sum_slope / cons_rows; value avg_yint = sum_yint / cons_rows;