GNU Radio's SATELLITES Package
doppler_correction.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2022-2023 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_H
11#define INCLUDED_SATELLITES_DOPPLER_CORRECTION_H
12
13#include <gnuradio/sync_block.h>
14#include <satellites/api.h>
15
16namespace gr {
17namespace satellites {
18
19/*!
20 * \brief Performs Doppler correction using a frequency vs. time file
21 * \ingroup satellites
22 *
23 * \details
24 * The Doppler Correction block uses a text file listing frequency vs. time to
25 * perform Doppler correction on its input signal. The same block can be used
26 * for Doppler simulation by inverting the frequency values in the input file or
27 * by taking the complex conjugate of the output of the block.
28 *
29 * The text file should contain lines with a timestamp and a frequency separated
30 * by a space. The timestamps are given in seconds, and typically consist of
31 * UNIX time. The t0 parameter in the block constructor gives the starting time,
32 * which is the timestamp corresponding to the first sample processed by the
33 * block. As long as the timestamps in the file and this timestamp are
34 * consistent, the block will work correctly. The frequencies are given in Hz.
35 *
36 * The block can also use time tags such as those generated by the UHD Source
37 * block to update its internal timestamp. In this case the timestamps in the
38 * file should use UNIX seconds, since the UHD timestamps also use UNIX
39 * seconds. When using UHD time tags, the t0 parameter can be left as 0.
40 *
41 * The Doppler correction block interpolates the frequency linearly between each
42 * pair of entries in the text file, and generates a correction with continuous
43 * phase.
44 */
45class SATELLITES_API doppler_correction : virtual public gr::sync_block
46{
47public:
48 typedef std::shared_ptr<doppler_correction> sptr;
49
50 /*!
51 * \brief Build the Doppler Correction block.
52 *
53 * \param filename Path of the text file describing the Doppler data
54 * \param samp_rate Sample rate
55 * \param t0 Timestamp corresponding to the first sample
56 */
57 static sptr make(std::string& filename, double samp_rate, double t0);
58
59 /*!
60 * \brief Sets the current time.
61 *
62 * \param t Tiemstamp corresponding to the current time.
63 */
64 virtual void set_time(double t) = 0;
65
66 /*!
67 * \brief Returns the current time.
68 */
69 virtual double time() = 0;
70
71 /*!
72 * \brief Returns the current frequency in Hz.
73 */
74 virtual double frequency() = 0;
75};
76
77} // namespace satellites
78} // namespace gr
79
80#endif /* INCLUDED_SATELLITES_DOPPLER_CORRECTION_H */
#define SATELLITES_API
Definition: api.h:31
Performs Doppler correction using a frequency vs. time file.
Definition: doppler_correction.h:46
std::shared_ptr< doppler_correction > sptr
Definition: doppler_correction.h:48
static sptr make(std::string &filename, double samp_rate, double t0)
Build the Doppler Correction block.
virtual double time()=0
Returns the current time.
virtual double frequency()=0
Returns the current frequency in Hz.
virtual void set_time(double t)=0
Sets the current time.
data_t t[NROOTS+1]
Definition: lib/libfec/decode_rs.h:83
Definition: ax100_decode.h:17