summaryrefslogtreecommitdiff
path: root/gr-pager/src/flex_demod.py
diff options
context:
space:
mode:
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>2006-09-14 03:07:01 +0000
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>2006-09-14 03:07:01 +0000
commitaa0555b49ca61be638bc57b8d823d870aeb3edbb (patch)
treeecd919767a62700f7e2431b62223018df95e2902 /gr-pager/src/flex_demod.py
parent86f5c92427b3f4bb30536d76cf63c3fca388fb2f (diff)
Added gr-pager component to trunk by merging from r3474:r3537 in
branch developer/jcorgan/pager. Currently implements most of the FLEX pager protocol demodulation, but doesn't yet decode individual pages. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3538 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-pager/src/flex_demod.py')
-rw-r--r--gr-pager/src/flex_demod.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/gr-pager/src/flex_demod.py b/gr-pager/src/flex_demod.py
new file mode 100644
index 0000000000..8326c9fa5d
--- /dev/null
+++ b/gr-pager/src/flex_demod.py
@@ -0,0 +1,57 @@
+#
+# Copyright 2006 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 2, 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.
+#
+
+from gnuradio import gr, optfir
+from math import pi
+import pager_swig
+
+class flex_demod(gr.hier_block):
+ """
+ FLEX protocol demodulation block.
+
+ This block demodulates a band-limited, complex down-converted baseband
+ channel into FLEX protocol frames.
+
+ Flow graph (so far):
+
+ QUAD - Quadrature demodulator converts FSK to baseband amplitudes
+ LPF - Low pass filter to remove noise prior to slicer
+ SLICER - Converts input to one of four symbols (0, 1, 2, 3)
+ DEFRAMER - Syncronizes symbol stream and outputs FLEX codewords
+ ---
+
+ @param fg: flowgraph
+ @param channel_rate: incoming sample rate of the baseband channel
+ @type sample_rate: integer
+ """
+
+ def __init__(self, fg, channel_rate):
+ k = channel_rate/(2*pi*4800) # 4800 Hz max deviation
+ QUAD = gr.quadrature_demod_cf(k)
+
+ taps = optfir.low_pass(1.0, channel_rate, 3200, 6400, 0.1, 60)
+ LPF = gr.fir_filter_fff(1, taps)
+ SLICER = pager_swig.slicer_fb(.001, .00001) # Attack, decay
+ DEFRAMER = pager_swig.flex_deframer(channel_rate)
+
+ fg.connect(QUAD, LPF, SLICER, DEFRAMER)
+
+ gr.hier_block.__init__(self, fg, QUAD, DEFRAMER)