commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] gnuradio-core/src/python/gnuradio/blksimpl Make...


From: Johnathan Corgan
Subject: [Commit-gnuradio] gnuradio-core/src/python/gnuradio/blksimpl Make...
Date: Sun, 02 Jul 2006 18:17:22 +0000

CVSROOT:        /sources/gnuradio
Module name:    gnuradio-core
Changes by:     Johnathan Corgan <jcorgan>      06/07/02 18:17:22

Modified files:
        src/python/gnuradio/blksimpl: Makefile.am 
Added files:
        src/python/gnuradio/blksimpl: fm_demod.py 

Log message:
        Added alternative FM demodulation block hierarchy.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnuradio-core/src/python/gnuradio/blksimpl/Makefile.am?cvsroot=gnuradio&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/gnuradio-core/src/python/gnuradio/blksimpl/fm_demod.py?cvsroot=gnuradio&rev=1.1

Patches:
Index: Makefile.am
===================================================================
RCS file: 
/sources/gnuradio/gnuradio-core/src/python/gnuradio/blksimpl/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Makefile.am 20 Jun 2006 22:24:32 -0000      1.12
+++ Makefile.am 2 Jul 2006 18:17:22 -0000       1.13
@@ -29,6 +29,7 @@
 grblkspython_PYTHON =          \
        __init__.py             \
        filterbank.py           \
+       fm_demod.py             \
        fm_emph.py              \
        gmsk.py                 \
        gmsk2.py                \

Index: fm_demod.py
===================================================================
RCS file: fm_demod.py
diff -N fm_demod.py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ fm_demod.py 2 Jul 2006 18:17:22 -0000       1.1
@@ -0,0 +1,109 @@
+#
+# 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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+# 
+
+from gnuradio import gr, optfir, blksimpl
+from math import pi
+
+class fm_demod_cf(gr.hier_block):
+    """
+    Generalized FM demodulation block with deemphasis and audio 
+    filtering.
+
+    This block demodulates a band-limited, complex down-converted FM 
+    channel into the the original baseband signal, optionally applying
+    deemphasis. Low pass filtering is done on the resultant signal. It
+    produces an output float strem in the range of [-1.0, +1.0].
+
+    @param fg: flowgraph
+    @param channel_rate:  incoming sample rate of the FM baseband
+    @type sample_rate: integer
+    @param deviation: maximum FM deviation (default = 5000)
+    @type deviation: float
+    @param audio_decim: input to output decimation rate
+    @type audio_decim: integer
+    @param audio_pass: audio low pass filter passband frequency 
+    @type audio_pass: float
+    @param audio_stop: audio low pass filter stop frequency
+    @type audio_stop: float
+    @param tau: deemphasis time constant (default = 75e-6), specify 'None'
+       to prevent deemphasis
+    """ 
+    def __init__(self, fg, channel_rate, audio_decim, deviation, 
+                 audio_pass, audio_stop, tau=75e-6):
+       
+       k = channel_rate/(2*pi*deviation)
+       QUAD = gr.quadrature_demod_cf(k)
+
+       audio_taps = optfir.low_pass(1.0,          # Filter gain
+                                    channel_rate, # Sample rate
+                                    audio_pass,   # Audio passband
+                                    audio_stop,   # Audio stopband
+                                    0.1,          # Passband ripple
+                                    60)           # Stopband attenuation
+       LPF = gr.fir_filter_fff(audio_decim, audio_taps)
+
+       if tau is not None:
+           DEEMPH = blksimpl.fm_deemph(fg, channel_rate, tau)
+           fg.connect(QUAD, DEEMPH, LPF)
+        else:
+            fg.connect(QUAD, LPF)
+
+        gr.hier_block.__init__(self, fg, QUAD, LPF)
+
+class demod_20k0f3e_cf(fm_demod_cf):
+    """
+    NBFM demodulation block, 20 KHz channels
+
+    This block demodulates a complex, downconverted, narrowband FM 
+    channel conforming to 20K0F3E emission standards, outputting
+    floats in the range [-1.0, +1.0].
+    
+    @param fg: flowgraph
+    @param sample_rate:  incoming sample rate of the FM baseband
+    @type sample_rate: integer
+    @param audio_decim: input to output decimation rate
+    @type audio_decim: integer
+    """ 
+    def __init__(self, fg, channel_rate, audio_decim):
+        fm_demod_cf.__init__(self, fg, channel_rate, audio_decim,
+                             5000,     # Deviation
+                             3000,     # Audio passband frequency
+                             4000)     # Audio stopband frequency
+
+class demod_200kf3e_cf(fm_demod_cf):
+    """
+    WFM demodulation block, mono.
+    
+    This block demodulates a complex, downconverted, wideband FM 
+    channel conforming to 200KF3E emission standards, outputting 
+    floats in the range [-1.0, +1.0].
+
+    @param fg: flowgraph
+    @param sample_rate:  incoming sample rate of the FM baseband
+    @type sample_rate: integer
+    @param audio_decim: input to output decimation rate
+    @type audio_decim: integer
+    """
+    def __init__(self, fg, channel_rate, audio_decim): 
+       fm_demod_cf.__init__(self, fg, channel_rate, audio_decim,
+                            75000,     # Deviation
+                            15000,     # Audio passband
+                            16000)     # Audio stopband




reply via email to

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