commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8203 - gnuradio/branches/developers/jcorgan/ecc/gnura


From: jcorgan
Subject: [Commit-gnuradio] r8203 - gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general
Date: Tue, 15 Apr 2008 14:22:08 -0600 (MDT)

Author: jcorgan
Date: 2008-04-15 14:22:08 -0600 (Tue, 15 Apr 2008)
New Revision: 8203

Added:
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.h
   
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.i
Removed:
   
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
Modified:
   
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:
Reworked decoder to accept channel symbols and implement soft-decoding.

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-15 19:24:29 UTC (rev 8202)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/Makefile.am
  2008-04-15 20:22:08 UTC (rev 8203)
@@ -59,7 +59,7 @@
        gr_crc32.cc                     \
        gr_ctcss_squelch_ff.cc          \
        gr_dd_mpsk_sync_cc.cc           \
-       gr_decode_ccsds_27_bb.cc        \
+       gr_decode_ccsds_27_fb.cc        \
        gr_deinterleave.cc              \
        gr_delay.cc                     \
        gr_diff_decoder_bb.cc           \
@@ -202,7 +202,7 @@
        gr_crc32.h                      \
        gr_ctcss_squelch_ff.h           \
        gr_dd_mpsk_sync_cc.h            \
-       gr_decode_ccsds_27_bb.h         \
+       gr_decode_ccsds_27_fb.h         \
        gr_diff_decoder_bb.h            \
        gr_diff_encoder_bb.h            \
        gr_deinterleave.h               \
@@ -360,7 +360,7 @@
        gr_crc32.i                      \
        gr_ctcss_squelch_ff.i           \
        gr_dd_mpsk_sync_cc.i            \
-       gr_decode_ccsds_27_bb.i         \
+       gr_decode_ccsds_27_fb.i         \
        gr_diff_decoder_bb.i            \
        gr_diff_encoder_bb.i            \
        gr_diff_phasor_cc.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-15 19:24:29 UTC (rev 8202)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/general.i
    2008-04-15 20:22:08 UTC (rev 8203)
@@ -132,7 +132,7 @@
 #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_decode_ccsds_27_fb.h>
 %}
 
 %include "gr_nop.i"
@@ -245,4 +245,4 @@
 %include "gr_repeat.i"
 %include "gr_cpfsk_bc.i"
 %include "gr_encode_ccsds_27_bb.i"
-%include "gr_decode_ccsds_27_bb.i"
+%include "gr_decode_ccsds_27_fb.i"

Deleted: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.cc

Deleted: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.h

Deleted: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_bb.i

Copied: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
 (from rev 8197, 
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_fb.cc
                             (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.cc
     2008-04-15 20:22:08 UTC (rev 8203)
@@ -0,0 +1,85 @@
+/* -*- 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_fb.h>
+#include <gr_io_signature.h>
+
+gr_decode_ccsds_27_fb_sptr 
+gr_make_decode_ccsds_27_fb()
+{
+  return gr_decode_ccsds_27_fb_sptr(new gr_decode_ccsds_27_fb());
+}
+
+gr_decode_ccsds_27_fb::gr_decode_ccsds_27_fb()
+  : gr_sync_decimator("decode_ccsds_27_fb",
+                     gr_make_io_signature(1, 1, sizeof(float)),
+                     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, 256);
+    viterbi_chunks_init(d_state0);
+}
+
+gr_decode_ccsds_27_fb::~gr_decode_ccsds_27_fb()
+{
+}
+
+int 
+gr_decode_ccsds_27_fb::work(int noutput_items,
+                           gr_vector_const_void_star &input_items,
+                           gr_vector_void_star &output_items)
+{
+  const float *in = (const float *)input_items[0];
+  unsigned char *out = (unsigned char *)output_items[0];
+
+  for (int i = 0; i < noutput_items*16; i++) {
+    // Translate and clip [-1.0..1.0] to [28..228]
+    float sample = in[i]*100.0+128.0;
+    if (sample > 255.0)
+       sample = 255.0;
+    else if (sample < 0.0)
+       sample = 0.0;
+    unsigned char sym = (unsigned char)(floor(sample));
+    
+    d_viterbi_in[d_count % 4] = sym;
+    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("%li\n", *(out-1), d_metric);
+      }
+    }
+    
+    d_count++;
+  }
+
+  return noutput_items;
+}

Copied: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.h
 (from rev 8197, 
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_fb.h
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.h
      2008-04-15 20:22:08 UTC (rev 8203)
@@ -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_FB_H
+#define INCLUDED_GR_DECODE_CCSDS_27_FB_H
+
+#include <gr_sync_decimator.h>
+
+extern "C" {
+#include "../viterbi/viterbi.h"
+}
+
+class gr_decode_ccsds_27_fb;
+
+typedef boost::shared_ptr<gr_decode_ccsds_27_fb> gr_decode_ccsds_27_fb_sptr;
+
+gr_decode_ccsds_27_fb_sptr gr_make_decode_ccsds_27_fb();
+
+class gr_decode_ccsds_27_fb : public gr_sync_decimator
+{
+private:
+  friend gr_decode_ccsds_27_fb_sptr gr_make_decode_ccsds_27_fb();
+
+  gr_decode_ccsds_27_fb();
+
+  // 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_fb();
+
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_GR_DECODE_CCSDS_27_FB_H */

Copied: 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.i
 (from rev 8197, 
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_fb.i
                              (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/ecc/gnuradio-core/src/lib/general/gr_decode_ccsds_27_fb.i
      2008-04-15 20:22:08 UTC (rev 8203)
@@ -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_fb);
+
+gr_decode_ccsds_27_fb_sptr gr_make_decode_ccsds_27_fb ();
+
+class gr_decode_ccsds_27_fb : public gr_sync_decimator
+{
+private:
+  gr_decode_ccsds_27_fb();
+};





reply via email to

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