Changeset 55


Ignore:
Timestamp:
May 7, 2012, 4:08:56 PM (5 years ago)
Author:
jdbonior21
Message:

Moved Intruder Detection into the sensors branch.

Modified multitone_var_v1.4.py to include 2-dimensional coordinates, more devices for the upcoming experiment, and removed the Kalman filter block for preliminary 2-D testing. Also performed some minor clean-up of the code.

Location:
sensors/Intruder Detection
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • sensors/Intruder Detection/multitone_var_v1.4.py

    r49 r55  
    66# Generated: Tue Feb 14 2012
    77
    8 # New revision uses a recorded NC-OFDM waveform for detection.
    9 
    10 # Last Update: 27 Feb 2012
     8# See svn for change logs.
    119##################################################
    1210
     
    1816import math
    1917from gnuradio import window
    20 import grblock
    2118import time
    2219
     
    2926MEAN_SIZE = 10000
    3027THRESH = -20
    31 RX = [102, 103, 105]
    32 TX = [109]
    33 LOC = numpy.round(numpy.linspace(1, 10, len(RX))) # evenly spaced locations from 1 to 10, equal length to RX
    34 
    35 BASEDIR = "/home/local/Documents/usrp-svn/usrp/docs/Intruder\ Detection/"
     28RX = [111, 112, 113, 114, 115, 116, 117, 118]
     29TX = [110]
     30LOCX = [1, 2, 3, 4, 5, 6, 7, 8]
     31LOCY = [1, 2, 3, 4, 5, 6, 7, 8]
    3632
    3733Q = 1e-5 # process variance
     
    9086                        name = "location",
    9187                        in_sig = in_sig_list[:],       
    92                         out_sig = [numpy.float32]
     88                        out_sig = [numpy.float32, numpy.float32]
    9389                )
    9490
     
    9995                temp = numpy.array(temp)
    10096                temp2 = temp/numpy.sum(temp)
    101                 output_items[0][:] = numpy.sum(LOC*temp2.T)
    102 
     97                output_items[0][:] = numpy.sum(LOCX*temp2.T)
     98                output_items[1][:] = numpy.sum(LOCY*temp2.T)
     99               
    103100                if not math.isnan(output_items[0][:]):
    104101                        now = datetime.now()
     
    185182                        exec('self.transmitter_%d.set_gain(10, 0)' % Y)
    186183                        exec('self.transmitter_%d.set_antenna("TX/RX", 0)' % Y)
    187                         exec('self.file_source_%d = gr.file_source(gr.sizeof_gr_complex*1, BASEDIR+"ofdm_symbol_2.dat", True)' % Y)
     184                        exec('self.file_source_%d = gr.file_source(gr.sizeof_gr_complex*1, "ofdm_symbol_2.dat", True)' % Y)
    188185               
    189186                # Instantiate the USRP-Variance flows.
     
    218215                self.location = location()
    219216                self.kalman = kalman()
    220                 self.null_sink = gr.null_sink(gr.sizeof_float*1)
     217                self.null_sink_0 = gr.null_sink(gr.sizeof_float*1)
     218                self.null_sink_1 = gr.null_sink(gr.sizeof_float*1)
    221219
    222220                ##################################################
     
    254252                        l = l + 1
    255253
    256                 self.connect((self.location, 0), (self.kalman, 0))
    257                 self.connect((self.kalman, 0), (self.null_sink, 0))
    258 
     254                #self.connect((self.location, 0), (self.kalman, 0))
     255                #self.connect((self.kalman, 0), (self.null_sink, 0))
     256                self.connect((self.location, 0), (self.null_sink_0, 0))
     257                self.connect((self.location, 1), (self.null_sink_1, 0))
    259258
    260259        def get_samp_rate(self):
    261                 return self.samp_rate0
     260                return self.samp_rate
    262261
    263262        def set_samp_rate(self, samp_rate):
     
    274273        print "\nLocation Estimation:"
    275274        tb.run()
    276 
    277 
Note: See TracChangeset for help on using the changeset viewer.