GNU Radio 3.6.5 C++ API

gr_cpfsk_bc.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008 Free Software Foundation, Inc.
00004  *
00005  * GNU Radio is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 3, or (at your option)
00008  * any later version.
00009  *
00010  * GNU Radio is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with GNU Radio; see the file COPYING.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 #ifndef INCLUDED_GR_CPFSK_BC_H
00021 #define INCLUDED_GR_CPFSK_BC_H
00022 
00023 #include <gr_core_api.h>
00024 #include <gr_sync_interpolator.h>
00025 
00026 class gr_cpfsk_bc;
00027 
00028 typedef boost::shared_ptr<gr_cpfsk_bc> gr_cpfsk_bc_sptr;
00029 
00030 GR_CORE_API gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym);
00031 
00032 /*!
00033  * \brief Perform continuous phase 2-level frequency shift keying modulation
00034  * on an input stream of unpacked bits.
00035  *
00036  * \param k                     modulation index
00037  * \param ampl                  output amplitude
00038  * \param samples_per_sym       number of output samples per input bit
00039  */
00040 
00041 class GR_CORE_API gr_cpfsk_bc : public gr_sync_interpolator
00042 {
00043 private:
00044   friend GR_CORE_API gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym);
00045 
00046   gr_cpfsk_bc(float k, float ampl, int samples_per_sym);
00047 
00048   int   d_samples_per_sym;      // Samples per symbol, square pulse
00049   float d_freq;                 // Modulation index*pi/samples_per_sym
00050   float d_ampl;                 // Output amplitude
00051   float d_phase;                // Current phase
00052 
00053  public:
00054   ~gr_cpfsk_bc();
00055 
00056   void set_amplitude(float amplitude) { d_ampl = amplitude; }
00057 
00058   int work (int noutput_items,
00059             gr_vector_const_void_star &input_items,
00060             gr_vector_void_star &output_items);
00061 };
00062 
00063 #endif /* INCLUDED_GR_CPFSK_BC_H */