GNU Radio's SATELLITES Package
doppler_correction_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2022 Daniel Estevez <daniel@destevez.net>.
4  *
5  * This file is part of gr-satellites
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  */
9 
10 #ifndef INCLUDED_SATELLITES_DOPPLER_CORRECTION_IMPL_H
11 #define INCLUDED_SATELLITES_DOPPLER_CORRECTION_IMPL_H
12 
13 #include <gnuradio/math.h>
15 #include <vector>
16 
17 namespace gr {
18 namespace satellites {
19 
21 {
22 private:
23  float d_phase;
24  double d_samp_rate;
25  size_t d_current_index;
26  double d_t0;
27  int d_sample_t0;
28  std::vector<double> times;
29  std::vector<double> freqs_rad_per_sample;
30  std::vector<tag_t> d_tags;
31  const pmt::pmt_t d_rx_time_key;
32 
33  // Implementation taken from gr::block::control_loop
34  void phase_wrap()
35  {
36  while (d_phase > (2 * GR_M_PI))
37  d_phase -= 2 * GR_M_PI;
38  while (d_phase < (-2 * GR_M_PI))
39  d_phase += 2 * GR_M_PI;
40  }
41 
42  void read_doppler_file(std::string& filename);
43 
44 public:
45  doppler_correction_impl(std::string& filename, double samp_rate, double t0);
47 
48  int work(int noutput_items,
49  gr_vector_const_void_star& input_items,
50  gr_vector_void_star& output_items);
51 };
52 
53 } // namespace satellites
54 } // namespace gr
55 
56 #endif /* INCLUDED_SATELLITES_DOPPLER_CORRECTION_IMPL_H */
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: doppler_correction_impl.h:20
Definition: ax100_decode.h:17
doppler_correction_impl(std::string &filename, double samp_rate, double t0)
Performs Doppler correction using a frequency vs. time file.
Definition: doppler_correction.h:45