commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8197 - in gnuradio/branches/developers/jcorgan/ecc/gn


From: jcorgan
Subject: [Commit-gnuradio] r8197 - in gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib: . general
Date: Mon, 14 Apr 2008 23:05:46 -0600 (MDT)

Author: jcorgan
Date: 2008-04-14 23:05:46 -0600 (Mon, 14 Apr 2008)
New Revision: 8197

Added:
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.cc
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.h
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.i
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.h
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.i
Modified:
   gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/Makefile.am
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/Makefile.am
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/general.i
Log:
Initial implementation of GNU Radio wrappers around encoder and decoder.  No 
header file docs or QA code yet.

Modified: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/Makefile.am  
2008-04-14 16:05:10 UTC (rev 8196)
+++ gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/Makefile.am  
2008-04-15 05:05:46 UTC (rev 8197)
@@ -39,6 +39,7 @@
 libgnuradio_core_la_LIBADD  =          \
        filter/libfilter.la             \
        g72x/libccitt.la                \
+       viterbi/libviterbi.la           \
        general/libgeneral.la           \
        gengen/libgengen.la             \
        io/libio.la                     \

Modified: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/Makefile.am
  2008-04-14 16:05:10 UTC (rev 8196)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/Makefile.am
  2008-04-15 05:05:46 UTC (rev 8197)
@@ -59,12 +59,14 @@
        gr_crc32.cc                     \
        gr_ctcss_squelch_ff.cc          \
        gr_dd_mpsk_sync_cc.cc           \
+       gr_decode_ccsds_27_bb.cc        \
        gr_deinterleave.cc              \
        gr_delay.cc                     \
        gr_diff_decoder_bb.cc           \
        gr_diff_encoder_bb.cc           \
        gr_diff_phasor_cc.cc            \
        gr_dpll_bb.cc                   \
+       gr_encode_ccsds_27_bb.cc        \
        gr_fake_channel_coder_pp.cc     \
        gr_fast_atan2f.cc               \
        gr_feedforward_agc_cc.cc        \
@@ -174,8 +176,6 @@
        qa_gr_fxpt_vco.cc               \
        qa_gr_math.cc
 
-
-
 grinclude_HEADERS =                    \
        gr_agc_cc.h                     \
        gr_agc_ff.h                     \
@@ -199,15 +199,17 @@
        gr_costas_loop_cc.h             \
        gr_count_bits.h                 \
        gr_cpfsk_bc.h                   \
-       gr_crc32.h                      \
+       gr_crc32.h                      \
        gr_ctcss_squelch_ff.h           \
        gr_dd_mpsk_sync_cc.h            \
+       gr_decode_ccsds_27_bb.h         \
        gr_diff_decoder_bb.h            \
        gr_diff_encoder_bb.h            \
        gr_deinterleave.h               \
        gr_delay.h                      \
        gr_diff_phasor_cc.h             \
        gr_dpll_bb.h                    \
+       gr_encode_ccsds_27_bb.h         \
        gr_expj.h                       \
        gr_fake_channel_coder_pp.h      \
        gr_feedforward_agc_cc.h         \
@@ -358,12 +360,14 @@
        gr_crc32.i                      \
        gr_ctcss_squelch_ff.i           \
        gr_dd_mpsk_sync_cc.i            \
+       gr_decode_ccsds_27_bb.i         \
        gr_diff_decoder_bb.i            \
        gr_diff_encoder_bb.i            \
        gr_diff_phasor_cc.i             \
        gr_dpll_bb.i                    \
        gr_deinterleave.i               \
        gr_delay.i                      \
+       gr_encode_ccsds_27_bb.i         \
        gr_fake_channel_coder_pp.i      \
        gr_feedforward_agc_cc.i         \
        gr_feval.i                      \

Modified: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/general.i
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/general.i
    2008-04-14 16:05:10 UTC (rev 8196)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/general.i
    2008-04-15 05:05:46 UTC (rev 8197)
