summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-08-13 22:38:45 -0400
committerTom Rondeau <trondeau@vt.edu>2012-08-13 22:38:45 -0400
commit509fddb30a70862b31b0488acfbbdf523b48af0d (patch)
tree4a2394338c6f5d7681d45d30603d0a34510d8e9d
parent719ebae8fb75635f1291e21b74af69cbdefe4837 (diff)
digital: converted scrambler code to new style.
-rw-r--r--gr-digital/include/digital/CMakeLists.txt4
-rw-r--r--gr-digital/include/digital/additive_scrambler_bb.h2
-rw-r--r--gr-digital/include/digital/descrambler_bb.h55
-rw-r--r--gr-digital/include/digital/scrambler_bb.h56
-rw-r--r--gr-digital/include/digital_descrambler_bb.h62
-rw-r--r--gr-digital/include/digital_scrambler_bb.h62
-rw-r--r--gr-digital/lib/CMakeLists.txt4
-rw-r--r--gr-digital/lib/additive_scrambler_bb_impl.h2
-rw-r--r--gr-digital/lib/descrambler_bb_impl.cc68
-rw-r--r--gr-digital/lib/descrambler_bb_impl.h (renamed from gr-digital/swig/digital_descrambler_bb.i)31
-rw-r--r--gr-digital/lib/digital_descrambler_bb.cc56
-rw-r--r--gr-digital/lib/digital_scrambler_bb.cc57
-rw-r--r--gr-digital/lib/scrambler_bb_impl.cc68
-rw-r--r--gr-digital/lib/scrambler_bb_impl.h (renamed from gr-digital/swig/digital_scrambler_bb.i)32
-rw-r--r--gr-digital/swig/digital_swig.i6
-rw-r--r--grc/blocks/gr_pfb_clock_sync.xml100
-rw-r--r--grc/blocks/gr_pfb_synthesizer.xml57
17 files changed, 310 insertions, 412 deletions
diff --git a/gr-digital/include/digital/CMakeLists.txt b/gr-digital/include/digital/CMakeLists.txt
index 231c130034..7d8545b185 100644
--- a/gr-digital/include/digital/CMakeLists.txt
+++ b/gr-digital/include/digital/CMakeLists.txt
@@ -91,7 +91,7 @@ install(FILES
correlate_access_code_tag_bb.h
costas_loop_cc.h
# crc32.h
-# descrambler_bb.h
+ descrambler_bb.h
diff_decoder_bb.h
diff_encoder_bb.h
diff_phasor_cc.h
@@ -118,7 +118,7 @@ install(FILES
pn_correlator_cc.h
# probe_density_b.h
# probe_mpsk_snr_est_c.h
-# scrambler_bb.h
+ scrambler_bb.h
# simple_framer.h
# simple_framer_sync.h
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/digital
diff --git a/gr-digital/include/digital/additive_scrambler_bb.h b/gr-digital/include/digital/additive_scrambler_bb.h
index b5689b2744..345bd45dc8 100644
--- a/gr-digital/include/digital/additive_scrambler_bb.h
+++ b/gr-digital/include/digital/additive_scrambler_bb.h
@@ -59,7 +59,7 @@ namespace gr {
* processed, the shift register is reset to the seed value.
* This allows processing fixed length vectors of samples.
*/
- static sptr make(int mask, int seed, int len, int count);
+ static sptr make(int mask, int seed, int len, int count=0);
virtual int mask() const = 0;
virtual int seed() const = 0;
diff --git a/gr-digital/include/digital/descrambler_bb.h b/gr-digital/include/digital/descrambler_bb.h
new file mode 100644
index 0000000000..225a06b3c8
--- /dev/null
+++ b/gr-digital/include/digital/descrambler_bb.h
@@ -0,0 +1,55 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,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_GR_DESCRAMBLER_BB_H
+#define INCLUDED_GR_DESCRAMBLER_BB_H
+
+#include <digital/api.h>
+#include <gr_sync_block.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * Descramble an input stream using an LFSR. This block works on
+ * the LSB only of the input data stream, i.e., on an "unpacked
+ * binary" stream, and produces the same format on its output.
+ *
+ * \param mask Polynomial mask for LFSR
+ * \param seed Initial shift register contents
+ * \param len Shift register length
+ *
+ * \ingroup coding_blk
+ */
+ class DIGITAL_API descrambler_bb : virtual public gr_sync_block
+ {
+ public:
+ // gr::digital::descrambler_bb::sptr
+ typedef boost::shared_ptr<descrambler_bb> sptr;
+
+ static sptr make(int mask, int seed, int len);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_GR_DESCRAMBLER_BB_H */
diff --git a/gr-digital/include/digital/scrambler_bb.h b/gr-digital/include/digital/scrambler_bb.h
new file mode 100644
index 0000000000..78db6e4b39
--- /dev/null
+++ b/gr-digital/include/digital/scrambler_bb.h
@@ -0,0 +1,56 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,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_GR_SCRAMBLER_BB_H
+#define INCLUDED_GR_SCRAMBLER_BB_H
+
+#include <digital/api.h>
+#include <gr_sync_block.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * Scramble an input stream using an LFSR. This block works on
+ * the LSB only of the input data stream, i.e., on an "unpacked
+ * binary" stream, and produces the same format on its output.
+ *
+ * \param mask Polynomial mask for LFSR
+ * \param seed Initial shift register contents
+ * \param len Shift register length
+ *
+ * \ingroup coding_blk
+ */
+
+ class DIGITAL_API scrambler_bb : virtual public gr_sync_block
+ {
+ public:
+ // gr::digital::scrambler_bb::sptr
+ typedef boost::shared_ptr<scrambler_bb> sptr;
+
+ static sptr make(int mask, int seed, int len);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_GR_SCRAMBLER_BB_H */
diff --git a/gr-digital/include/digital_descrambler_bb.h b/gr-digital/include/digital_descrambler_bb.h
deleted file mode 100644
index b719803f33..0000000000
--- a/gr-digital/include/digital_descrambler_bb.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,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_GR_DESCRAMBLER_BB_H
-#define INCLUDED_GR_DESCRAMBLER_BB_H
-
-#include <digital_api.h>
-#include <gr_sync_block.h>
-#include "gri_lfsr.h"
-
-class digital_descrambler_bb;
-typedef boost::shared_ptr<digital_descrambler_bb> digital_descrambler_bb_sptr;
-
-DIGITAL_API digital_descrambler_bb_sptr
-digital_make_descrambler_bb(int mask, int seed, int len);
-
-/*!
- * Descramble an input stream using an LFSR. This block works on the LSB only
- * of the input data stream, i.e., on an "unpacked binary" stream, and
- * produces the same format on its output.
- *
- * \param mask Polynomial mask for LFSR
- * \param seed Initial shift register contents
- * \param len Shift register length
- *
- * \ingroup coding_blk
- */
-
-class DIGITAL_API digital_descrambler_bb : public gr_sync_block
-{
- friend DIGITAL_API digital_descrambler_bb_sptr
- digital_make_descrambler_bb(int mask, int seed, int len);
-
- gri_lfsr d_lfsr;
-
- digital_descrambler_bb(int mask, int seed, int len);
-
-public:
- int work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif /* INCLUDED_GR_DESCRAMBLER_BB_H */
diff --git a/gr-digital/include/digital_scrambler_bb.h b/gr-digital/include/digital_scrambler_bb.h
deleted file mode 100644
index d6f08dcc83..0000000000
--- a/gr-digital/include/digital_scrambler_bb.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,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_GR_SCRAMBLER_BB_H
-#define INCLUDED_GR_SCRAMBLER_BB_H
-
-#include <digital_api.h>
-#include <gr_sync_block.h>
-#include "gri_lfsr.h"
-
-class digital_scrambler_bb;
-typedef boost::shared_ptr<digital_scrambler_bb> digital_scrambler_bb_sptr;
-
-DIGITAL_API digital_scrambler_bb_sptr
-digital_make_scrambler_bb(int mask, int seed, int len);
-
-/*!
- * Scramble an input stream using an LFSR. This block works on the LSB only
- * of the input data stream, i.e., on an "unpacked binary" stream, and
- * produces the same format on its output.
- *
- * \param mask Polynomial mask for LFSR
- * \param seed Initial shift register contents
- * \param len Shift register length
- *
- * \ingroup coding_blk
- */
-
-class DIGITAL_API digital_scrambler_bb : public gr_sync_block
-{
- friend DIGITAL_API digital_scrambler_bb_sptr
- digital_make_scrambler_bb(int mask, int seed, int len);
-
- gri_lfsr d_lfsr;
-
- digital_scrambler_bb(int mask, int seed, int len);
-
-public:
- int work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif /* INCLUDED_GR_SCRAMBLER_BB_H */
diff --git a/gr-digital/lib/CMakeLists.txt b/gr-digital/lib/CMakeLists.txt
index 441ec50e3f..937964a3db 100644
--- a/gr-digital/lib/CMakeLists.txt
+++ b/gr-digital/lib/CMakeLists.txt
@@ -118,7 +118,7 @@ list(APPEND digital_sources
costas_loop_cc_impl.cc
#cpmmod_bc_impl.cc
#crc32_impl.cc
- #descrambler_bb_impl.cc
+ descrambler_bb_impl.cc
diff_decoder_bb_impl.cc
diff_encoder_bb_impl.cc
diff_phasor_cc_impl.cc
@@ -144,7 +144,7 @@ list(APPEND digital_sources
pn_correlator_cc_impl.cc
#probe_density_b_impl.cc
#probe_mpsk_snr_est_c_impl.cc
- #scrambler_bb_impl.cc
+ scrambler_bb_impl.cc
#simple_framer_impl.cc
)
diff --git a/gr-digital/lib/additive_scrambler_bb_impl.h b/gr-digital/lib/additive_scrambler_bb_impl.h
index f094840bfd..e2dfbc342b 100644
--- a/gr-digital/lib/additive_scrambler_bb_impl.h
+++ b/gr-digital/lib/additive_scrambler_bb_impl.h
@@ -41,7 +41,7 @@ namespace gr {
public:
additive_scrambler_bb_impl(int mask, int seed,
- int len, int count);
+ int len, int count=0);
~additive_scrambler_bb_impl();
int mask() const;
diff --git a/gr-digital/lib/descrambler_bb_impl.cc b/gr-digital/lib/descrambler_bb_impl.cc
new file mode 100644
index 0000000000..8124df37ef
--- /dev/null
+++ b/gr-digital/lib/descrambler_bb_impl.cc
@@ -0,0 +1,68 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2010,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 "descrambler_bb_impl.h"
+#include <gr_io_signature.h>
+
+namespace gr {
+ namespace digital {
+
+ descrambler_bb::sptr
+ descrambler_bb::make(int mask, int seed, int len)
+ {
+ return gnuradio::get_initial_sptr
+ (new descrambler_bb_impl(mask, seed, len));
+ }
+
+ descrambler_bb_impl::descrambler_bb_impl(int mask, int seed, int len)
+ : gr_sync_block("descrambler_bb",
+ gr_make_io_signature(1, 1, sizeof(unsigned char)),
+ gr_make_io_signature(1, 1, sizeof(unsigned char))),
+ d_lfsr(mask, seed, len)
+ {
+ }
+
+ descrambler_bb_impl::~descrambler_bb_impl()
+ {
+ }
+
+ int
+ descrambler_bb_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+ {
+ const unsigned char *in = (const unsigned char*)input_items[0];
+ unsigned char *out = (unsigned char*)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++) {
+ out[i] = d_lfsr.next_bit_descramble(in[i]);
+ }
+
+ return noutput_items;
+ }
+
+ } /* namespace digital */
+} /* namespace gr */
diff --git a/gr-digital/swig/digital_descrambler_bb.i b/gr-digital/lib/descrambler_bb_impl.h
index 59de806fba..920182304a 100644
--- a/gr-digital/swig/digital_descrambler_bb.i
+++ b/gr-digital/lib/descrambler_bb_impl.h
@@ -20,11 +20,30 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(digital,descrambler_bb);
+#ifndef INCLUDED_GR_DESCRAMBLER_BB_IMPL_H
+#define INCLUDED_GR_DESCRAMBLER_BB_IMPL_H
-digital_descrambler_bb_sptr
-digital_make_descrambler_bb(int mask, int seed, int len);
+#include <digital/descrambler_bb.h>
+#include <gri_lfsr.h>
-class digital_descrambler_bb : public gr_sync_block
-{
-};
+namespace gr {
+ namespace digital {
+
+ class descrambler_bb_impl : public descrambler_bb
+ {
+ private:
+ gri_lfsr d_lfsr;
+
+ public:
+ descrambler_bb_impl(int mask, int seed, int len);
+ ~descrambler_bb_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_GR_DESCRAMBLER_BB_IMPL_H */
diff --git a/gr-digital/lib/digital_descrambler_bb.cc b/gr-digital/lib/digital_descrambler_bb.cc
deleted file mode 100644
index 68cba7145e..0000000000
--- a/gr-digital/lib/digital_descrambler_bb.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2010,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 <digital_descrambler_bb.h>
-#include <gr_io_signature.h>
-
-digital_descrambler_bb_sptr
-digital_make_descrambler_bb(int mask, int seed, int len)
-{
- return gnuradio::get_initial_sptr(new digital_descrambler_bb(mask, seed, len));
-}
-
-digital_descrambler_bb::digital_descrambler_bb(int mask, int seed, int len)
- : gr_sync_block("descrambler_bb",
- gr_make_io_signature (1, 1, sizeof (unsigned char)),
- gr_make_io_signature (1, 1, sizeof (unsigned char))),
- d_lfsr(mask, seed, len)
-{
-}
-
-int
-digital_descrambler_bb::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- const unsigned char *in = (const unsigned char *) input_items[0];
- unsigned char *out = (unsigned char *) output_items[0];
-
- for (int i = 0; i < noutput_items; i++)
- out[i] = d_lfsr.next_bit_descramble(in[i]);
-
- return noutput_items;
-}
diff --git a/gr-digital/lib/digital_scrambler_bb.cc b/gr-digital/lib/digital_scrambler_bb.cc
deleted file mode 100644
index c81b09d8c3..0000000000
--- a/gr-digital/lib/digital_scrambler_bb.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2010,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 <digital_scrambler_bb.h>
-#include <gr_io_signature.h>
-
-digital_scrambler_bb_sptr
-digital_make_scrambler_bb(int mask, int seed, int len)
-{
- return gnuradio::get_initial_sptr(new digital_scrambler_bb
- (mask, seed, len));
-}
-
-digital_scrambler_bb::digital_scrambler_bb(int mask, int seed, int len)
- : gr_sync_block("scrambler_bb",
- gr_make_io_signature (1, 1, sizeof (unsigned char)),
- gr_make_io_signature (1, 1, sizeof (unsigned char))),
- d_lfsr(mask, seed, len)
-{
-}
-
-int
-digital_scrambler_bb::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- const unsigned char *in = (const unsigned char *) input_items[0];
- unsigned char *out = (unsigned char *) output_items[0];
-
- for (int i = 0; i < noutput_items; i++)
- out[i] = d_lfsr.next_bit_scramble(in[i]);
-
- return noutput_items;
-}
diff --git a/gr-digital/lib/scrambler_bb_impl.cc b/gr-digital/lib/scrambler_bb_impl.cc
new file mode 100644
index 0000000000..d656fe2430
--- /dev/null
+++ b/gr-digital/lib/scrambler_bb_impl.cc
@@ -0,0 +1,68 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008,2010,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 "scrambler_bb_impl.h"
+#include <gr_io_signature.h>
+
+namespace gr {
+ namespace digital {
+
+ scrambler_bb::sptr
+ scrambler_bb::make(int mask, int seed, int len)
+ {
+ return gnuradio::get_initial_sptr
+ (new scrambler_bb_impl(mask, seed, len));
+ }
+
+ scrambler_bb_impl::scrambler_bb_impl(int mask, int seed, int len)
+ : gr_sync_block("scrambler_bb",
+ gr_make_io_signature(1, 1, sizeof(unsigned char)),
+ gr_make_io_signature(1, 1, sizeof(unsigned char))),
+ d_lfsr(mask, seed, len)
+ {
+ }
+
+ scrambler_bb_impl::~scrambler_bb_impl()
+ {
+ }
+
+ int
+ scrambler_bb_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+ {
+ const unsigned char *in = (const unsigned char*)input_items[0];
+ unsigned char *out = (unsigned char*)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++) {
+ out[i] = d_lfsr.next_bit_scramble(in[i]);
+ }
+
+ return noutput_items;
+ }
+
+ } /* namespace digital */
+} /* namespace gr */
diff --git a/gr-digital/swig/digital_scrambler_bb.i b/gr-digital/lib/scrambler_bb_impl.h
index ac9abef920..4a93901c92 100644
--- a/gr-digital/swig/digital_scrambler_bb.i
+++ b/gr-digital/lib/scrambler_bb_impl.h
@@ -20,11 +20,31 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(digital,scrambler_bb);
+#ifndef INCLUDED_GR_SCRAMBLER_BB_IMPL_H
+#define INCLUDED_GR_SCRAMBLER_BB_IMPL_H
-digital_scrambler_bb_sptr
-digital_make_scrambler_bb(int mask, int seed, int len);
+#include <digital/scrambler_bb.h>
+#include <gr_sync_block.h>
+#include <gri_lfsr.h>
-class digital_scrambler_bb : public gr_sync_block
-{
-};
+namespace gr {
+ namespace digital {
+
+ class scrambler_bb_impl : public scrambler_bb
+ {
+ private:
+ gri_lfsr d_lfsr;
+
+ public:
+ scrambler_bb_impl(int mask, int seed, int len);
+ ~scrambler_bb_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_GR_SCRAMBLER_BB_IMPL_H */
diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i
index 3598c58683..60da49da93 100644
--- a/gr-digital/swig/digital_swig.i
+++ b/gr-digital/swig/digital_swig.i
@@ -58,6 +58,7 @@
#include "digital/correlate_access_code_bb.h"
#include "digital/correlate_access_code_tag_bb.h"
#include "digital/costas_loop_cc.h"
+#include "digital/descrambler_bb.h"
#include "digital/diff_decoder_bb.h"
#include "digital/diff_encoder_bb.h"
#include "digital/diff_phasor_cc.h"
@@ -68,6 +69,7 @@
#include "digital/pfb_clock_sync_ccf.h"
#include "digital/pfb_clock_sync_fff.h"
#include "digital/pn_correlator_cc.h"
+#include "digital/scrambler_bb.h"
%}
%include "digital/additive_scrambler_bb.h"
@@ -87,6 +89,7 @@
%include "digital/correlate_access_code_bb.h"
%include "digital/correlate_access_code_tag_bb.h"
%include "digital/costas_loop_cc.h"
+%include "digital/descrambler_bb.h"
%include "digital/diff_decoder_bb.h"
%include "digital/diff_encoder_bb.h"
%include "digital/diff_phasor_cc.h"
@@ -97,6 +100,7 @@
%include "digital/pfb_clock_sync_ccf.h"
%include "digital/pfb_clock_sync_fff.h"
%include "digital/pn_correlator_cc.h"
+%include "digital/scrambler_bb.h"
GR_SWIG_BLOCK_MAGIC2(digital, additive_scrambler_bb);
GR_SWIG_BLOCK_MAGIC2(digital, binary_slicer_fb);
@@ -114,6 +118,7 @@ GR_SWIG_BLOCK_MAGIC2(digital, constellation_decoder_cb);
GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_bb);
GR_SWIG_BLOCK_MAGIC2(digital, correlate_access_code_tag_bb);
GR_SWIG_BLOCK_MAGIC2(digital, costas_loop_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, descrambler_bb);
GR_SWIG_BLOCK_MAGIC2(digital, diff_decoder_bb);
GR_SWIG_BLOCK_MAGIC2(digital, diff_encoder_bb);
GR_SWIG_BLOCK_MAGIC2(digital, diff_phasor_cc);
@@ -124,6 +129,7 @@ GR_SWIG_BLOCK_MAGIC2(digital, map_bb);
GR_SWIG_BLOCK_MAGIC2(digital, pfb_clock_sync_ccf);
GR_SWIG_BLOCK_MAGIC2(digital, pfb_clock_sync_fff);
GR_SWIG_BLOCK_MAGIC2(digital, pn_correlator_cc);
+GR_SWIG_BLOCK_MAGIC2(digital, scrambler_bb);
// Properly package up constellation objects
%include "constellation.i"
diff --git a/grc/blocks/gr_pfb_clock_sync.xml b/grc/blocks/gr_pfb_clock_sync.xml
deleted file mode 100644
index 3e5e65d127..0000000000
--- a/grc/blocks/gr_pfb_clock_sync.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-## Polyphase Filter based Clock Sync
-###################################################
- -->
-<block>
- <name>Polyphase Clock Sync</name>
- <key>gr_pfb_clock_sync_xxx</key>
- <import>from gnuradio import gr</import>
- <make>gr.pfb_clock_sync_$(type)($sps, $alpha, $taps, $filter_size, $init_phase, $max_dev, $osps)
-self.$(id).set_beta($beta)</make>
- <callback>set_taps($taps)</callback>
- <callback>set_alpha($alpha)</callback>
- <callback>set_beta($beta)</callback>
-
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>Complex->Complex (Real Taps)</name>
- <key>ccf</key>
- <opt>input:complex</opt>
- <opt>output:complex</opt>
- <opt>taps:real_vector</opt>
- </option>
- <option>
- <name>Float->Float (Real Taps)</name>
- <key>fff</key>
- <opt>input:float</opt>
- <opt>output:float</opt>
- <opt>taps:real_vector</opt>
- </option>
- </param>
-
- <param>
- <name>Samples/Symbol</name>
- <key>sps</key>
- <type>real</type>
- </param>
- <param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
- <type>real</type>
- </param>
- <param>
- <name>Taps</name>
- <key>taps</key>
- <type>real_vector</type>
- </param>
- <param>
- <name>Filter Size</name>
- <key>filter_size</key>
- <type>int</type>
- </param>
- <param>
- <name>Initial Phase</name>
- <key>init_phase</key>
- <type>real</type>
- </param>
- <param>
- <name>Maximum Rate Deviation</name>
- <key>max_dev</key>
- <type>real</type>
- </param>
- <param>
- <name>Output SPS</name>
- <key>osps</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>$type.input</type>
- </sink>
- <source>
- <name>out</name>
- <type>$type.output</type>
- </source>
- <source>
- <name>err</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>rate</name>
- <type>float</type>
- <optional>1</optional>
- </source>
- <source>
- <name>phase</name>
- <type>float</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/grc/blocks/gr_pfb_synthesizer.xml b/grc/blocks/gr_pfb_synthesizer.xml
deleted file mode 100644
index 49e5cb0321..0000000000
--- a/grc/blocks/gr_pfb_synthesizer.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Polyphase Synthesis Filterbank
-###################################################
- -->
-<block>
- <name>Polyphase Synthesizer</name>
- <key>gr_pfb_synthesizer_ccf</key>
- <import>from gnuradio import gr</import>
- <import>from gnuradio.gr import firdes</import>
- <make>gr.pfb_synthesizer_ccf(
- $numchans, $taps, $twox)
-self.$(id).set_channel_map($ch_map)
- </make>
- <callback>set_taps($taps)</callback>
- <callback>set_channel_map($ch_map)</callback>
-
- <param>
- <name>Channels</name>
- <key>numchans</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Connections</name>
- <key>connections</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Taps</name>
- <key>taps</key>
- <type>real_vector</type>
- </param>
- <param>
- <name>2x Sample Rate</name>
- <key>twox</key>
- <value>False</value>
- <type>bool</type>
- </param>
- <param>
- <name>Channel Map</name>
- <key>ch_map</key>
- <value>[]</value>
- <type>int_vector</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- <nports>$connections</nports>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>