Browse Source

fixed max for low sample rates, count>=min_consec_max_threshold

master
Clemens Richter 9 years ago
parent
commit
d57ae49612
  1. 18
      python/max_freq.py
  2. 9
      python/rds_parser_table_qt.py

18
python/max_freq.py

@ -50,8 +50,11 @@ class max_freq(gr.sync_block):
carrier_width=2
carrier=self.fft_len/2
numbers=np.delete(input_items[0][0],range(carrier-carrier_width,carrier+carrier_width+1))#reads input and disregards center
threshold=100
min_consec_max_threshold=1#minimum number of consecutive maximums (in fft domain) to consider signal as station
#threshold=100 uni
threshold=80#home
#minimum number of consecutive maximums (in fft domain) to consider signal as station:
# min_consec_max_threshold=1#uni
min_consec_max_threshold=5#home
#TODO: what if no numbers over threshold?
#TODO auto threshold
#max_indices=[[421, 428, 429, 430, 431, 432, 433, 434, 436, 437, 438, 831, 832, 837, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851,852, 853, 854, 855, 856, 857]]
@ -62,7 +65,8 @@ class max_freq(gr.sync_block):
#last_index=0
count=1#counts number of consecutive maximums
threshold_reached=False
fuzzyness=2
#fuzzyness=2#uni
fuzzyness=10#home
# max_indices[0].append(0)#to detect last station
max_indices=np.append(max_indices,0)#to detect last station
#try:
@ -80,7 +84,7 @@ class max_freq(gr.sync_block):
count=1
else:#last streak didn't reach threshold -> no station
count=1
if count==min_consec_max_threshold:
if count>=min_consec_max_threshold:
threshold_reached=True
last_index=i
@ -95,8 +99,8 @@ class max_freq(gr.sync_block):
msg_string=str(i+1)+" "+str(station_freqs[i])
send_pmt = pmt.string_to_symbol(msg_string)
self.message_port_pub(pmt.intern('out'), send_pmt)
#print(max_indices)
#print(station_indices)
#print(station_freqs)
print(max_indices)
print(station_indices)
print(station_freqs)
return len(input_items[0])

9
python/rds_parser_table_qt.py

@ -57,8 +57,8 @@ class rds_parser_table_qt(gr.sync_block):
self.TMC_data={}
self.decoder_frequencies={}
self.colorder=['ID','freq','name','PTY','AF','time','text','quality','buttons']
workdir="/user/wire2/richter/hackrf_prototypes/"
#workdir="/media/clemens/intdaten/uni_bulk/forschungsarbeit/hackrf_prototypes/"
#workdir="/user/wire2/richter/hackrf_prototypes/"
workdir="/media/clemens/intdaten/uni_bulk/forschungsarbeit/hackrf_prototypes/"
reader = csv.reader(open(workdir+'RDS_ODA AIDs_names_only.csv'), delimiter=',', quotechar='"')
reader.next()#skip header
for row in reader:
@ -576,7 +576,7 @@ class rds_parser_table_qt_Widget(QtGui.QWidget):
self.event_filter=QtGui.QLineEdit()#QPlainTextEdit ?
self.location_filter=QtGui.QLineEdit("Baden-Württemberg")
self.location_filter=QtGui.QLineEdit(u"Baden-Württemberg")
button = QtGui.QPushButton("code.interact")
button.clicked.connect(self.onCLick)
@ -688,9 +688,12 @@ class rds_parser_table_qt_Widget(QtGui.QWidget):
#view.resize(360, 240)
view.resize(330, 420)
rds_data=self.tableobj.RDS_data[PI].copy()
try:
del rds_data['blockcounts']
del rds_data['PSN_valid']
del rds_data['RT_valid']
except KeyError:
pass
l=QtGui.QLabel("Data:%s"%pp.pformat(rds_data))
l.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse |QtCore.Qt.TextSelectableByKeyboard)
l.setWordWrap(True)

Loading…
Cancel
Save