First stab at interrogation uplink processing. Getting bits, inefficiently.

uplink
Nick Foster 12 years ago
parent 4d2587574a
commit 77d695f2ef

@ -25,5 +25,6 @@ install(FILES
slicer.h
types.h
api.h
uplink.h
DESTINATION include/gr_air_modes
)

@ -26,6 +26,7 @@ add_library(air_modes SHARED
preamble_impl.cc
slicer_impl.cc
modes_crc.cc
uplink_impl.cc
)
target_link_libraries(air_modes ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES})
set_target_properties(air_modes PROPERTIES DEFINE_SYMBOL "AIR_MODES_EXPORTS")

@ -51,7 +51,7 @@ from air_modes_swig import *
# import any pure python here
#
from rx_path import rx_path
from rx_path import rx_path, uplink_rx_path
from zmq_socket import zmq_pubsub_iface
from parse import *
from msprint import output_print

@ -86,3 +86,46 @@ class rx_path(gr.hier_block2):
def get_threshold(self, threshold):
return self._sync.get_threshold()
class uplink_rx_path(gr.hier_block2):
def __init__(self, rate, threshold, queue, use_pmf=False, use_dcblock=False):
gr.hier_block2.__init__(self, "modes_uplink_rx_path",
gr.io_signature(1, 1, gr.sizeof_gr_complex),
gr.io_signature(0,0,0))
self._rate = int(rate)
self._threshold = threshold
self._queue = queue
self._spc = int(rate/4e6)
#demodulate DPSK via delay
self._delay = gr.delay(gr.sizeof_gr_complex, self._spc)
self._mult = gr.multiply_cc()
self._conj = gr.conjugate_cc()
self._c2r = gr.complex_to_real()
#self._bb = self._demod
self.filesink = gr.file_sink(gr.sizeof_float, "wat.dat")
# Pulse matched filter for 0.25us pulses
# if use_pmf:
# self._pmf = gr.moving_average_ff(self._spc, 1.0/self._spc, self._rate)
# self.connect(self._demod, self._pmf)
# self._bb = self._pmf
# Establish baseline amplitude (noise, interference)
self._avg = gr.moving_average_ff(48*self._spc, 1.0/(48*self._spc), self._rate) # 3 preambles
# Synchronize to uplink preamble
self._sync = air_modes_swig.modes_uplink(self._rate, self._threshold)
# Slice Mode-S bits and send to message queue
# self._slicer = air_modes_swig.modes_slicer(self._rate, self._queue)
# Wire up the flowgraph
self.connect(self, (self._mult, 0))
self.connect(self, self._delay, self._conj, (self._mult, 1))
self.connect(self._mult, self._c2r)
self.connect(self._c2r, (self._sync, 0))
self.connect(self._c2r, self._avg, (self._sync, 1))
# self.connect(self._sync, self._slicer)
self.connect(self._sync, self.filesink)

@ -11,7 +11,9 @@
%include "gr_air_modes/preamble.h"
%include "gr_air_modes/slicer.h"
%include "gr_air_modes/uplink.h"
GR_SWIG_BLOCK_MAGIC2(air_modes,preamble);
GR_SWIG_BLOCK_MAGIC2(air_modes,slicer);
GR_SWIG_BLOCK_MAGIC2(air_modes,uplink);

Loading…
Cancel
Save