diff options
Diffstat (limited to 'gr-vocoder/include/gnuradio/vocoder')
5 files changed, 252 insertions, 0 deletions
diff --git a/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt b/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt index 172f18a730..65ec5238a0 100644 --- a/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt +++ b/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt @@ -44,6 +44,15 @@ install(FILES DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder ) endif(LIBCODEC2_FOUND) +if(LIBCODEC2_HAS_FREEDV_API) +install(FILES + freedv_api.h + freedv_rx_ss.h + freedv_tx_ss.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder + COMPONENT "vocoder_devel" +) +endif(LIBCODEC2_HAS_FREEDV_API) if(LIBGSM_FOUND) install(FILES gsm_fr_decode_ps.h diff --git a/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt.orig b/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt.orig new file mode 100644 index 0000000000..172f18a730 --- /dev/null +++ b/gr-vocoder/include/gnuradio/vocoder/CMakeLists.txt.orig @@ -0,0 +1,53 @@ +# Copyright 2012,2013,2016 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# Install header files +######################################################################## +install(FILES + api.h + alaw_decode_bs.h + alaw_encode_sb.h + cvsd_decode_bs.h + cvsd_encode_sb.h + g721_decode_bs.h + g721_encode_sb.h + g723_24_decode_bs.h + g723_24_encode_sb.h + g723_40_decode_bs.h + g723_40_encode_sb.h + ulaw_decode_bs.h + ulaw_encode_sb.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder +) +if(LIBCODEC2_FOUND) +install(FILES + codec2.h + codec2_decode_ps.h + codec2_encode_sp.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder +) +endif(LIBCODEC2_FOUND) +if(LIBGSM_FOUND) +install(FILES + gsm_fr_decode_ps.h + gsm_fr_encode_sp.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/vocoder +) +endif(LIBGSM_FOUND) diff --git a/gr-vocoder/include/gnuradio/vocoder/freedv_api.h b/gr-vocoder/include/gnuradio/vocoder/freedv_api.h new file mode 100644 index 0000000000..230da4e108 --- /dev/null +++ b/gr-vocoder/include/gnuradio/vocoder/freedv_api.h @@ -0,0 +1,68 @@ +/* -*- c++ -*- */ +/* + * Copyright 2016 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef _VOCODER_FREEDV_H_ +#define _VOCODER_FREEDV_H_ + +#include <gnuradio/vocoder/api.h> + +extern "C" { +#include <codec2/codec2.h> +#include <codec2/freedv_api.h> +#include <codec2/modem_stats.h> +} + +namespace gr { + namespace vocoder { + + class VOCODER_API freedv_api { + public: + + enum freedv_modes { +#ifdef FREEDV_MODE_1600 + MODE_1600 = FREEDV_MODE_1600, +#endif +#ifdef FREEDV_MODE_700 + MODE_700 = FREEDV_MODE_700, +#endif +#ifdef FREEDV_MODE_700B + MODE_700B = FREEDV_MODE_700B, +#endif +#ifdef FREEDV_MODE_2400A + MODE_2400A = FREEDV_MODE_2400A, +#endif +#ifdef FREEDV_MODE_2400B + MODE_2400B = FREEDV_MODE_2400B, +#endif +#ifdef FREEDV_MODE_800XA + MODE_800XA = FREEDV_MODE_800XA, +#endif + }; + + private: + + }; + + } /* namespace vocoder */ +} /* namespace gr */ + +#endif /* _VOCODER_FREEDV_H_ */ diff --git a/gr-vocoder/include/gnuradio/vocoder/freedv_rx_ss.h b/gr-vocoder/include/gnuradio/vocoder/freedv_rx_ss.h new file mode 100644 index 0000000000..a6568dee7d --- /dev/null +++ b/gr-vocoder/include/gnuradio/vocoder/freedv_rx_ss.h @@ -0,0 +1,63 @@ +/* -*- c++ -*- */ +/* + * Copyright 2016 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_VOCODER_FREEDV_RX_H +#define INCLUDED_VOCODER_FREEDV_RX_H + +#include <gnuradio/vocoder/api.h> +#include <gnuradio/vocoder/freedv_api.h> +#include <gnuradio/block.h> + +namespace gr { + namespace vocoder { + + /*! + * \brief FreeDV demodulator + * \ingroup audio_blk + * + * Input: 16-bit short values of an audio signal with sampling rate 8 kHz. + * + * Output: 16-bit short values of an audio signal with sampling rate 8 kHz. + * + * See also gr::vocoder::freedv_tx_ss. + */ + class VOCODER_API freedv_rx_ss : virtual public gr::block + { + public: + typedef boost::shared_ptr<freedv_rx_ss> sptr; + + /*! + * \brief Make FreeDV modem demodulator block. + * + * \param mode Operating Mode designation + * \param squelch_thresh FreeDV modem squelch threshold value + */ + static sptr make(int mode=freedv_api::MODE_1600, float squelch_thresh=-100.0); + + virtual void set_squelch_thresh(float squelch_thresh) = 0; + virtual float squelch_thresh() = 0; + }; + + } /* namespace vocoder */ +} /* namespace gr */ + +#endif /* INCLUDED_VOCODER_FREEDV_RX_H */ diff --git a/gr-vocoder/include/gnuradio/vocoder/freedv_tx_ss.h b/gr-vocoder/include/gnuradio/vocoder/freedv_tx_ss.h new file mode 100644 index 0000000000..0e80d78bfb --- /dev/null +++ b/gr-vocoder/include/gnuradio/vocoder/freedv_tx_ss.h @@ -0,0 +1,59 @@ +/* -*- c++ -*- */ +/* + * Copyright 2016 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_VOCODER_FREEDV_TX_H +#define INCLUDED_VOCODER_FREEDV_TX_H + +#include <gnuradio/vocoder/api.h> +#include <gnuradio/vocoder/freedv_api.h> +#include <gnuradio/sync_block.h> + +namespace gr { + namespace vocoder { + + /*! + * \brief FreeDV modulator + * \ingroup audio_blk + * + * Input: Speech (audio) signal as 16-bit shorts, sampling rate 8 kHz. + * + * Output: Signal (audio) as 16-bit shorts, sampling rate 8 kHz. + * + */ + class VOCODER_API freedv_tx_ss : virtual public gr::sync_block + { + public: + typedef boost::shared_ptr<freedv_tx_ss> sptr; + + /*! + * \brief Make FreeDV Modem modulator block. + * + * \param mode Operating Mode designation + * \param msg_txt Low Rate message text (callsign, location) + */ + static sptr make(int mode=freedv_api::MODE_1600,const std::string msg_txt="GNU Radio"); + }; + + } /* namespace vocoder */ +} /* namespace gr */ + +#endif /* INCLUDED_VOCODER_FREEDV_TX_H */ |