Statistics
| Branch: | Tag: | Revision:

root / gnuradio-core / src / lib / hier / gr_cpm.h @ 730e550d

History | View | Annotate | Download (2.6 kB)

1
/* -*- c++ -*- */
2
/*
3
 * Copyright 2010 Free Software Foundation, Inc.
4
 * 
5
 * GNU Radio is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 3, or (at your option)
8
 * any later version.
9
 * 
10
 * GNU Radio is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 * 
15
 * You should have received a copy of the GNU General Public License
16
 * along with GNU Radio; see the file COPYING.  If not, write to
17
 * the Free Software Foundation, Inc., 51 Franklin Street,
18
 * Boston, MA 02110-1301, USA.
19
 */
20
21
22
#ifndef INCLUDED_GR_CPM_H
23
#define INCLUDED_GR_CPM_H
24
25
#define M_TWOPI (2*M_PI)
26
27
class gr_cpm
28
{
29
 public:
30
        enum cpm_type {
31
         LRC,
32
         LSRC,
33
         LREC,
34
         TFM,
35
         GAUSSIAN,
36
         GENERIC = 999
37
        };
38
39
        //! Return the taps for an interpolating FIR filter (gr_fir_filter_fff).
40
        //
41
        // These taps represent the phase response for use in a CPM modulator.
42
        //
43
        // Parameters:
44
        // \p type: The CPM type (Rectangular, Raised Cosine, Spectral Raised Cosine,
45
        //          Tamed FM or Gaussian).
46
        // \p samples_per_sym: Samples per symbol.
47
        // \p L: The length of the phase response in symbols.
48
        // \p beta: For Spectral Raised Cosine, this is the rolloff factor. For Gaussian
49
        //          phase responses, this the 3dB-time-bandwidth product. For all other
50
        //          cases, it is ignored.
51
        //
52
        // Output: returns a vector of length \p L * \p samples_per_sym. This can be used
53
        //         directly in an interpolating FIR filter such as gr_interp_fir_filter_fff
54
        //         with interpolation factor \p samples_per_sym.
55
        //
56
        // All taps are normalised s.t. \sum taps = 1; this causes a maximum phase change
57
        // of h*pi between two symbols, where h is the modulation index.
58
        //
59
        // The following phase responses can be generated:
60
        // * LREC: Rectangular phase response.
61
        // * LRC: Raised cosine phase response, looks like 1 - cos(x).
62
        // * LSRC: Spectral raised cosine. This requires a rolloff factor beta.
63
        //         The phase response is the Fourier transform of raised cosine
64
        //         function.
65
        // * TFM: Tamed frequency modulation. This scheme minimizes phase change for
66
        //        rapidly varying input symbols.
67
        // * GAUSSIAN: A Gaussian phase response. For a modulation index h = 1/2, this
68
        //             results in GMSK.
69
        //
70
        static std::vector<float>
71
        phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3);
72
};
73
74
#endif /* INCLUDED_GR_CPM_H */
75