commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r3627 - in gnuradio/branches/developers/jcorgan/pager/


From: jcorgan
Subject: [Commit-gnuradio] r3627 - in gnuradio/branches/developers/jcorgan/pager/gr-pager: . src
Date: Sat, 23 Sep 2006 13:01:37 -0600 (MDT)

Author: jcorgan
Date: 2006-09-23 13:01:36 -0600 (Sat, 23 Sep 2006)
New Revision: 3627

Added:
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.cc
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.h
Modified:
   gnuradio/branches/developers/jcorgan/pager/gr-pager/README
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py
   
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.cc
   
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.h
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc
   gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py
Log:
Work in progress.  The data showing up in the FLEX phases now appears
to have the correct format for parsing individual pages.


Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/README
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/README  2006-09-23 
03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/README  2006-09-23 
19:01:36 UTC (rev 3627)
@@ -1,38 +1,36 @@
 This GNU Radio component implements (will implement) common radiopager
 signaling protocols such as POCSAG and FLEX.
 
-Current status (9/13/06):
+Current status (9/23/06):
 
-FLEX receiving is in mid-stream of implemention.
+FLEX receiving is nearing completion.
 
-pager.slicer_fb()       Accepts a complex baseband downconverted channel 
-                        and outputs 4-level FSK symbols [0-3] as bytes.
-                       This may migrate into gnuradio-core at some point.
+pager.slicer_fb()         Accepts a complex baseband downconverted channel 
+                          and outputs 4-level FSK symbols [0-3] as bytes.
+                         This may migrate into gnuradio-core at some point.
 
-pager.flex_deframer()   Accepts a symbol stream from slicer_fb() and
-                        outputs received 32-bit FLEX codewords for each
-                        defined phase.  Auto adjusts for 1600 or 3200 bps, 
-                        and 2 or 4 level FSK encoding based on received
-                        synchronization word.  The sync portion of this
-                        block may factor out into its own block for
-                        purposes of clarity and code complexity.
+pager.flex_sync()        Accepts 4FSK symbol stream at channel rate and
+                         outputs four phases of FLEX data bits as bytes.
+                         Auto-shifts to 3200 bps as determined by received
+                         FLEX synchronization word.
+                       
+pager.flex_deinterleave() Accepts a single phase of FLEX data bits and performs
+                         deinterleaving on 256-bit blocks.  Resulting code
+                         words are error corrected using BCH 32,21 ecc (stub)
+                         and converted into FLEX data words for output.
 
-pager.bch3221_ecd()     (not yet implemented) Accepts a stream of 32-bit
-                        FLEX codewords and applies BCH (32,21) error
-                        detection/correction (up to 2 bits), the emits
-                        corrected stream. This may be absorbed into the
-                        deframer at some point.
+pager.flex_parse()       Sink block that accepts a single phase of FLEX data 
+                         words and unpacks and parses individual pages.
+                         Currently, this block only outputs to screen the
+                         number of pages found in the FLEX phase.
 
-pager.message_decode()  (not yet implemented) Accepts a stream of 32-bit
-                        FLEX codewords and separates individual paging
-                        messages into output stream as bytes.
+pager.flex_decode()       Combines the above blocks correctly to convert
+                          from downconverted baseband to pager messages
 
-pager.flex_decode()     Combines the above blocks correctly to convert
-                        from downconverted baseband to pager messages
+usrp_flex.py              Instantiates USRP receive chain to receive FLEX
+                          protocol pages.  See command-line help for options.
+                         Right now this installs into $PREFIX/bin but will
+                          probably make it into gnuradio-examples.
 
-usrp_flex.py            Instantiates USRP receive chain to receive FLEX
-                        protocol pages.  See command-line help for options.
-                        This will probably make it into gnuradio-examples.
-
 Johnathan Corgan
 address@hidden

Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am 
2006-09-23 03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/Makefile.am 
2006-09-23 19:01:36 UTC (rev 3627)
@@ -78,8 +78,9 @@
     pager_flex_sync.cc \
     pager_flex_deinterleave.cc \
     pager_flex_parse.cc \
+    pageri_bch3221.cc \
     pageri_flex_modes.cc \
-    pageri_bch3221.cc
+    pageri_util.cc
     # Additional source modules here
 
 # magic flags
@@ -100,8 +101,9 @@
     pager_flex_sync.h \
     pager_flex_deinterleave.h \
     pager_flex_parse.h \
+    pageri_bch3221.h \
     pageri_flex_modes.h \