@@ -131,6 +131,8 @@
 #include <gr_peak_detector2_fb.h>
 #include <gr_repeat.h>
 #include <gr_cpfsk_bc.h>
+#include <gr_encode_ccsds_27_bb.h>
+#include <gr_decode_ccsds_27_bb.h>
 %}
 
 %include "gr_nop.i"
@@ -242,3 +244,5 @@
 %include "gr_peak_detector2_fb.i"
 %include "gr_repeat.i"
 %include "gr_cpfsk_bc.i"
+%include "gr_encode_ccsds_27_bb.i"
+%include "gr_decode_ccsds_27_bb.i"

Added: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.cc
                             (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.cc
     2008-04-15 05:05:46 UTC (rev 8197)
@@ -0,0 +1,78 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * 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 <gr_decode_ccsds_27_bb.h>
+#include <gr_io_signature.h>
+
+gr_decode_ccsds_27_bb_sptr 
+gr_make_decode_ccsds_27_bb()
+{
+  return gr_decode_ccsds_27_bb_sptr(new gr_decode_ccsds_27_bb());
+}
+
+gr_decode_ccsds_27_bb::gr_decode_ccsds_27_bb()
+  : gr_sync_decimator("decode_ccsds_27_bb",
+                     gr_make_io_signature(1, 1, sizeof(char)),
+                     gr_make_io_signature(1, 1, sizeof(char)),
+                     2*8)  // Rate 1/2 code, unpacked to packed translation
+{
+    float RATE = 0.5;
+    float ebn0 = 12.0;
+    float esn0 = RATE*pow(10.0, ebn0/10);
+
+    gen_met(d_mettab, 100, esn0, 0.0, 4); // TODO: validate
+    viterbi_chunks_init(d_state0);
+}
+
+gr_decode_ccsds_27_bb::~gr_decode_ccsds_27_bb()
+{
+}
+
+int 
+gr_decode_ccsds_27_bb::work(int noutput_items,
+                           gr_vector_const_void_star &input_items,
+                           gr_vector_void_star &output_items)
+{
+  const char *in = (const char *)input_items[0];
+  unsigned char *out = (unsigned char *)output_items[0];
+
+  for (int i = 0; i < noutput_items*16; i++) {
+    d_viterbi_in[d_count % 4] = in[i];
+    
+    if ((d_count % 4) == 3) {
+      // Every fourth symbol, perform butterfly operation
+      viterbi_butterfly2(d_viterbi_in, d_mettab, d_state0, d_state1);
+      
+      // Every sixteenth symbol, read out a byte
+      if (d_count % 16 == 11) {
+       d_metric = viterbi_get_output(d_state0, out++);
+       //printf("metric = %li\n", d_metric);
+      }
+    }
+    
+    d_count++;
+  }
+
+  return noutput_items;
+}

Added: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.h
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.h
      2008-04-15 05:05:46 UTC (rev 8197)
@@ -0,0 +1,59 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * 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_DECODE_CCSDS_27_BB_H
+#define INCLUDED_GR_DECODE_CCSDS_27_BB_H
+
+#include <gr_sync_decimator.h>
+
+extern "C" {
+#include "../viterbi/viterbi.h"
+}
+
+class gr_decode_ccsds_27_bb;
+
+typedef boost::shared_ptr<gr_decode_ccsds_27_bb> gr_decode_ccsds_27_bb_sptr;
+
+gr_decode_ccsds_27_bb_sptr gr_make_decode_ccsds_27_bb();
+
+class gr_decode_ccsds_27_bb : public gr_sync_decimator
+{
+private:
+  friend gr_decode_ccsds_27_bb_sptr gr_make_decode_ccsds_27_bb();
+
+  gr_decode_ccsds_27_bb();
+
+  // Viterbi state
+  int d_mettab[2][256];
+  struct viterbi_state d_state0[64];
+  struct viterbi_state d_state1[64];
+  unsigned char d_viterbi_in[16];
+
+  long d_metric;
+  int d_count;
+      
+ public:
+  ~gr_decode_ccsds_27_bb();
+
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_GR_DECODE_CCSDS_27_BB_H */

Added: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.i
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.i
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.i
      2008-04-15 05:05:46 UTC (rev 8197)
@@ -0,0 +1,31 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,decode_ccsds_27_bb);
+
+gr_decode_ccsds_27_bb_sptr gr_make_decode_ccsds_27_bb ();
+
+class gr_decode_ccsds_27_bb : public gr_sync_decimator
+{
+private:
+  gr_decode_ccsds_27_bb();
+};

Added: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc
                             (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.cc
     2008-04-15 05:05:46 UTC (rev 8197)
@@ -0,0 +1,62 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,2008 Free Software Foundation, Inc.
+ * 
+ * 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 <gr_encode_ccsds_27_bb.h>
+#include <gr_io_signature.h>
+
+extern "C" {
+#include <../viterbi/viterbi.h>
+}
+
+gr_encode_ccsds_27_bb_sptr 
+gr_make_encode_ccsds_27_bb()
+{
+  return gr_encode_ccsds_27_bb_sptr(new gr_encode_ccsds_27_bb());
+}
+
+gr_encode_ccsds_27_bb::gr_encode_ccsds_27_bb()
+  : gr_sync_interpolator("encode_ccsds_27_bb",
+                        gr_make_io_signature(1, 1, sizeof(char)),
+                        gr_make_io_signature(1, 1, sizeof(char)),
+                        16)  // Rate 1/2 code, packed to unpacked conversion
+{
+  d_encstate = 0;
+}
+
+gr_encode_ccsds_27_bb::~gr_encode_ccsds_27_bb()
+{
+}
+
+int 
+gr_encode_ccsds_27_bb::work(int noutput_items,
+                           gr_vector_const_void_star &input_items,
+                           gr_vector_void_star &output_items)
+{
+  unsigned char *in = (unsigned char *)input_items[0];
+  unsigned char *out = (unsigned char *)output_items[0];
+
+  d_encstate = encode(out, in, noutput_items/16, d_encstate);
+
+  return noutput_items;
+}

Added: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.h
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.h
      2008-04-15 05:05:46 UTC (rev 8197)
@@ -0,0 +1,47 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 Free Software Foundation, Inc.
+ * 
+ * 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_ENCODE_CCSDS_27_BB_H
+#define INCLUDED_GR_ENCODE_CCSDS_27_BB_H
+
+#include <gr_sync_interpolator.h>
+
+class gr_encode_ccsds_27_bb;
+
+typedef boost::shared_ptr<gr_encode_ccsds_27_bb> gr_encode_ccsds_27_bb_sptr;
+
+gr_encode_ccsds_27_bb_sptr gr_make_encode_ccsds_27_bb();
+
+class gr_encode_ccsds_27_bb : public gr_sync_interpolator
+{
+private:
+  friend gr_encode_ccsds_27_bb_sptr gr_make_encode_ccsds_27_bb();
+
+  gr_encode_ccsds_27_bb();
+  unsigned char d_encstate;
+  
+ public:
+  ~gr_encode_ccsds_27_bb();
+
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_GR_ENCODE_CCSDS_27_BB_H */

Added: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.i
===================================================================
--- 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.i
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_encode_ccsds_27_bb.i
      2008-04-15 05:05:46 UTC (rev 8197)
@@ -0,0 +1,31 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,encode_ccsds_27_bb);
+
+gr_encode_ccsds_27_bb_sptr gr_make_encode_ccsds_27_bb ();
+
+class gr_encode_ccsds_27_bb : public gr_sync_interpolator
+{
+private:
+  gr_encode_ccsds_27_bb();
+};





reply via email to

[Prev in Thread] Current Thread [Next in Thread]