aboutsummaryrefslogtreecommitdiffstats
path: root/python/trx
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-12-01 05:08:35 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-12-01 05:08:35 +0700
commit4650fad7cb3acf103775a1f14beb131650b09ebf (patch)
tree6ad5b6679dfd8afe2e85d128cd4fbb0adfc73bcc /python/trx
parent73857235f0651293eb9396c9ef81058b6935c0db (diff)
trx/radio_if.py: use native burst_type_filter block
Diffstat (limited to 'python/trx')
-rw-r--r--python/trx/radio_if.py25
1 files changed, 1 insertions, 24 deletions
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index 689f074..9c26ec6 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -37,29 +37,6 @@ from gnuradio import gr
# HACK: should be implemented in C++!
-import numpy as np
-
-class burst_type_filter(gr.sync_block):
- def __init__(self, burst_types=[]):
- gr.sync_block.__init__(
- self,
- name='Burst type filter',
- in_sig=[],
- out_sig=[]
- )
- self.burst_types = burst_types
- self.message_port_register_in(pmt.intern("bursts_in"))
- self.message_port_register_out(pmt.intern("bursts_out"))
- self.set_msg_handler(pmt.intern("bursts_in"), self.filter)
-
- def filter(self, msg):
- burst_with_header = pmt.to_python(pmt.cdr(msg))
- burst = burst_with_header[-148:]
- header = np.ndarray.tolist(burst_with_header[0:-148])
- burst_type = header[12]
- if burst_type in self.burst_types:
- self.message_port_pub(pmt.intern("bursts_out"), msg)
-
class burst_to_fn_time(gr.basic_block):
def __init__(self): # only default arguments here
gr.basic_block.__init__(
@@ -210,7 +187,7 @@ class radio_if(gr.top_block):
# RX & TX synchronization
- self.bt_filter = burst_type_filter([3])
+ self.bt_filter = grgsm.burst_type_filter([3])
self.burst_to_fn_time = burst_to_fn_time()
# Connections