commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5959 - gnuradio/branches/features/pager/gr-pager/src


From: jcorgan
Subject: [Commit-gnuradio] r5959 - gnuradio/branches/features/pager/gr-pager/src
Date: Fri, 13 Jul 2007 23:50:21 -0600 (MDT)

Author: jcorgan
Date: 2007-07-13 23:50:20 -0600 (Fri, 13 Jul 2007)
New Revision: 5959

Removed:
   gnuradio/branches/features/pager/gr-pager/src/aypabtu.py
Modified:
   gnuradio/branches/features/pager/gr-pager/src/Makefile.am
   gnuradio/branches/features/pager/gr-pager/src/flex_demod.py
   gnuradio/branches/features/pager/gr-pager/src/pager.i
   gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.cc
   gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.h
   gnuradio/branches/features/pager/gr-pager/src/usrp_flex.py
   gnuradio/branches/features/pager/gr-pager/src/usrp_flex_all.py
Log:
Prettify output, add frequency display.

Modified: gnuradio/branches/features/pager/gr-pager/src/Makefile.am
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/Makefile.am   2007-07-14 
04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/Makefile.am   2007-07-14 
05:50:20 UTC (rev 5959)
@@ -29,8 +29,7 @@
 
 bin_SCRIPTS = \
     usrp_flex.py \
-    usrp_flex_all.py \
-    aypabtu.py 
+    usrp_flex_all.py
     
 noinst_PYTHON = \
     qa_pager.py
@@ -71,9 +70,8 @@
     pager_swig.py \
     flex_demod.py \
     usrp_flex.py \
-    usrp_flex_all.py \
-    aypabtu.py
-    
+    usrp_flex_all.py
+        
 ourlib_LTLIBRARIES = _pager_swig.la
 
 # These are the source files that go into the shared library

Deleted: gnuradio/branches/features/pager/gr-pager/src/aypabtu.py

