[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5694 - gnuradio/branches/features/ofdm/sync/gnuradio-
From: |
trondeau |
Subject: |
[Commit-gnuradio] r5694 - gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general |
Date: |
Tue, 5 Jun 2007 13:35:42 -0600 (MDT) |
Author: trondeau
Date: 2007-06-05 13:35:41 -0600 (Tue, 05 Jun 2007)
New Revision: 5694
Added:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.cc
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.h
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.i
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/Makefile.am
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/general.i
Log:
Adding regenerate block that outputs a signal every period samples and resets
its start time based on an input signalling line
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/Makefile.am
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/Makefile.am
2007-06-05 19:33:58 UTC (rev 5693)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/Makefile.am
2007-06-05 19:35:41 UTC (rev 5694)
@@ -121,6 +121,7 @@
gr_pwr_squelch_ff.cc \
gr_quadrature_demod_cf.cc \
gr_random.cc \
+ gr_regenerate_bb.cc \
gr_remez.cc \
gr_reverse.cc \
gr_rms_cf.cc \
@@ -260,6 +261,7 @@
gr_pwr_squelch_ff.h \
gr_quadrature_demod_cf.h \
gr_random.h \
+ gr_regenerate_bb.h \
gr_remez.h \
gr_reverse.h \
gr_rms_cf.h \
@@ -399,6 +401,7 @@
gr_pwr_squelch_cc.i \
gr_pwr_squelch_ff.i \
gr_quadrature_demod_cf.i \
+ gr_regenerate_bb.i \
gr_remez.i \
gr_rms_cf.i \
gr_rms_ff.i \
Modified:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/general.i
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/general.i
2007-06-05 19:33:58 UTC (rev 5693)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/general.i
2007-06-05 19:35:41 UTC (rev 5694)
@@ -99,6 +99,7 @@
#include <gr_ofdm_bpsk_mapper.h>
#include <gr_ofdm_frame_sink.h>
#include <gr_ofdm_sampler.h>
+#include <gr_regenerate_bb.h>
#include <gr_costas_loop_cc.h>
#include <gr_pa_2x2_phase_combiner.h>
#include <gr_kludge_copy.h>
@@ -202,6 +203,7 @@
%include "gr_ofdm_bpsk_mapper.i"
%include "gr_ofdm_frame_sink.i"
%include "gr_ofdm_sampler.i"
+%include "gr_regenerate_bb.i"
%include "gr_costas_loop_cc.i"
%include "gr_pa_2x2_phase_combiner.i"
%include "gr_kludge_copy.i"
Added:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.cc
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.cc
(rev 0)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.cc
2007-06-05 19:35:41 UTC (rev 5694)
@@ -0,0 +1,67 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_regenerate_bb.h>
+#include <gr_io_signature.h>
+
+gr_regenerate_bb_sptr
+gr_make_regenerate_bb (int period)
+{
+ return gr_regenerate_bb_sptr (new gr_regenerate_bb (period));
+}
+
+gr_regenerate_bb::gr_regenerate_bb (int period)
+ : gr_sync_block ("regenerate_bb",
+ gr_make_io_signature (1, 1, sizeof (char)),
+ gr_make_io_signature (1, 1, sizeof (char))),
+ d_period(period)
+{
+}
+
+int
+gr_regenerate_bb::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const char *iptr = (const char *) input_items[0];
+ char *optr = (char *) output_items[0];
+
+ for (int i = 0; i < noutput_items; i++){
+ optr[i] = 0;
+ d_countdown--;
+
+ if(iptr[i] == 1) {
+ d_countdown = d_period;
+ optr[i] = 1;
+ }
+
+ if(d_countdown == 0) {
+ optr[i] = 1;
+ d_countdown = d_period;
+ }
+ }
+ return noutput_items;
+}
Added:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.h
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.h
(rev 0)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.h
2007-06-05 19:35:41 UTC (rev 5694)
@@ -0,0 +1,57 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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.
+ */
+
+#ifndef INCLUDED_GR_REGENERATE_BB_H
+#define INCLUDED_GR_REGENERATE_BB_H
+
+#include <gr_sync_block.h>
+
+class gr_regenerate_bb;
+typedef boost::shared_ptr<gr_regenerate_bb> gr_regenerate_bb_sptr;
+
+gr_regenerate_bb_sptr gr_make_regenerate_bb (int period);
+
+/*!
+ * \brief Detect the peak of a signal
+ * \ingroup block
+ *
+ * If a peak is detected, this block outputs a 1 repeated every period samples
+ * until reset by detection of another 1 on the input
+ */
+class gr_regenerate_bb : public gr_sync_block
+{
+ friend gr_regenerate_bb_sptr gr_make_regenerate_bb (int period);
+
+ gr_regenerate_bb (int period);
+
+ private:
+ int d_period;
+ int d_countdown;
+
+ public:
+
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif
Added:
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.i
===================================================================
---
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.i
(rev 0)
+++
gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general/gr_regenerate_bb.i
2007-06-05 19:35:41 UTC (rev 5694)
@@ -0,0 +1,31 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,regenerate_bb)
+
+gr_regenerate_bb_sptr gr_make_regenerate_bb (int period);
+
+class gr_regenerate_bb : public gr_sync_block
+{
+ private:
+ gr_regenerate_bb (int period);
+};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5694 - gnuradio/branches/features/ofdm/sync/gnuradio-core/src/lib/general,
trondeau <=