GNU Radio 3.5.3.2 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  * \ingroup modulation_blk
00036  *
00037  * \param k                     modulation index
00038  * \param ampl                  output amplitude
00039  * \param samples_per_sym       number of output samples per input bit
00040  */
00041 
00042 class GR_CORE_API gr_cpfsk_bc : public gr_sync_interpolator
00043 {
00044 private:
00045   friend GR_CORE_API gr_cpfsk_bc_sptr gr_make_cpfsk_bc(float k, float ampl, int samples_per_sym);
00046 
00047   gr_cpfsk_bc(float k, float ampl, int samples_per_sym);
00048 
00049   int   d_samples_per_sym;      // Samples per symbol, square pulse
00050   float d_freq;                 // Modulation index*pi/samples_per_sym
00051   float d_ampl;                 // Output amplitude
00052   float d_phase;                // Current phase
00053 
00054  public:
00055   ~gr_cpfsk_bc();
00056 
00057   void set_amplitude(float amplitude) { d_ampl = amplitude; }
00058 
00059   int work (int noutput_items,
00060             gr_vector_const_void_star &input_items,
00061             gr_vector_void_star &output_items);
00062 };
00063 
00064 #endif /* INCLUDED_GR_CPFSK_BC_H */