diff options
Diffstat (limited to 'gr-noaa/lib')
-rw-r--r-- | gr-noaa/lib/CMakeLists.txt | 92 | ||||
-rw-r--r-- | gr-noaa/lib/gnuradio-noaa.rc.in | 55 | ||||
-rw-r--r-- | gr-noaa/lib/hrpt_decoder_impl.cc | 206 | ||||
-rw-r--r-- | gr-noaa/lib/hrpt_decoder_impl.h | 75 | ||||
-rw-r--r-- | gr-noaa/lib/hrpt_deframer_impl.cc | 137 | ||||
-rw-r--r-- | gr-noaa/lib/hrpt_deframer_impl.h | 58 | ||||
-rw-r--r-- | gr-noaa/lib/hrpt_pll_cf_impl.cc | 93 | ||||
-rw-r--r-- | gr-noaa/lib/hrpt_pll_cf_impl.h | 56 |
8 files changed, 0 insertions, 772 deletions
diff --git a/gr-noaa/lib/CMakeLists.txt b/gr-noaa/lib/CMakeLists.txt deleted file mode 100644 index d8db07d922..0000000000 --- a/gr-noaa/lib/CMakeLists.txt +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright 2011-2013 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. - -######################################################################## -# Setup the include and linker paths -######################################################################## -include_directories( - ${GR_NOAA_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${LOG4CPP_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - -link_directories(${Boost_LIBRARY_DIRS}) -link_directories(${LOG4CPP_LIBRARY_DIRS}) - -if(ENABLE_GR_CTRLPORT) - ADD_DEFINITIONS(-DGR_CTRLPORT) -endif(ENABLE_GR_CTRLPORT) - -######################################################################## -# Setup library -######################################################################## -list(APPEND noaa_sources - hrpt_decoder_impl.cc - hrpt_deframer_impl.cc - hrpt_pll_cf_impl.cc -) - -#Add Windows DLL resource file if using MSVC -if(MSVC) - include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake) - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-noaa.rc.in - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-noaa.rc - @ONLY) - - list(APPEND gr_noaa_sources - ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-noaa.rc - ) -endif(MSVC) - -list(APPEND noaa_libs - gnuradio-runtime - ${Boost_LIBRARIES} - ${LOG4CPP_LIBRARIES} -) - -add_library(gnuradio-noaa SHARED ${noaa_sources}) -target_link_libraries(gnuradio-noaa ${noaa_libs}) -GR_LIBRARY_FOO(gnuradio-noaa RUNTIME_COMPONENT "noaa_runtime" DEVEL_COMPONENT "noaa_devel") - -if(ENABLE_STATIC_LIBS) - if(ENABLE_GR_CTRLPORT) - # Remove GR_CTRLPORT set this target's definitions. - # Makes sure we don't try to use ControlPort stuff in source files - GET_DIRECTORY_PROPERTY(STATIC_DEFS COMPILE_DEFINITIONS) - list(REMOVE_ITEM STATIC_DEFS "GR_CTRLPORT") - SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS "${STATIC_DEFS}") - - # readd it to the target since we removed it from the directory-wide list. - SET_PROPERTY(TARGET gnuradio-noaa APPEND PROPERTY COMPILE_DEFINITIONS "GR_CTRLPORT") - endif(ENABLE_GR_CTRLPORT) - - add_library(gnuradio-noaa_static STATIC ${noaa_sources}) - - if(NOT WIN32) - set_target_properties(gnuradio-noaa_static - PROPERTIES OUTPUT_NAME gnuradio-noaa) - endif(NOT WIN32) - - install(TARGETS gnuradio-noaa_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "noaa_devel" # .lib file - ) -endif(ENABLE_STATIC_LIBS) diff --git a/gr-noaa/lib/gnuradio-noaa.rc.in b/gr-noaa/lib/gnuradio-noaa.rc.in deleted file mode 100644 index 2f19f110b7..0000000000 --- a/gr-noaa/lib/gnuradio-noaa.rc.in +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2013 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. - */ - -#include <afxres.h> - -VS_VERSION_INFO VERSIONINFO - FILEVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - PRODUCTVERSION @MAJOR_VERSION@,@API_COMPAT@,@RC_MINOR_VERSION@,@RC_MAINT_VERSION@ - FILEFLAGSMASK 0x3fL -#ifndef NDEBUG - FILEFLAGS 0x0L -#else - FILEFLAGS 0x1L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_DRV_INSTALLABLE - BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "gnuradio-noaa" - VALUE "FileVersion", "@VERSION@" - VALUE "InternalName", "gnuradio-noaa.dll" - VALUE "LegalCopyright", "Licensed under GPLv3 or any later version" - VALUE "OriginalFilename", "gnuradio-noaa.dll" - VALUE "ProductName", "gnuradio-noaa" - VALUE "ProductVersion", "@VERSION@" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END - END diff --git a/gr-noaa/lib/hrpt_decoder_impl.cc b/gr-noaa/lib/hrpt_decoder_impl.cc deleted file mode 100644 index dc7b8f0ec2..0000000000 --- a/gr-noaa/lib/hrpt_decoder_impl.cc +++ /dev/null @@ -1,206 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "hrpt_decoder_impl.h" -#include <gnuradio/noaa/hrpt.h> -#include <gnuradio/io_signature.h> -#include <cstdio> - -namespace gr { - namespace noaa { - - static const char *hrpt_ids[] = { - "000000", - "NOAA11", - "000002", - "NOAA16", - "000004", - "000005", - "000006", - "NOAA15", - "000008", - "NOAA12", - "000010", - "NOAA17", - "000012", - "NOAA18", - "000014", - "NOAA19" - }; - - hrpt_decoder::sptr - hrpt_decoder::make(bool verbose, bool output_files) - { - return gnuradio::get_initial_sptr - (new hrpt_decoder_impl(verbose, output_files)); - } - - hrpt_decoder_impl::hrpt_decoder_impl(bool verbose, bool output_files) - : sync_block("noaa_hrpt_decoder", - io_signature::make(1, 1, sizeof(short)), - io_signature::make(0, 0, 0)), - d_verbose(verbose), - d_output_files(output_files), - d_word_num(0), - d_frames_seen(0), - d_current_mfnum(0), - d_expected_mfnum(0), - d_seq_errs(0), - d_address(0), - d_day_of_year(0), - d_milliseconds(0), - d_last_time(0) - { - // Start of capture processing here - } - - hrpt_decoder_impl::~hrpt_decoder_impl() - { - // End of capture processing here - - if(d_verbose) { - fprintf(stderr, "Frames seen: %10i\n", d_frames_seen); - fprintf(stderr, "Sequence errors: %10i\n", d_seq_errs); - } - } - - int - hrpt_decoder_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const unsigned short *in = (const unsigned short*)input_items[0]; - - int i = 0; - while(i < noutput_items) { - d_current_word = in[i++] & 0x3FF; - d_word_num++; - - // Per HRPT word processing here - - switch(d_word_num) { - case 7: - process_mfnum(); - process_address(); - break; - - case 9: - process_day_of_year(); - break; - - case 10: - process_milli1(); - break; - - case 11: - process_milli2(); - break; - - case 12: - process_milli3(); - break; - - default: - break; - } - - if(d_word_num == HRPT_MINOR_FRAME_WORDS) { - // End of minor frame processing here - d_frames_seen++; - d_word_num = 0; - fprintf(stderr, "\n"); - } - } - - return i; - } - - void - hrpt_decoder_impl::process_mfnum() - { - d_current_mfnum = (d_current_word & 0x180) >> 7; - - if(d_verbose) - fprintf(stderr, "MF:"); - - if(d_current_mfnum != d_expected_mfnum && d_frames_seen > 0) { - d_seq_errs++; - - if(d_verbose) - fprintf(stderr, "*"); - } - else - if(d_verbose) - fprintf(stderr, " "); - - if(d_verbose) - fprintf(stderr, "%i ", d_current_mfnum); - d_expected_mfnum = (d_current_mfnum == 3) ? 1 : d_current_mfnum+1; - } - - void - hrpt_decoder_impl::process_address() - { - d_address = ((d_current_word & 0x078) >> 3) & 0x000F; - - if(d_verbose) - fprintf(stderr, "SA: %s ", hrpt_ids[d_address]); - } - - void - hrpt_decoder_impl::process_day_of_year() - { - d_day_of_year = d_current_word >> 1; - - if(d_verbose) - fprintf(stderr, "DOY: %3i ", d_day_of_year); - } - - void - hrpt_decoder_impl::process_milli1() - { - d_milliseconds = (d_current_word & 0x7F) << 20; - } - - void - hrpt_decoder_impl::process_milli2() - { - d_milliseconds |= (d_current_word << 10); - } - - void - hrpt_decoder_impl::process_milli3() - { - d_milliseconds |= d_current_word; - int delta = d_milliseconds - d_last_time; - d_last_time = d_milliseconds; - - if(d_verbose) - fprintf(stderr, "MS: %8i DT: %8i", d_milliseconds, delta); - } - - } /* namespace noaa */ -} /* namespace gr */ diff --git a/gr-noaa/lib/hrpt_decoder_impl.h b/gr-noaa/lib/hrpt_decoder_impl.h deleted file mode 100644 index 9a43c98acd..0000000000 --- a/gr-noaa/lib/hrpt_decoder_impl.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 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_NOAA_HRPT_DECODER_IMPL_H -#define INCLUDED_NOAA_HRPT_DECODER_IMPL_H - -#include <gnuradio/noaa/hrpt_decoder.h> - -namespace gr { - namespace noaa { - - class hrpt_decoder_impl : public hrpt_decoder - { - private: - // Configuration - bool d_verbose; - bool d_output_files; - - // Frame-level state - unsigned short d_current_word; - unsigned int d_word_num; - int d_frames_seen; - - // Minor frame number - int d_current_mfnum; - int d_expected_mfnum; - int d_seq_errs; - - // Spacecraft address - int d_address; - - // Minor frame timestamp - int d_day_of_year; - int d_milliseconds; - int d_last_time; - - void process_mfnum(); - void process_address(); - void process_day_of_year(); - void process_milli1(); - void process_milli2(); - void process_milli3(); - - public: - hrpt_decoder_impl(bool verbose, bool output_files); - ~hrpt_decoder_impl(); - - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_DECODER_IMPL_H */ diff --git a/gr-noaa/lib/hrpt_deframer_impl.cc b/gr-noaa/lib/hrpt_deframer_impl.cc deleted file mode 100644 index 65bff09adb..0000000000 --- a/gr-noaa/lib/hrpt_deframer_impl.cc +++ /dev/null @@ -1,137 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "hrpt_deframer_impl.h" -#include <gnuradio/io_signature.h> -#include <gnuradio/noaa/hrpt.h> -#include <cstring> -#include <cstdio> - -namespace gr { - namespace noaa { - -#define ST_IDLE 0 -#define ST_SYNCED 1 - - hrpt_deframer::sptr - hrpt_deframer::make() - { - return gnuradio::get_initial_sptr - (new hrpt_deframer_impl()); - } - - hrpt_deframer_impl::hrpt_deframer_impl() - : block("noaa_hrpt_deframer", - io_signature::make(1, 1, sizeof(char)), - io_signature::make(1, 1, sizeof(short))) - { - set_output_multiple(6); // room for writing full sync when received - d_mid_bit = true; - d_last_bit = 0; - enter_idle(); - } - - hrpt_deframer_impl::~hrpt_deframer_impl() - { - } - - void - hrpt_deframer_impl::enter_idle() - { - d_state = ST_IDLE; - } - - void - hrpt_deframer_impl::enter_synced() - { - d_state = ST_SYNCED; - d_bit_count = HRPT_BITS_PER_WORD; - d_word_count = HRPT_MINOR_FRAME_WORDS-HRPT_SYNC_WORDS; - d_word = 0; - } - - int - hrpt_deframer_impl::general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - int ninputs = ninput_items[0]; - const char *in = (const char *)input_items[0]; - unsigned short *out = (unsigned short *)output_items[0]; - - int i = 0, j = 0; - while(i < ninputs && j < noutput_items) { - char bit = in[i++]; - char diff = bit^d_last_bit; - d_last_bit = bit; - - // Wait for transition if not synced, otherwise, alternate bits - if(d_mid_bit && (diff | (d_state == ST_SYNCED))) { - switch(d_state) { - case ST_IDLE: - d_shifter = (d_shifter << 1) | bit; // MSB transmitted first - - if((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) { - out[j++] = HRPT_SYNC1; - out[j++] = HRPT_SYNC2; - out[j++] = HRPT_SYNC3; - out[j++] = HRPT_SYNC4; - out[j++] = HRPT_SYNC5; - out[j++] = HRPT_SYNC6; - enter_synced(); - } - break; - - case ST_SYNCED: - d_word = (d_word << 1) | bit; // MSB transmitted first - if(--d_bit_count == 0) { - out[j++] = d_word; - d_word = 0; - d_bit_count = HRPT_BITS_PER_WORD; - if(--d_word_count == 0) { - enter_idle(); - } - } - break; - - default: - throw std::runtime_error("hrpt_deframer_impl: bad state\n"); - } - - d_mid_bit = false; - } - else { - d_mid_bit = true; - } - } - - consume_each(i); - return j; - } - - } /* namespace noaa */ -} /* namespace gr */ diff --git a/gr-noaa/lib/hrpt_deframer_impl.h b/gr-noaa/lib/hrpt_deframer_impl.h deleted file mode 100644 index d654f9f606..0000000000 --- a/gr-noaa/lib/hrpt_deframer_impl.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 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_NOAA_HRPT_DEFRAMER_IMPL_H -#define INCLUDED_NOAA_HRPT_DEFRAMER_IMPL_H - -#include <gnuradio/noaa/hrpt_deframer.h> - -namespace gr { - namespace noaa { - - class hrpt_deframer_impl : public hrpt_deframer - { - private: - unsigned int d_state; - bool d_mid_bit; - unsigned char d_last_bit; - unsigned int d_bit_count; - unsigned int d_word_count; - unsigned long long d_shifter; // 60 bit sync word - unsigned short d_word; // 10 bit HRPT word - - void enter_idle(); - void enter_synced(); - - public: - hrpt_deframer_impl(); - ~hrpt_deframer_impl(); - - int general_work(int noutput_items, - gr_vector_int &ninput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_DEFRAMER_IMPL_H */ diff --git a/gr-noaa/lib/hrpt_pll_cf_impl.cc b/gr-noaa/lib/hrpt_pll_cf_impl.cc deleted file mode 100644 index 26376be351..0000000000 --- a/gr-noaa/lib/hrpt_pll_cf_impl.cc +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "hrpt_pll_cf_impl.h" -#include <gnuradio/io_signature.h> -#include <gnuradio/math.h> -#include <gnuradio/sincos.h> - -namespace gr { - namespace noaa { - -#define M_TWOPI (2*M_PI) - - float - phase_wrap(float phase) - { - while (phase < -M_PI) - phase += M_TWOPI; - while (phase > M_PI) - phase -= M_TWOPI; - - return phase; - } - - hrpt_pll_cf::sptr - hrpt_pll_cf::make(float alpha, float beta, float max_offset) - { - return gnuradio::get_initial_sptr - (new hrpt_pll_cf_impl(alpha, beta, max_offset)); - } - - hrpt_pll_cf_impl::hrpt_pll_cf_impl(float alpha, float beta, float max_offset) - : sync_block("noaa_hrpt_pll_cf", - io_signature::make(1, 1, sizeof(gr_complex)), - io_signature::make(1, 1, sizeof(float))), - d_alpha(alpha), d_beta(beta), d_max_offset(max_offset), - d_phase(0.0), d_freq(0.0) - { - } - - hrpt_pll_cf_impl::~hrpt_pll_cf_impl() - { - } - - int - hrpt_pll_cf_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - const gr_complex *in = (const gr_complex *)input_items[0]; - float *out = (float *)output_items[0]; - - for(int i = 0; i < noutput_items; i++) { - - // Generate and mix out carrier - float re, im; - gr::sincosf(d_phase, &im, &re); - out[i] = (in[i]*gr_complex(re, -im)).imag(); - - // Adjust PLL phase/frequency - float error = phase_wrap(gr::fast_atan2f(in[i].imag(), in[i].real()) - d_phase); - d_freq = gr::branchless_clip(d_freq + error*d_beta, d_max_offset); - d_phase = phase_wrap(d_phase + error*d_alpha + d_freq); - } - - return noutput_items; - } - - } /* namespace noaa */ -} /* namespace gr */ diff --git a/gr-noaa/lib/hrpt_pll_cf_impl.h b/gr-noaa/lib/hrpt_pll_cf_impl.h deleted file mode 100644 index 40b0a21459..0000000000 --- a/gr-noaa/lib/hrpt_pll_cf_impl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009,2012 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_NOAA_HRPT_PLL_CF_IMPL_H -#define INCLUDED_NOAA_HRPT_PLL_CF_IMPL_H - -#include <gnuradio/noaa/hrpt_pll_cf.h> - -namespace gr { - namespace noaa { - - class hrpt_pll_cf_impl : public hrpt_pll_cf - { - private: - float d_alpha; // 1st order loop constant - float d_beta; // 2nd order loop constant - float d_max_offset; // Maximum frequency offset, radians/sample - float d_phase; // Instantaneous carrier phase - float d_freq; // Instantaneous carrier frequency, radians/sample - - public: - hrpt_pll_cf_impl(float alpha, float beta, float max_offset); - ~hrpt_pll_cf_impl(); - - virtual int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); - - void set_alpha(float alpha) { d_alpha = alpha; } - void set_beta(float beta) { d_beta = beta; } - void set_max_offset(float max_offset) { d_max_offset = max_offset; } - }; - - } /* namespace noaa */ -} /* namespace gr */ - -#endif /* INCLUDED_NOAA_HRPT_PLL_CF_IMPL_H */ |