diff options
Diffstat (limited to 'gr-noaa/lib')
-rw-r--r-- | gr-noaa/lib/Makefile.am | 4 | ||||
-rw-r--r-- | gr-noaa/lib/noaa_hrpt_sync_fb.cc (renamed from gr-noaa/lib/noaa_hrpt_sync_ff.cc) | 25 | ||||
-rw-r--r-- | gr-noaa/lib/noaa_hrpt_sync_fb.h (renamed from gr-noaa/lib/noaa_hrpt_sync_ff.h) | 22 |
3 files changed, 27 insertions, 24 deletions
diff --git a/gr-noaa/lib/Makefile.am b/gr-noaa/lib/Makefile.am index 913638783..1b758871a 100644 --- a/gr-noaa/lib/Makefile.am +++ b/gr-noaa/lib/Makefile.am @@ -30,7 +30,7 @@ lib_LTLIBRARIES = \ libgnuradio_noaa_la_SOURCES = \ noaa_hrpt_pll_cf.cc \ - noaa_hrpt_sync_ff.cc + noaa_hrpt_sync_fb.cc libgnuradio_noaa_la_LIBADD = \ $(GNURADIO_CORE_LA) @@ -39,4 +39,4 @@ libgnuradio_noaa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 grinclude_HEADERS = \ noaa_hrpt_pll_cf.h \ - noaa_hrpt_sync_ff.h + noaa_hrpt_sync_fb.h diff --git a/gr-noaa/lib/noaa_hrpt_sync_ff.cc b/gr-noaa/lib/noaa_hrpt_sync_fb.cc index f17ad54dc..f99947f82 100644 --- a/gr-noaa/lib/noaa_hrpt_sync_ff.cc +++ b/gr-noaa/lib/noaa_hrpt_sync_fb.cc @@ -24,7 +24,7 @@ #include "config.h" #endif -#include <noaa_hrpt_sync_ff.h> +#include <noaa_hrpt_sync_fb.h> #include <gr_io_signature.h> inline int signum(float f) @@ -32,16 +32,16 @@ inline int signum(float f) return f >= 0.0 ? 1 : -1; } -noaa_hrpt_sync_ff_sptr -noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset) +noaa_hrpt_sync_fb_sptr +noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset) { - return gnuradio::get_initial_sptr(new noaa_hrpt_sync_ff(alpha, beta, sps, max_offset)); + return gnuradio::get_initial_sptr(new noaa_hrpt_sync_fb(alpha, beta, sps, max_offset)); } -noaa_hrpt_sync_ff::noaa_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset) - : gr_block("noaa_hrpt_sync_ff", +noaa_hrpt_sync_fb::noaa_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset) + : gr_block("noaa_hrpt_sync_fb", gr_make_io_signature(1, 1, sizeof(float)), - gr_make_io_signature(1, 1, sizeof(float))), + gr_make_io_signature(1, 1, sizeof(char))), d_alpha(alpha), d_beta(beta), d_sps(sps), d_max_offset(max_offset), d_phase(0.0), d_freq(1.0/sps), @@ -50,14 +50,14 @@ noaa_hrpt_sync_ff::noaa_hrpt_sync_ff(float alpha, float beta, float sps, float m } int -noaa_hrpt_sync_ff::general_work(int noutput_items, +noaa_hrpt_sync_fb::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 float *in = (const float *) input_items[0]; - float *out = (float *) output_items[0]; + const float *in = (const float *)input_items[0]; + char *out = (char *)output_items[0]; int i = 0, j = 0; while (i < ninputs && j < noutput_items) { @@ -77,7 +77,10 @@ noaa_hrpt_sync_ff::general_work(int noutput_items, } if (d_phase > 1.0) { - out[j++] = -sample; // Invert sense, -68 degrees=1 + if (sample < 0.0) + out[j++] = 1; + else + out[j++] = 0; d_phase -= 1.0; } } diff --git a/gr-noaa/lib/noaa_hrpt_sync_ff.h b/gr-noaa/lib/noaa_hrpt_sync_fb.h index 51502698b..a9416b9ea 100644 --- a/gr-noaa/lib/noaa_hrpt_sync_ff.h +++ b/gr-noaa/lib/noaa_hrpt_sync_fb.h @@ -20,21 +20,21 @@ * Boston, MA 02110-1301, USA. */ -#ifndef INCLUDED_NOAA_HRPT_SYNC_FF_H -#define INCLUDED_NOAA_HRPT_SYNC_FF_H +#ifndef INCLUDED_NOAA_HRPT_SYNC_FB_H +#define INCLUDED_NOAA_HRPT_SYNC_FB_H -#include <gr_sync_block.h> +#include <gr_block.h> -class noaa_hrpt_sync_ff; -typedef boost::shared_ptr<noaa_hrpt_sync_ff> noaa_hrpt_sync_ff_sptr; +class noaa_hrpt_sync_fb; +typedef boost::shared_ptr<noaa_hrpt_sync_fb> noaa_hrpt_sync_fb_sptr; -noaa_hrpt_sync_ff_sptr -noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); +noaa_hrpt_sync_fb_sptr +noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset); -class noaa_hrpt_sync_ff : public gr_block +class noaa_hrpt_sync_fb : public gr_block { - friend noaa_hrpt_sync_ff_sptr noaa_make_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); - noaa_hrpt_sync_ff(float alpha, float beta, float sps, float max_offset); + friend noaa_hrpt_sync_fb_sptr noaa_make_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset); + noaa_hrpt_sync_fb(float alpha, float beta, float sps, float max_offset); float d_alpha; // 1st order loop constant float d_beta; // 2nd order loop constant @@ -55,4 +55,4 @@ class noaa_hrpt_sync_ff : public gr_block void set_max_offset(float max_offset) { d_max_offset = max_offset; } }; -#endif /* INCLUDED_NOAA_HRPT_SYNC_FF_H */ +#endif /* INCLUDED_NOAA_HRPT_SYNC_FB_H */ |