[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4580 - gnuradio/branches/developers/n4hy/ofdm/gnuradi
From: |
n4hy |
Subject: |
[Commit-gnuradio] r4580 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general |
Date: |
Wed, 21 Feb 2007 22:01:13 -0700 (MST) |
Author: n4hy
Date: 2007-02-21 22:01:13 -0700 (Wed, 21 Feb 2007)
New Revision: 4580
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.cc
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.h
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.i
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
Log:
dpll sync block added, float 0 or 1 pulses in, float 0 or 1 pulses out
Modified:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
2007-02-22 04:38:18 UTC (rev 4579)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/Makefile.am
2007-02-22 05:01:13 UTC (rev 4580)
@@ -62,6 +62,7 @@
gr_diff_decoder_bb.cc \
gr_diff_encoder_bb.cc \
gr_diff_phasor_cc.cc \
+ gr_dpll_ff.cc \
gr_fake_channel_coder_pp.cc \
gr_fast_atan2f.cc \
gr_feedforward_agc_cc.cc \
@@ -186,6 +187,7 @@
gr_diff_encoder_bb.h \
gr_deinterleave.h \
gr_diff_phasor_cc.h \
+ gr_dpll_ff.h \
gr_expj.h \
gr_fake_channel_coder_pp.h \
gr_feedforward_agc_cc.h \
@@ -322,6 +324,7 @@
gr_diff_decoder_bb.i \
gr_diff_encoder_bb.i \
gr_diff_phasor_cc.i \
+ gr_dpll_ff.i \
gr_deinterleave.i \
gr_fake_channel_coder_pp.i \
gr_feedforward_agc_cc.i \
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.cc
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.cc
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.cc
2007-02-22 05:01:13 UTC (rev 4580)
@@ -0,0 +1,78 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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 2, 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.
+ */
+
+// WARNING: this file is machine generated. Edits will be over written
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_dpll_ff.h>
+#include <gr_io_signature.h>
+
+gr_dpll_ff_sptr
+gr_make_dpll_ff (float period, float gain)
+{
+ return gr_dpll_ff_sptr (new gr_dpll_ff (period, gain));
+}
+
+gr_dpll_ff::gr_dpll_ff (float period, float gain)
+ : gr_sync_block ("dpll_ff",
+ gr_make_io_signature (1, 1, sizeof (float)),
+ gr_make_io_signature (1, 1, sizeof (float))),
+ d_restart(0),d_pulse_phase(0)
+{
+ d_pulse_frequency = 1.0/period;
+ d_gain = gain;
+ d_decision_threshold = 1.0 - 0.5*d_pulse_frequency;
+ set_history(1); // so we can look behind us
+}
+
+int
+gr_dpll_ff::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ float *iptr = (float *) input_items[0];
+ float *optr = (float *) output_items[0];
+
+ for (int i = 0; i < noutput_items; i++){
+ optr[i]= (float)0;
+ if(iptr[i] ==(float)1) {
+ if (d_restart == 0) {
+ d_pulse_phase = 1;
+ d_restart += 2;
+ } else {
+ if (d_restart == 1) d_restart+=1;
+ if (d_pulse_phase > 0.5) d_pulse_phase += d_gain*(1.0-d_pulse_phase);
+ else d_pulse_phase -= d_gain*d_pulse_phase;
+ }
+ }
+ if (d_pulse_phase > d_decision_threshold) {
+ d_pulse_phase -= 1.0;
+ if (d_restart > 0) d_restart -= 1;
+ optr[i] = (float)1;
+ }
+ d_pulse_phase += d_pulse_frequency;
+ }
+ return noutput_items;
+}
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.h
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.h
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.h
2007-02-22 05:01:13 UTC (rev 4580)
@@ -0,0 +1,59 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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 2, 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.
+ */
+
+// WARNING: this file is machine generated. Edits will be over written
+
+#ifndef INCLUDED_GR_DPLL_FF_H
+#define INCLUDED_GR_DPLL_FF_H
+
+#include <gr_sync_block.h>
+
+class gr_dpll_ff;
+typedef boost::shared_ptr<gr_dpll_ff> gr_dpll_ff_sptr;
+
+gr_dpll_ff_sptr gr_make_dpll_ff (float period, float gain);
+
+/*!
+ * \brief Detect the peak of a signal
+ * \ingroup block
+ *
+ * If a peak is detected, this block outputs a 1,
+ * or it outputs 0's.
+ */
+class gr_dpll_ff : public gr_sync_block
+{
+ friend gr_dpll_ff_sptr gr_make_dpll_ff (float period, float gain);
+
+ gr_dpll_ff (float period, float gain);
+
+ private:
+ unsigned char d_restart;
+ float d_pulse_phase, d_pulse_frequency,d_gain,d_decision_threshold;
+
+ public:
+
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif
Added:
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.i
===================================================================
---
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.i
(rev 0)
+++
gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general/gr_dpll_ff.i
2007-02-22 05:01:13 UTC (rev 4580)
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004 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 2, 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.
+ */
+
+// WARNING: this file is machine generated. Edits will be over written
+
+GR_SWIG_BLOCK_MAGIC(gr,dpll_ff)
+
+ gr_dpll_ff_sptr gr_make_dpll_ff (float period, float gain);
+
+class gr_dpll_ff : public gr_sync_block
+{
+ private:
+ gr_dpll_ff (float period, float gain);
+};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4580 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-core/src/lib/general,
n4hy <=