HackRF Jawbreaker enhancements -- selectable DC blocking filter improves short
pkt decoding.
This commit is contained in:
@@ -427,7 +427,7 @@ def make_parser(pub):
|
||||
try:
|
||||
ret = air_modes.modes_report(modes_reply(int(data, 16)),
|
||||
int(ecc, 16),
|
||||
10.0*math.log10(float(reference)),
|
||||
10.0*math.log10(max(1e-8,float(reference))),
|
||||
air_modes.stamp(0, float(timestamp)))
|
||||
pub["modes_dl"] = ret
|
||||
pub["type%i_dl" % ret.data.get_type()] = ret
|
||||
|
||||
@@ -45,7 +45,8 @@ class modes_radio (gr.top_block, pubsub):
|
||||
self._resample = None
|
||||
self._setup_source(options)
|
||||
|
||||
self._rx_path = air_modes.rx_path(self._rate, options.threshold, self._queue, options.pmf)
|
||||
self._rx_path = air_modes.rx_path(self._rate, options.threshold,
|
||||
self._queue, options.pmf, options.dcblock)
|
||||
|
||||
#now subscribe to set various options via pubsub
|
||||
self.subscribe("freq", self.set_freq)
|
||||
@@ -106,6 +107,8 @@ class modes_radio (gr.top_block, pubsub):
|
||||
help="set pulse detection threshold above noise in dB [default=%default]")
|
||||
group.add_option("-p","--pmf", action="store_true", default=False,
|
||||
help="Use pulse matched filtering [default=%default]")
|
||||
group.add_option("-d","--dcblock", action="store_true", default=False,
|
||||
help="Use a DC blocking filter (best for HackRF Jawbreaker) [default=%default]")
|
||||
|
||||
parser.add_option_group(group)
|
||||
|
||||
@@ -186,8 +189,9 @@ class modes_radio (gr.top_block, pubsub):
|
||||
options.gain = 34
|
||||
###DO NOT COMMIT
|
||||
self._u.set_gain(14, "RF", 0)
|
||||
self._u.set_gain(40, "IF", 0)
|
||||
self._u.set_gain(30, "IF", 0)
|
||||
self._u.set_gain(6, "BB", 0)
|
||||
self._u.set_bandwidth(4e6)
|
||||
###DO NOT COMMIT
|
||||
# self._u.set_gain(options.gain)
|
||||
print "Gain is %i" % self._u.get_gain()
|
||||
|
||||
@@ -24,7 +24,7 @@ import air_modes_swig
|
||||
|
||||
class rx_path(gr.hier_block2):
|
||||
|
||||
def __init__(self, rate, threshold, queue, use_pmf=False):
|
||||
def __init__(self, rate, threshold, queue, use_pmf=False, use_dcblock=False):
|
||||
gr.hier_block2.__init__(self, "modes_rx_path",
|
||||
gr.io_signature(1, 1, gr.sizeof_gr_complex),
|
||||
gr.io_signature(0,0,0))
|
||||
@@ -36,9 +36,13 @@ class rx_path(gr.hier_block2):
|
||||
|
||||
# Convert incoming I/Q baseband to amplitude
|
||||
self._demod = blocks.complex_to_mag_squared()
|
||||
# self._dcblock = filter.dc_blocker_ff(128, False)
|
||||
self._bb = self._demod
|
||||
if use_dcblock:
|
||||
self._dcblock = filter.dc_blocker_cc(100*self._spc,True)
|
||||
self.connect(self, self._dcblock, self._demod)
|
||||
else:
|
||||
self.connect(self, self._demod)
|
||||
|
||||
self._bb = self._demod
|
||||
# Pulse matched filter for 0.5us pulses
|
||||
if use_pmf:
|
||||
self._pmf = blocks.moving_average_ff(self._spc, 1.0/self._spc)#, self._rate)
|
||||
@@ -55,7 +59,6 @@ class rx_path(gr.hier_block2):
|
||||
self._slicer = air_modes_swig.slicer(self._queue)
|
||||
|
||||
# Wire up the flowgraph
|
||||
self.connect(self, self._demod)#, self._dcblock)
|
||||
self.connect(self._bb, (self._sync, 0))
|
||||
self.connect(self._bb, self._avg, (self._sync, 1))
|
||||
self.connect(self._sync, self._slicer)
|
||||
|
||||
Reference in New Issue
Block a user