commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8993 - gnuradio/trunk/gnuradio-core/src/lib/general


From: matt
Subject: [Commit-gnuradio] r8993 - gnuradio/trunk/gnuradio-core/src/lib/general
Date: Thu, 24 Jul 2008 00:08:02 -0600 (MDT)

Author: matt
Date: 2008-07-24 00:08:01 -0600 (Thu, 24 Jul 2008)
New Revision: 8993

Added:
   gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc
   gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.h
   gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.i
Modified:
   gnuradio/trunk/gnuradio-core/src/lib/general/Makefile.am
Log:
first cut at iq imbalance compensation


Modified: gnuradio/trunk/gnuradio-core/src/lib/general/Makefile.am
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/Makefile.am    2008-07-24 
01:09:43 UTC (rev 8992)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/Makefile.am    2008-07-24 
06:08:01 UTC (rev 8993)
@@ -87,6 +87,7 @@
        gr_head.cc                      \
        gr_interleave.cc                \
        gr_interleaved_short_to_complex.cc \
+       gr_iqcomp_cc.cc                 \
        gr_keep_one_in_n.cc             \
        gr_kludge_copy.cc               \
        gr_lfsr_32k_source_s.cc         \
@@ -233,6 +234,7 @@
        gr_head.h                       \
        gr_interleave.h                 \
        gr_interleaved_short_to_complex.h \
+       gr_iqcomp_cc.h                  \
        gr_keep_one_in_n.h              \
        gr_kludge_copy.h                \
        gr_lfsr_32k_source_s.h          \
@@ -387,6 +389,7 @@
        gr_head.i                       \
        gr_interleave.i                 \
        gr_interleaved_short_to_complex.i \
+       gr_iqcomp_cc.i                  \
        gr_keep_one_in_n.i              \
        gr_kludge_copy.i                \
        gr_lfsr_32k_source_s.i          \

Added: gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc                
                (rev 0)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.cc        
2008-07-24 06:08:01 UTC (rev 8993)
@@ -0,0 +1,61 @@
+/* -*- 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.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_iqcomp_cc.h>
+#include <gr_io_signature.h>
+
+gr_iqcomp_cc_sptr
+gr_make_iqcomp_cc (float mu)
+{
+  return gr_iqcomp_cc_sptr (new gr_iqcomp_cc (mu));
+}
+
+gr_iqcomp_cc::gr_iqcomp_cc (float mu)
+  : gr_sync_block ("iqcomp_cc",
+                  gr_make_io_signature (1, 1, sizeof (gr_complex)),
+                  gr_make_io_signature (1, 1, sizeof (gr_complex))),
+    d_mu (mu)
+{
+  float d_wi=0.0, d_wq=0.0;
+}
+
+int
+gr_iqcomp_cc::work (int noutput_items,
+                  gr_vector_const_void_star &input_items,
+                  gr_vector_void_star &output_items)
+{
+  const gr_complex *iptr = (gr_complex *) input_items[0];
+  gr_complex *optr = (gr_complex *) output_items[0];
+
+  for(int i = 0 ; i < noutput_items ; i++) {
+    float i_out = iptr[i].real() - iptr[i].imag() * d_wq;
+    float q_out = iptr[i].imag() - iptr[i].real() * d_wi;
+    d_wi += d_mu * q_out * iptr[i].real();
+    d_wq += d_mu * i_out * iptr[i].imag();
+  }
+  return noutput_items;
+}

Added: gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.h
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.h                 
        (rev 0)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.h 2008-07-24 
06:08:01 UTC (rev 8993)
@@ -0,0 +1,54 @@
+/* -*- 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 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_IQCOMP_CC_H
+#define INCLUDED_GR_IQCOMP_CC_H
+
+#include <gr_sync_block.h>
+
+class gr_iqcomp_cc;
+typedef boost::shared_ptr<gr_iqcomp_cc> gr_iqcomp_cc_sptr;
+
+gr_iqcomp_cc_sptr gr_make_iqcomp_cc (float mu);
+
+/*!
+ * \brief 
+ * \ingroup 
+ */
+class gr_iqcomp_cc : public gr_sync_block
+{
+  friend gr_iqcomp_cc_sptr gr_make_iqcomp_cc (float mu);
+
+  float        d_mu, d_wi, d_wq;
+  gr_iqcomp_cc (float mu);
+
+ public:
+  float mu () const { return d_mu; }
+  void set_mu (float mu) { d_mu = mu; }
+
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+};
+
+#endif

Added: gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.i
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.i                 
        (rev 0)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_iqcomp_cc.i 2008-07-24 
06:08:01 UTC (rev 8993)
@@ -0,0 +1,36 @@
+/* -*- 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,iqcomp_cc)
+
+gr_iqcomp_cc_sptr gr_make_iqcomp_cc (float mu);
+
+class gr_iqcomp_cc : public gr_sync_block
+{
+ private:
+  gr_iqcomp_cc (float mu);
+
+ public:
+  float mu () const { return d_mu; }
+  void set_mu (float mu) { d_mu = mu; }
+};





reply via email to

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