~ubuntu-branches/ubuntu/trusty/gnuradio/trusty-updates

« back to all changes in this revision

Viewing changes to gr-digital/include/digital_clock_recovery_mm_ff.h

  • Committer: Package Import Robot
  • Author(s): A. Maitland Bottoms
  • Date: 2012-02-26 21:26:16 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120226212616-vsfkbi1158xshdql
Tags: 3.5.1-1
* new upstream version, re-packaged from scratch with modern tools
    closes: #642716, #645332, #394849, #616832, #590048, #642580,
    #647018, #557050, #559640, #631863
* CMake build

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- c++ -*- */
 
2
/*
 
3
 * Copyright 2004,2011 Free Software Foundation, Inc.
 
4
 *
 
5
 * This file is part of GNU Radio
 
6
 *
 
7
 * GNU Radio 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, or (at your option)
 
10
 * any later version.
 
11
 *
 
12
 * GNU Radio 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 GNU Radio; see the file COPYING.  If not, write to
 
19
 * the Free Software Foundation, Inc., 51 Franklin Street,
 
20
 * Boston, MA 02110-1301, USA.
 
21
 */
 
22
 
 
23
#ifndef INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_FF_H
 
24
#define INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_FF_H
 
25
 
 
26
#include <digital_api.h>
 
27
#include <gr_block.h>
 
28
#include <gr_math.h>
 
29
#include <stdio.h>
 
30
 
 
31
class gri_mmse_fir_interpolator;
 
32
 
 
33
class digital_clock_recovery_mm_ff;
 
34
typedef boost::shared_ptr<digital_clock_recovery_mm_ff> digital_clock_recovery_mm_ff_sptr;
 
35
 
 
36
// public constructor
 
37
DIGITAL_API digital_clock_recovery_mm_ff_sptr 
 
38
digital_make_clock_recovery_mm_ff (float omega, float gain_omega,
 
39
                                   float mu, float gain_mu,
 
40
                                   float omega_relative_limit=0.001);
 
41
 
 
42
/*!
 
43
 * \brief Mueller and Müller (M&M) based clock recovery block with float input, float output.
 
44
 * \ingroup sync_blk
 
45
 * \ingroup digital
 
46
 *
 
47
 * This implements the Mueller and Müller (M&M) discrete-time error-tracking synchronizer.
 
48
 *
 
49
 * See "Digital Communication Receivers: Synchronization, Channel
 
50
 * Estimation and Signal Processing" by Heinrich Meyr, Marc Moeneclaey, & Stefan Fechtel.
 
51
 * ISBN 0-471-50275-8.
 
52
 */
 
53
class DIGITAL_API digital_clock_recovery_mm_ff : public gr_block
 
54
{
 
55
 public:
 
56
  ~digital_clock_recovery_mm_ff ();
 
57
  void forecast(int noutput_items, gr_vector_int &ninput_items_required);
 
58
  int general_work (int noutput_items,
 
59
                    gr_vector_int &ninput_items,
 
60
                    gr_vector_const_void_star &input_items,
 
61
                    gr_vector_void_star &output_items);
 
62
  float mu() const { return d_mu;}
 
63
  float omega() const { return d_omega;}
 
64
  float gain_mu() const { return d_gain_mu;}
 
65
  float gain_omega() const { return d_gain_omega;}
 
66
 
 
67
  void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; }
 
68
  void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; }
 
69
  void set_mu (float mu) { d_mu = mu; }
 
70
  void set_omega (float omega){
 
71
    d_omega = omega;
 
72
    d_min_omega = omega*(1.0 - d_omega_relative_limit);
 
73
    d_max_omega = omega*(1.0 + d_omega_relative_limit);
 
74
    d_omega_mid = 0.5*(d_min_omega+d_max_omega);
 
75
  }
 
76
 
 
77
protected:
 
78
  digital_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
 
79
                           float omega_relative_limit);
 
80
 
 
81
 private:
 
82
  float                         d_mu;           // fractional sample position [0.0, 1.0]
 
83
  float                         d_omega;        // nominal frequency
 
84
  float                         d_min_omega;    // minimum allowed omega 
 
85
  float                         d_omega_mid;    // average omega
 
86
  float                         d_max_omega;    // maximum allowed omega
 
87
  float                         d_gain_omega;   // gain for adjusting omega
 
88
  float                         d_gain_mu;      // gain for adjusting mu
 
89
  float                         d_last_sample;
 
90
  gri_mmse_fir_interpolator     *d_interp;
 
91
  FILE                          *d_logfile;
 
92
  float                         d_omega_relative_limit; // used to compute min and max omega
 
93
 
 
94
  friend DIGITAL_API digital_clock_recovery_mm_ff_sptr
 
95
  digital_make_clock_recovery_mm_ff (float omega, float gain_omega,
 
96
                                     float mu, float gain_mu,
 
97
                                     float omega_relative_limit);
 
98
};
 
99
 
 
100
#endif