-    pageri_bch3221.h
+    pageri_util.h
     # Additional header files here
 
 # These swig headers get installed in ${prefix}/include/gnuradio/swig

Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py       
2006-09-23 03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/flex_demod.py       
2006-09-23 19:01:36 UTC (rev 3627)
@@ -25,7 +25,7 @@
 
 class flex_demod:
     """
-    FLEX protocol demodulation block.
+    FLEX pager protocol demodulation block.
 
     This block demodulates a band-limited, complex down-converted baseband 
     channel into FLEX protocol frames.
@@ -36,7 +36,8 @@
     LPF      - Low pass filter to remove noise prior to slicer
     SLICER   - Converts input to one of four symbols (0, 1, 2, 3)
     SYNC     - Converts symbol stream to four phases of FLEX blocks
-    DEINTx   - Deinterleaves FLEX blocks into codewords
+    DEINTx   - Deinterleaves FLEX blocks into datawords
+    PARSEx   - Parse a single FLEX phase worth of data words into pages
     ---
 
     @param fg: flowgraph
@@ -47,10 +48,8 @@
     def __init__(self, fg, channel_rate):
         k = channel_rate/(2*pi*4800)        # 4800 Hz max deviation
         QUAD = gr.quadrature_demod_cf(k)
-       # Hack until fg converges back to one output and we can make a 
-       # hier_block again.
-       self.INPUT = QUAD 
-       
+       self.INPUT = QUAD
+               
         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
@@ -73,11 +72,3 @@
        fg.connect((SYNC, 1), DEINTB, PARSEB)
        fg.connect((SYNC, 2), DEINTC, PARSEC)
        fg.connect((SYNC, 3), DEINTD, PARSED)
-
-       # Hack until fg converges back to one output and we can make a 
-       # hier_block again.
-       self.OUTPUTA = PARSEA
-       self.OUTPUTB = PARSEB
-       self.OUTPUTC = PARSEC
-       self.OUTPUTD = PARSED
-               
\ No newline at end of file

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.cc
  2006-09-23 03:54:46 UTC (rev 3626)
+++ 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.cc
  2006-09-23 19:01:36 UTC (rev 3627)
@@ -25,6 +25,7 @@
 
 #include <pager_flex_deinterleave.h>
 #include <pageri_bch3221.h>
+#include <pageri_util.h>
 #include <gr_io_signature.h>
 
 pager_flex_deinterleave_sptr pager_make_flex_deinterleave()
@@ -52,16 +53,19 @@
     // of each codeword, then switch to MSB-1, etc.  This is done by shifting
     // in the bits from the right on each codeword as the bits come in.
     // When we are done we have a FLEX block of eight codewords, ready for
-    // error correction.
+    // conversion to data words.
     //
+    // FLEX data words are recovered by reversing the bit order of the code
+    // word, masking off the (reversed) ECC, and inverting the remainder of 
+    // the bits (!).
+    //
     // The data portion of a FLEX frame consists of 11 of these deinterleaved
-    // blocks.
+    // and converted blocks.
     //
     // set_output_multiple garauntees we have output space for at least
-    // 8 codewords and 256 bits on input
+    // eight data words, and 256 bits are supplied on input
 
     int i, j;
-
     for (i = 0; i < 32; i++) {
        for (j = 0; j < 8; j++) {
            d_codewords[j] <<= 1;
@@ -69,10 +73,21 @@
        }
     }
 
-    // Now output (error corrected) codewords.  
+    // Now convert code words into data words  
     for (j = 0; j < 8; j++) {
-       pageri_bch3221(d_codewords[j]);
-       *out++ = d_codewords[j];        
+       gr_int32 codeword = d_codewords[j];
+       
+       // Apply BCH 32,21 error correction
+       // TODO: mark dataword when codeword fails ECC
+       pageri_bch3221(codeword);
+       
+       // Reverse bit order
+       codeword = pageri_reverse_bits32(codeword);
+
+       // Mask off ECC then invert lower 21 bits
+       codeword = (codeword & 0x001FFFFF)^0x001FFFFF;
+
+       *out++ = codeword;
     }
     
     return j;

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.h
   2006-09-23 03:54:46 UTC (rev 3626)
+++ 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_deinterleave.h
   2006-09-23 19:01:36 UTC (rev 3627)
@@ -41,6 +41,7 @@
     friend pager_flex_deinterleave_sptr pager_make_flex_deinterleave();
     pager_flex_deinterleave();
 
+    // One FLEX block of deinterleaved data
     gr_int32 d_codewords[8];
    
 public:

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc 
2006-09-23 03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.cc 
2006-09-23 19:01:36 UTC (rev 3627)
@@ -33,49 +33,53 @@
 }
 
 pager_flex_parse::pager_flex_parse() :
-    gr_block("flex_parse",
+    gr_sync_block("flex_parse",
     gr_make_io_signature(1, 1, sizeof(gr_int32)),
-    gr_make_io_signature(1, 1, sizeof(unsigned char)))
+    gr_make_io_signature(0, 0, 0))
 {
-    set_output_multiple(1);
     d_count = 0;
 }
 
-void pager_flex_parse::forecast(int noutput_items, gr_vector_int 
&inputs_required)
+int pager_flex_parse::work(int noutput_items,
+    gr_vector_const_void_star &input_items,
+    gr_vector_void_star &output_items)
 {
-    // Get at least one codeword on the input
-    for (unsigned int i = 0; i < inputs_required.size(); i++)
-        inputs_required[i] = noutput_items;
+    const gr_int32 *in = (const gr_int32 *)input_items[0];
+    
+    int i = 0;
+    while (i < noutput_items) {
+       // Accumulate one whole frame's worth of data words (88 of them)
+       d_datawords[d_count] = *in++; i++;
+       if (++d_count == 88) {
+           parse_data();
+           d_count = 0;
+       }
+    }
+
+    return i;
 }
 
-void parse_biw(gr_int32 biw)
+/* FLEX data frames (that is, 88 data words per phase recovered after sync,
+   symbol decoding, dephasing, deinterleaving, error correction, and conversion
+   from codewords to data words) start with a block information word containing
+   indices of the page address field and page vector fields.
+*/
+
+void pager_flex_parse::parse_data()
 {
-    if (biw == 0 || biw == 0xFFFFFFFF)
+    // Block information word is the first data word in frame
+    gr_int32 biw = d_datawords[0];
+
+    // Nothing to see here, please move along
+    if (biw == 0 || biw == 0x001FFFFF)
        return;
-       
-    printf("BIW=%08X\n", biw);
-}
 
-int pager_flex_parse::general_work(int noutput_items,
-    gr_vector_int &ninput_items,
-    gr_vector_const_void_star &input_items,
-    gr_vector_void_star &output_items)
-{
-    const gr_int32 *in = (const gr_int32 *)input_items[0];
+    // Vector start index is bits 15-10
+    int vector_index = (biw >> 10) & 0x3f;
+    // Address start address is bits 9-8, plus one for offset
+    int address_index = ((biw >> 8) & 0x03) + 1;
     
-    unsigned char *out = (unsigned char *)output_items[0];
+    int num = vector_index - address_index;
     
-    int ninputs = ninput_items[0];
-
-    int i = 0, j = 0;
-    while (i < ninputs && j < noutput_items) {
-       gr_int32 code = *in++; i++;
-
-       // First codeword in a block is the Block Information Word
-       if (++d_count % 8 == 1)
-           parse_biw(code);
-    }
-
-    consume_each(i);
-    return j;
+    printf("BIW=%08X A=%i V=%i N=%i\n", biw, address_index, vector_index, num);
 }

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h  
2006-09-23 03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_parse.h  
2006-09-23 19:01:36 UTC (rev 3627)
@@ -22,7 +22,7 @@
 #ifndef INCLUDED_PAGER_FLEX_PARSE_H
 #define INCLUDED_PAGER_FLEX_PARSE_H
 
-#include <gr_block.h>
+#include <gr_sync_block.h>
 
 class pager_flex_parse;
 typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr;
@@ -34,22 +34,21 @@
  * \ingroup block
  */
 
-class pager_flex_parse : public gr_block
+class pager_flex_parse : public gr_sync_block
 {
 private:
     // Constructors
     friend pager_flex_parse_sptr pager_make_flex_parse();
     pager_flex_parse();
 
-    int d_count;       // Count of received codewords
-
+    int d_count;             // Count of received codewords
+    gr_int32 d_datawords[88]; // 11 blocks of 8 32-bit words
+    void parse_data();       // Handle a frame's worth of data
+    
 public:
-    void forecast(int noutput_items, gr_vector_int &inputs_required);
-
-    int general_work(int noutput_items,
-                     gr_vector_int &ninput_items,
-                     gr_vector_const_void_star &input_items, 
-                     gr_vector_void_star &output_items);
+    int work(int noutput_items,
+        gr_vector_const_void_star &input_items, 
+        gr_vector_void_star &output_items);
 };
 
 #endif /* INCLUDED_PAGER_FLEX_PARSE_H */

Modified: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc  
2006-09-23 03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pager_flex_sync.cc  
2006-09-23 19:01:36 UTC (rev 3627)
@@ -26,6 +26,7 @@
 #include <pager_flex_sync.h>
 #include <pageri_flex_modes.h>
 #include <pageri_bch3221.h>
+#include <pageri_util.h>
 #include <gr_io_signature.h>
 #include <gr_count_bits.h>
 
@@ -158,7 +159,6 @@
        // We're here at the center of a 1600 baud bit
        // So this hack puts the index and bit counter
        // in the right place for 3200 bps.
-       // I suspect this isn't quite right :(
         d_index = d_index/2-d_spb/2;         
        d_count = -1;                
     }                               
@@ -170,27 +170,17 @@
     d_count = 0;
 }
 
-unsigned char reverse_bits8(unsigned char val)
-{
-    // This method was attributed to Rich Schroeppel in the Programming 
-    // Hacks section of Beeler, M., Gosper, R. W., and Schroeppel, R. 
-    // HAKMEM. MIT AI Memo 239, Feb. 29, 1972.
-    //
-    // Reverses 8 bits in 5 machine operations with 64 bit arch
-    return (val * 0x0202020202ULL & 0x010884422010ULL) % 1023;
-}
-
 void print_fiw(gr_int32 fiw)
 {
     // Bits 31-28 are frame number related, but unknown function
     // This might be a checksum
-    int unknown2 = reverse_bits8((fiw >> 24) & 0xF0);
+    int unknown2 = pageri_reverse_bits8((fiw >> 24) & 0xF0);
        
     // Cycle is bits 27-24, reversed
-    int cycle = reverse_bits8((fiw >> 20) & 0xF0);
+    int cycle = pageri_reverse_bits8((fiw >> 20) & 0xF0);
 
     // Frame is bits 23-17, reversed
-    int frame = reverse_bits8((fiw >> 16) & 0xFE);
+    int frame = pageri_reverse_bits8((fiw >> 16) & 0xFE);
 
     // Bits 16-11 are some sort of marker, usually identical across
     // many frames but sometimes changes between frames or modes

Added: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.cc      
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.cc      
2006-09-23 19:01:36 UTC (rev 3627)
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pageri_util.h>
+
+unsigned char pageri_reverse_bits8(unsigned char val)
+{
+    // This method was attributed to Rich Schroeppel in the Programming 
+    // Hacks section of Beeler, M., Gosper, R. W., and Schroeppel, R. 
+    // HAKMEM. MIT AI Memo 239, Feb. 29, 1972.
+    //
+    // Reverses 8 bits in 5 machine operations with 64 bit arch
+    return (val * 0x0202020202ULL & 0x010884422010ULL) % 1023;
+}
+
+gr_int32 pageri_reverse_bits32(gr_int32 val)
+{
+    gr_int32 out = 0x00000000;
+    out |= (pageri_reverse_bits8((val >> 24) & 0x000000FF)      );
+    out |= (pageri_reverse_bits8((val >> 16) & 0x000000FF) <<  8);
+    out |= (pageri_reverse_bits8((val >>  8) & 0x000000FF) << 16);
+    out |= (pageri_reverse_bits8((val      ) & 0x000000FF) << 24);
+    return out;
+}


Property changes on: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.cc
___________________________________________________________________
Name: svn:eol-style
   + native

Added: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.h
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.h       
                        (rev 0)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.h       
2006-09-23 19:01:36 UTC (rev 3627)
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_PAGERI_UTIL_H
+#define INCLUDED_PAGERI_UTIL_H
+
+#include <gr_types.h>
+
+unsigned char pageri_reverse_bits8(unsigned char val);
+gr_int32 pageri_reverse_bits32(gr_int32 val);
+
+#endif /* INCLUDED_PAGERI_UTIL_H */


Property changes on: 
gnuradio/branches/developers/jcorgan/pager/gr-pager/src/pageri_util.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py
===================================================================
--- gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py        
2006-09-23 03:54:46 UTC (rev 3626)
+++ gnuradio/branches/developers/jcorgan/pager/gr-pager/src/usrp_flex.py        
2006-09-23 19:01:36 UTC (rev 3627)
@@ -14,10 +14,8 @@
 
 USRP  - Daughter board source generating complex baseband signal.
 CHAN  - Low pass filter to select channel bandwidth
-RFSQL - RF squelch zeroing output when input power below threshold
 AGC   - Automatic gain control leveling signal at [-1.0, +1.0]
 FLEX  - FLEX pager protocol decoder
-SINK  - File sink for decoded output 
 
 The following are required command line parameters:
 
@@ -34,11 +32,6 @@
 Once the program is running, ctrl-break (Ctrl-C) stops operation.
 """
 
