add get_freq_error()

max
Max 5 years ago
parent 90fbe46518
commit 1b1c8842c1
  1. 1
      op25/gr-op25_repeater/include/op25_repeater/gardner_costas_cc.h
  2. 5
      op25/gr-op25_repeater/lib/gardner_costas_cc_impl.cc
  3. 1
      op25/gr-op25_repeater/lib/gardner_costas_cc_impl.h

@ -48,6 +48,7 @@ namespace gr {
*/
static sptr make(float samples_per_symbol, float gain_mu, float gain_omega, float alpha, float beta, float max_freq, float min_freq);
virtual void set_omega(float omega) {}
virtual float get_freq_error(void) {}
};
} // namespace op25_repeater

@ -146,6 +146,9 @@ void gardner_costas_cc_impl::set_omega (float omega) {
memset(d_dl, 0, NUM_COMPLEX * sizeof(gr_complex));
}
float gardner_costas_cc_impl::get_freq_error (void) {
return (d_freq);
}
void
gardner_costas_cc_impl::forecast(int noutput_items, gr_vector_int &ninput_items_required)
@ -261,7 +264,7 @@ gardner_costas_cc_impl::general_work (int noutput_items,
float error_real = (d_last_sample.real() - interp_samp.real()) * interp_samp_mid.real();
float error_imag = (d_last_sample.imag() - interp_samp.imag()) * interp_samp_mid.imag();
gr_complex diffdec = interp_samp * conj(d_last_sample);
(void)slicer(std::arg(diffdec));
// cpu reduction (void)slicer(std::arg(diffdec));
d_last_sample = interp_samp; // save for next time
#if 1
float symbol_error = error_real + error_imag; // Gardner loop error

@ -67,6 +67,7 @@ namespace gr {
//! Sets value of omega and its min and max values
void set_omega (float omega);
float get_freq_error(void);
protected:
bool input_sample0(gr_complex, gr_complex& outp);

Loading…
Cancel
Save