GNU Radio's SATNOGS Package
doppler_correction_cc_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4  *
5  * Copyright (C) 2016, Libre Space Foundation <http://librespacefoundation.org/>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef INCLUDED_SATNOGS_DOPPLER_CORRECTION_CC_IMPL_H
22 #define INCLUDED_SATNOGS_DOPPLER_CORRECTION_CC_IMPL_H
23 
25 #include <satnogs/doppler_fit.h>
26 #include <gnuradio/fxpt_nco.h>
27 #include <deque>
28 
29 namespace gr {
30 namespace satnogs {
31 
33 private:
34  const double d_target_freq;
35  const double d_offset;
36  const double d_samp_rate;
37  const size_t d_update_period;
38  const size_t d_est_thrhld;
39  const size_t d_corrections_per_sec;
40 
41  gr::fxpt_nco d_nco;
42  doppler_fit d_doppler_fit_engine;
43  double d_freq_diff;
44  size_t d_freq_est_num;
45  size_t d_corrections;
46  size_t d_corrected_samples;
47  double *d_predicted_freqs;
48  gr_complex *d_nco_buff;
49  boost::mutex d_mutex;
50 
51  void
52  new_freq(pmt::pmt_t msg);
53 
54  void
55  reset(pmt::pmt_t msg);
56 
57 public:
58  doppler_correction_cc_impl(double target_freq,
59  double offset,
60  double sampling_rate,
61  size_t corrections_per_sec);
63 
64  // Where all the action really happens
65  int
66  work(int noutput_items, gr_vector_const_void_star &input_items,
67  gr_vector_void_star &output_items);
68 };
69 
70 } // namespace satnogs
71 } // namespace gr
72 
73 #endif /* INCLUDED_SATNOGS_DOPPLER_CORRECTION_CC_IMPL_H */
74 
Definition: doppler_correction_cc_impl.h:32
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
doppler_correction_cc_impl(double target_freq, double offset, double sampling_rate, size_t corrections_per_sec)
This block corrects the doppler effect between the ground station and the satellite....
Definition: doppler_correction_cc.h:40
Doppler frequency fitting using Lagrange extrapolation.
Definition: doppler_fit.h:35
Definition: amsat_duv_decoder.h:29