Modified: gnuradio/branches/features/pager/gr-pager/src/flex_demod.py
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/flex_demod.py 2007-07-14 
04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/flex_demod.py 2007-07-14 
05:50:20 UTC (rev 5959)
@@ -44,7 +44,7 @@
     @type sample_rate: integer
     """
 
-    def __init__(self, fg, queue):
+    def __init__(self, fg, queue, freq=0.0):
         k = 25000/(2*pi*1600)        # 4800 Hz max deviation
         QUAD = gr.quadrature_demod_cf(k)
        self.INPUT = QUAD
@@ -56,16 +56,16 @@
         fg.connect(QUAD, RSAMP, SLICER, SYNC)
 
        DEINTA = pager_swig.flex_deinterleave()
-       PARSEA = pager_swig.flex_parse(queue)
+       PARSEA = pager_swig.flex_parse(queue, freq)
 
        DEINTB = pager_swig.flex_deinterleave()
-       PARSEB = pager_swig.flex_parse(queue)
+       PARSEB = pager_swig.flex_parse(queue, freq)
 
        DEINTC = pager_swig.flex_deinterleave()
-       PARSEC = pager_swig.flex_parse(queue)
+       PARSEC = pager_swig.flex_parse(queue, freq)
 
        DEINTD = pager_swig.flex_deinterleave()
-       PARSED = pager_swig.flex_parse(queue)
+       PARSED = pager_swig.flex_parse(queue, freq)
        
        fg.connect((SYNC, 0), DEINTA, PARSEA)
        fg.connect((SYNC, 1), DEINTB, PARSEB)

Modified: gnuradio/branches/features/pager/gr-pager/src/pager.i
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/pager.i       2007-07-14 
04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/pager.i       2007-07-14 
05:50:20 UTC (rev 5959)
@@ -81,12 +81,12 @@
 
 GR_SWIG_BLOCK_MAGIC(pager,flex_parse);
 
-pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue);
+pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float 
freq);
 
 class pager_flex_parse : public gr_block
 {
 private:
-    pager_flex_parse(gr_msg_queue_sptr queue);
+    pager_flex_parse(gr_msg_queue_sptr queue, float freq);
 
 public:
 };

Modified: gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.cc
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.cc   
2007-07-14 04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.cc   
2007-07-14 05:50:20 UTC (rev 5959)
@@ -28,17 +28,19 @@
 #include <gr_io_signature.h>
 #include <ctype.h>
 #include <iostream>
+#include <iomanip>
 
-pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue)
+pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float 
freq)
 {
-    return pager_flex_parse_sptr(new pager_flex_parse(queue));
+    return pager_flex_parse_sptr(new pager_flex_parse(queue, freq));
 }
 
-pager_flex_parse::pager_flex_parse(gr_msg_queue_sptr queue) :
+pager_flex_parse::pager_flex_parse(gr_msg_queue_sptr queue, float freq) :
     gr_sync_block("flex_parse",
        gr_make_io_signature(1, 1, sizeof(gr_int32)),
        gr_make_io_signature(0, 0, 0)),
-    d_queue(queue)
+    d_queue(queue),
+    d_freq(freq)
 {
     d_count = 0;
 }
@@ -131,7 +133,11 @@
            continue;                           // Invalid offsets
 
        d_payload.str("");
-       d_payload << d_capcode << FIELD_DELIM << d_type << FIELD_DELIM;
+       d_payload.setf(std::ios::showpoint);
+       d_payload << std::setprecision(6) << std::setw(7)
+                 << d_freq/1e6 << FIELD_DELIM 
+                 << std::setw(10) << d_capcode << FIELD_DELIM
+                 << std::setw(1)  << d_type << FIELD_DELIM;
 
        if (is_alphanumeric_page(d_type))
            parse_alphanumeric(mw1, mw2-1, j);
@@ -142,9 +148,6 @@
        else
            parse_unknown(mw1, mw2);
 
-       //std::cout << d_payload.str() << std::endl;
-       //fflush(stdout);
-
        gr_message_sptr msg = 
gr_make_message_from_string(std::string(d_payload.str()));
        d_queue->handle(msg);
     }
@@ -166,8 +169,8 @@
        mw2--;
     }    
 
-    d_payload << frag << FIELD_DELIM;
-    d_payload << cont << FIELD_DELIM;
+    //d_payload << frag << FIELD_DELIM;
+    //d_payload << cont << FIELD_DELIM;
 
     for (int i = mw1; i <= mw2; i++) {
        gr_int32 dw = d_datawords[i];

Modified: gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.h
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.h    
2007-07-14 04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/pager_flex_parse.h    
2007-07-14 05:50:20 UTC (rev 5959)
@@ -30,7 +30,7 @@
 class pager_flex_parse;
 typedef boost::shared_ptr<pager_flex_parse> pager_flex_parse_sptr;
 
-pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue);
+pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float 
freq);
 
 /*!
  * \brief flex parse description
@@ -43,8 +43,8 @@
 {
 private:
     // Constructors
-    friend pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr 
queue);
-    pager_flex_parse(gr_msg_queue_sptr queue);
+    friend pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr 
queue, float freq);
+    pager_flex_parse(gr_msg_queue_sptr queue, float freq);
 
     std::ostringstream d_payload;
     gr_msg_queue_sptr d_queue;           // Destination for decoded pages
@@ -52,10 +52,11 @@
     int d_count;                         // Count of received codewords
     gr_int32 d_datawords[88];             // 11 blocks of 8 32-bit words
 
-    page_type_t d_type;                  // Current page type
+    page_type_t d_type;                          // Current page type
     int d_capcode;                       // Current page destination address
     bool d_laddr;                        // Current page has long address
-
+    float d_freq;                        // Channel frequency
+    
     void parse_data();                   // Handle a frame's worth of data
     void parse_capcode(gr_int32 aw1, gr_int32 aw2);     
     void parse_alphanumeric(int mw1, int mw2, int j);

Modified: gnuradio/branches/features/pager/gr-pager/src/usrp_flex.py
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/usrp_flex.py  2007-07-14 
04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/usrp_flex.py  2007-07-14 
05:50:20 UTC (rev 5959)
@@ -110,15 +110,15 @@
                                     if_rate,      # Sample rate
                                    11000,         # One sided modulation 
bandwidth
                                    12500,        # One sided channel bandwidth
-                                   0.1,          # Passband ripple
-                                   60)           # Stopband attenuation
+                                   1.0,          # Passband ripple
+                                   40)           # 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
 
-        FLEX = pager.flex_demod(self, queue)
+        FLEX = pager.flex_demod(self, queue, options.frequency)
 
         self.connect(USRP, CHAN, FLEX.INPUT)
        

Modified: gnuradio/branches/features/pager/gr-pager/src/usrp_flex_all.py
===================================================================
--- gnuradio/branches/features/pager/gr-pager/src/usrp_flex_all.py      
2007-07-14 04:15:18 UTC (rev 5958)
+++ gnuradio/branches/features/pager/gr-pager/src/usrp_flex_all.py      
2007-07-14 05:50:20 UTC (rev 5959)
@@ -23,25 +23,27 @@
             result = usrp.tune(src, 0, subdev, 930.5e6+options.calibration)
             print "Using", subdev.name(), " for receiving."
             
-        usrp_sink = gr.file_sink(gr.sizeof_gr_complex, 'usrp.dat')
-        self.connect(src, usrp_sink)
-
         taps = gr.firdes.low_pass(1.0,
                                   1.0,
                                   1.0/128.0*0.4,
                                   1.0/128.0*0.1,
                                   gr.firdes.WIN_HANN)
+
         print "Channel filter has", len(taps), "taps"
         bank = blks.analysis_filterbank(self, 128, taps)
         self.connect(src, bank)
 
         for i in range(128):
-           if ((i < 20) or (i >= 60 and i < 68) or (i >= 108)):
+           if i < 64:
+               freq = 930.5e6+i*25e3
+           else:
+               freq = 928.9e6+(i-64)*25e3
+
+           if ((i < 20) or (i >= 60 and i < 68) or (i >= 108)): # Non-forward 
channel frequencies
                 self.connect((bank, i), gr.null_sink(gr.sizeof_gr_complex))
            else:
-               self.connect((bank, i), pager.flex_demod(self, queue).INPUT)
+               self.connect((bank, i), pager.flex_demod(self, queue, 
freq).INPUT)
 
-
 def main():
     parser = OptionParser(option_class=eng_option)
     parser.add_option("-R", "--rx-subdev-spec", type="subdev",





reply via email to

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