Changeset 55
 Timestamp:
 May 7, 2012, 4:08:56 PM (6 years ago)
 Location:
 sensors/Intruder Detection
 Files:

 1 edited
 1 moved
Legend:
 Unmodified
 Added
 Removed

sensors/Intruder Detection/multitone_var_v1.4.py
r49 r55 6 6 # Generated: Tue Feb 14 2012 7 7 8 # New revision uses a recorded NCOFDM waveform for detection. 9 10 # Last Update: 27 Feb 2012 8 # See svn for change logs. 11 9 ################################################## 12 10 … … 18 16 import math 19 17 from gnuradio import window 20 import grblock21 18 import time 22 19 … … 29 26 MEAN_SIZE = 10000 30 27 THRESH = 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/usrpsvn/usrp/docs/Intruder\ Detection/" 28 RX = [111, 112, 113, 114, 115, 116, 117, 118] 29 TX = [110] 30 LOCX = [1, 2, 3, 4, 5, 6, 7, 8] 31 LOCY = [1, 2, 3, 4, 5, 6, 7, 8] 36 32 37 33 Q = 1e5 # process variance … … 90 86 name = "location", 91 87 in_sig = in_sig_list[:], 92 out_sig = [numpy.float32 ]88 out_sig = [numpy.float32, numpy.float32] 93 89 ) 94 90 … … 99 95 temp = numpy.array(temp) 100 96 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 103 100 if not math.isnan(output_items[0][:]): 104 101 now = datetime.now() … … 185 182 exec('self.transmitter_%d.set_gain(10, 0)' % Y) 186 183 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) 188 185 189 186 # Instantiate the USRPVariance flows. … … 218 215 self.location = location() 219 216 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) 221 219 222 220 ################################################## … … 254 252 l = l + 1 255 253 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)) 259 258 260 259 def get_samp_rate(self): 261 return self.samp_rate 0260 return self.samp_rate 262 261 263 262 def set_samp_rate(self, samp_rate): … … 274 273 print "\nLocation Estimation:" 275 274 tb.run() 276 277
Note: See TracChangeset
for help on using the changeset viewer.