commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r9702 - gnuradio/branches/developers/n4hy/pfb_fbs/gnur


From: n4hy
Subject: [Commit-gnuradio] r9702 - gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general
Date: Thu, 2 Oct 2008 15:59:16 -0600 (MDT)

Author: n4hy
Date: 2008-10-02 15:59:15 -0600 (Thu, 02 Oct 2008)
New Revision: 9702

Added:
   
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.cc
   
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.h
   
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.i
Log:
new fm detector computing frequency directly from the approximate derivative of 
atan(Q/I) using the five term derivative formula.

Added: 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.cc
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.cc
                              (rev 0)
+++ 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.cc
      2008-10-02 21:59:15 UTC (rev 9702)
@@ -0,0 +1,85 @@
+/* -*- 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.
+ */
+
+// WARNING: this file is machine generated.  Edits will be over written
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_fmdet_cf.h>
+#include <gr_io_signature.h>
+#include <math.h>
+#include <gr_math.h>
+
+#define M_TWOPI (2*M_PI)
+
+gr_fmdet_cf_sptr
+gr_make_fmdet_cf (float samplerate)
+{
+  return gr_fmdet_cf_sptr (new gr_fmdet_cf (samplerate));
+}
+
+gr_fmdet_cf::gr_fmdet_cf (float samplerate)
+  : gr_sync_block ("fmdet_cf",
+                  gr_make_io_signature (1, 1, sizeof (gr_complex)),
+                  gr_make_io_signature (1, 1, sizeof (float))),
+    d_S0(0),d_S1(0),d_S2(0),
+    d_S3(0),d_S4(0),d_twelveDeltaT(12.0/samplerate)
+
+{
+}
+
+
+
+int
+gr_fmdet_cf::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];
+  float *optr = (float *) output_items[0];
+
+  int  size = noutput_items;
+
+  gr_complex Sdot;
+
+  while (size-- > 0) {
+    d_S0=*iptr++;
+
+    Sdot = gr_complex(d_twelveDeltaT*
+                     (-d_S0.real() + 8.0*d_S1.real() - 8.0*d_S3.real() + 
d_S4.real()),
+                     d_twelveDeltaT*
+                     (-d_S0.imag() + 8.0*d_S1.imag() - 8.0*d_S3.imag() + 
d_S4.imag()));
+    d_freq = (d_S2.real()*Sdot.imag()-d_S2.imag()*Sdot.real())/
+      (d_S2.real()*d_S2.real()+d_S2.imag()*d_S2.imag());
+
+    d_S4=d_S3;
+    d_S3=d_S2;
+    d_S2=d_S1;
+    d_S1=d_S0;
+
+    
+    *optr++ = d_freq;
+  }
+  return noutput_items;
+}

Added: 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.h
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.h
                               (rev 0)
+++ 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.h
       2008-10-02 21:59:15 UTC (rev 9702)
@@ -0,0 +1,57 @@
+/* -*- 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_FMDET_CF_H
+#define INCLUDED_GR_FMDET_CF_H
+
+#include <gr_sync_block.h>
+
+class gr_fmdet_cf;
+typedef boost::shared_ptr<gr_fmdet_cf> gr_fmdet_cf_sptr;
+
+gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate);
+
+/*!
+ * \brief Implements a IQ slope detector
+ * 
+ *
+ * input: stream of complex; output: stream of floats
+ *
+ * This implements a limiting slope detector.  The limiter is in the
+ * normalization by the magnitude of the sample 
+ */
+
+class gr_fmdet_cf : public gr_sync_block
+{
+  friend gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate);
+
+  gr_complex d_S0,d_S1,d_S2,d_S3,d_S4;
+  float d_freq,d_twelveDeltaT;
+  gr_fmdet_cf (float samplerate);
+
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+
+};
+
+#endif

Added: 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.i
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.i
                               (rev 0)
+++ 
gnuradio/branches/developers/n4hy/pfb_fbs/gnuradio-core/src/lib/general/gr_fmdet_cf.i
       2008-10-02 21:59:15 UTC (rev 9702)
@@ -0,0 +1,31 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005 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,fmdet_cf)
+
+gr_fmdet_cf_sptr gr_make_fmdet_cf (float samplerate);
+
+class gr_fmdet_cf : public gr_sync_block
+{
+ private:
+  gr_fmdet_cf (float samplerate);
+};





reply via email to

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