diff --git a/gr_grc/scripts/read_meta_file_source.py b/gr_grc/scripts/read_meta_file_source.py new file mode 100644 index 0000000000000000000000000000000000000000..3a7194ebd3922ab0baba7954933e8d58e34d12af --- /dev/null +++ b/gr_grc/scripts/read_meta_file_source.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python2.7 +# -*- encoding: utf-8 -*- + +import scipy +import pmt +from gnuradio.blocks import parse_file_metadata + +# convert file into pynum array +f = scipy.fromfile(open("one_sample.iq"), dtype=scipy.complex64) + +# extract header information +handle = open("one_sample.iq", "rb") +hdr_start = handle.tell() +header_str = handle.read(parse_file_metadata.HEADER_LENGTH) +header = pmt.deserialize_str(header_str) + +print(f.__class__) +print(header.__class__) + +print(header) +for i in f.flat: + print("I: %s Q: %s" % (i.real, i.imag))