-def make_filename(dir, freq):
-    t = time.strftime('%Y%m%d-%H%M%S')
-    f = 'r%s-%s.dat' % (t, eng_notation.num_to_str(freq))
-    return os.path.join(dir, f)
-
 class usrp_source_c(gr.hier_block):
     """
     Create a USRP source object supplying complex floats.
@@ -82,7 +75,7 @@
 
         USRP = usrp_source_c(self,          # Flow graph
                     options.rx_subdev_spec, # Daugherboard spec
-                       250,                    # IF decimation ratio gets 256K 
if_rate
+                   250,                    # IF decimation ratio gets 256K 
if_rate
                     options.gain,           # Receiver gain
                     options.calibration)    # Frequency offset
         USRP.tune(options.frequency)
@@ -93,21 +86,16 @@
        
         CHAN_taps = optfir.low_pass(1.0,          # Filter gain
                                     if_rate,      # Sample rate
-                                               8000,         # One sided 
modulation bandwidth
-                                       10000,        # One sided channel 
bandwidth
-                                                   0.1,              # 
Passband ripple
-                                                   60)                   # 
Stopband attenuation
+                                   8000,         # One sided modulation 
bandwidth
+                                   10000,        # One sided channel bandwidth
+                                   0.1,          # Passband ripple
+                                   60)           # Stopband attenuation
        
         CHAN = gr.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate
                                               CHAN_taps,     # Filter taps
                                               0.0,           # Offset frequency
                                               if_rate)       # Sample rate
 
-        RFSQL = gr.pwr_squelch_cc(options.rf_squelch, # Power threshold
-                                  125.0/channel_rate, # Time constant
-                                                 channel_rate/20,    # 50ms 
rise/fall
-                                  False)              # Zero, not gate output
-
         AGC = gr.agc_cc(1.0/channel_rate,  # Time constant
                         1.0,               # Reference power 
                         1.0,               # Initial gain
@@ -115,19 +103,7 @@
        
         FLEX = pager.flex_demod(self, 32000)      
 
-        SINKA = gr.file_sink(1, options.filename+'A')
-       SINKB = gr.file_sink(1, options.filename+'B')
-       SINKC = gr.file_sink(1, options.filename+'C')
-       SINKD = gr.file_sink(1, options.filename+'D')
-
-        self.connect(USRP, CHAN)
-       self.connect(CHAN, RFSQL)
-       self.connect(RFSQL, AGC)
-       self.connect(AGC, FLEX.INPUT)
-       self.connect(FLEX.OUTPUTA, SINKA)
-       self.connect(FLEX.OUTPUTB, SINKB)
-       self.connect(FLEX.OUTPUTC, SINKC)
-       self.connect(FLEX.OUTPUTD, SINKD)
+        self.connect(USRP, CHAN, AGC, FLEX.INPUT)
        
 def main():
     parser = OptionParser(option_class=eng_option)
@@ -139,23 +115,11 @@
                       help="set frequency offset to Hz", metavar="Hz")
     parser.add_option("-g", "--gain", type="int", default=None,
                       help="set RF gain", metavar="dB")
-    parser.add_option("-r", "--rf-squelch", type="eng_float", default=-50.0,
-                      help="set RF squelch to dB", metavar="dB")
-    parser.add_option("-F", "--filename", default=None)
-    parser.add_option("-D", "--dir", default=None)
     (options, args) = parser.parse_args()
 
     if options.frequency < 1e6:
        options.frequency *= 1e6
        
-    if options.filename is None and options.dir is None:
-        sys.stderr.write('Must specify either -F FILENAME or -D DIR\n')
-        parser.print_help()
-        sys.exit(1)
-
-    if options.filename is None:
-        options.filename = make_filename(options.dir, options.frequency)
-
     fg = app_flow_graph(options, args)
     try:
         fg.run()





reply via email to

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