Open Source implementation of APCO P25
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1004 B

#!/usr/bin/env python
from gnuradio import gr, audio, eng_notation, blocks
from gnuradio.eng_option import eng_option
from optparse import OptionParser
class app_top_block(gr.top_block):
def __init__(self, options):
IN = blocks.file_source(gr.sizeof_char, options.input_file)
bits_per_symbol = 2
UNPACK = blocks.packed_to_unpacked_bb(bits_per_symbol, gr.GR_MSB_FIRST)
OUT = blocks.file_sink(gr.sizeof_char, options.output)
self.connect(IN, UNPACK, OUT)
def main():
parser = OptionParser(option_class=eng_option)
parser.add_option("-i", "--input-file", type="string", default="in.dat", help="specify the input file")
parser.add_option("-o", "--output", type="string", default="out.dat", help="specify the output file")
(options, args) = parser.parse_args()
tb = app_top_block(options)
except KeyboardInterrupt:
if __name__ == "__main__":