Revision 35fd5072 gr-digital/lib/digital_constellation_receiver_cb.h

b/gr-digital/lib/digital_constellation_receiver_cb.h
25 25

26 26
#include <gr_block.h>
27 27
#include <digital_constellation.h>
28
#include <gri_control_loop.h>
28 29
#include <gr_complex.h>
29 30
#include <math.h>
30 31
#include <fstream>
......
63 64
 *
64 65
 */
65 66

66
class digital_constellation_receiver_cb : public gr_block
67
class digital_constellation_receiver_cb : public gr_block, public gri_control_loop
67 68
{
68 69
 public:
69 70
  int general_work (int noutput_items,
......
71 72
		    gr_vector_const_void_star &input_items,
72 73
		    gr_vector_void_star &output_items);
73 74

74

75
  /*******************************************************************
76
    SET FUNCTIONS
77
  *******************************************************************/  
78

79
  /*!
80
   * \brief Set the loop bandwidth
81
   *
82
   * Set the loop filter's bandwidth to \p bw. This should be between 
83
   * 2*pi/200 and 2*pi/100  (in rads/samp). It must also be a positive
84
   * number.
85
   *
86
   * When a new damping factor is set, the gains, alpha and beta, of the loop
87
   * are recalculated by a call to update_gains().
88
   *
89
   * \param bw    (float) new bandwidth
90
   *
91
   */
92
  void set_loop_bandwidth(float bw);
93

94
  /*!
95
   * \brief Set the loop damping factor
96
   *
97
   * Set the loop filter's damping factor to \p df. The damping factor
98
   * should be sqrt(2)/2.0 for critically damped systems.
99
   * Set it to anything else only if you know what you are doing. It must
100
   * be a number between 0 and 1.
101
   *
102
   * When a new damping factor is set, the gains, alpha and beta, of the loop
103
   * are recalculated by a call to update_gains().
104
   *
105
   * \param df    (float) new damping factor
106
   *
107
   */
108
  void set_damping_factor(float df);
109

110
  /*!
111
   * \brief Set the loop gain alpha
112
   *
113
   * Set's the loop filter's alpha gain parameter.
114
   *
115
   * This value should really only be set by adjusting the loop bandwidth
116
   * and damping factor.
117
   *
118
   * \param alpha    (float) new alpha gain
119
   *
120
   */
121
  void set_alpha(float alpha);
122

123
  /*!
124
   * \brief Set the loop gain beta
125
   *
126
   * Set's the loop filter's beta gain parameter.
127
   *
128
   * This value should really only be set by adjusting the loop bandwidth
129
   * and damping factor.
130
   *
131
   * \param beta    (float) new beta gain
132
   *
133
   */
134
  void set_beta(float beta);
135

136
  /*!
137
   * \brief Set the phase/freq recovery loop's frequency.
138
   *
139
   * Set's the phase/freq recovery loop's frequency. While this is normally
140
   * updated by the inner loop of the algorithm, it could be useful to
141
   * manually initialize, set, or reset this under certain circumstances.
142
   *
143
   * \param freq    (float) new frequency
144
   *
145
   */
146
  void set_frequency(float freq);
147

148
  /*!
149
   * \brief Set the phase/freq recovery loop's phase.
150
   *
151
   * Set's the phase/freq recovery loop's phase. While this is normally
152
   * updated by the inner loop of the algorithm, it could be useful to
153
   * manually initialize, set, or reset this under certain circumstances.
154
   *
155
   * \param phase    (float) new phase
156
   *
157
   */
158
  void set_phase(float phase);
159

160
  /*******************************************************************
161
    GET FUNCTIONS
162
  *******************************************************************/
163

164
  /*!
165
   * \brief Returns the loop bandwidth
166
   */
167
  float get_loop_bandwidth() const;
168

169
  /*!
170
   * \brief Returns the loop damping factor
171
   */
172
  float get_damping_factor() const;
173

174
  /*!
175
   * \brief Returns the loop gain alpha
176
   */
177
  float get_alpha() const;
178

179
  /*!
180
   * \brief Returns the loop gain beta
181
   */
182
  float get_beta() const;
183

184
  /*!
185
   * \brief Get the phase/freq recovery loop's frequency estimate
186
   */
187
  float get_frequency() const;
188

189
  /*!
190
   * \brief Get the phase/freq loop's phase estimate
191
   */
192
  float get_phase() const;
193

194 75
protected:
195 76

196 77
 /*!
......
213 94
  private:
214 95
  unsigned int d_M;
215 96

216
  // Members related to carrier and phase tracking
217
  float d_freq, d_max_freq, d_min_freq;
218
  float d_phase;
219

220
  float d_loop_bw;
221
  float d_damping;
222
  float d_alpha;
223
  float d_beta;
224

225 97
  digital_constellation_sptr d_constellation;
226 98
  unsigned int d_current_const_point;
227 99

Also available in: Unified diff