diff options
Diffstat (limited to 'histogram.py')
-rwxr-xr-x | histogram.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/histogram.py b/histogram.py new file mode 100755 index 0000000..c17a255 --- /dev/null +++ b/histogram.py @@ -0,0 +1,28 @@ +#!/usr/bin/python2 +# +# Print sample histograms from dabmod I/Q file + +import sys + +import pylab as P +import numpy + + +fd = open('test.iq', 'rb') + +read_data = numpy.fromfile(file=fd, dtype=numpy.float32, count=-1) + +print("MAX absolute value: {}".format(numpy.max(numpy.abs(read_data)))) + +if 0: + P.plot(read_data) + +if 1: + P.figure() + + # the histogram of the data with histtype='step' + n, bins, patches = P.hist(read_data, 50, normed=1, histtype='stepfilled') + P.setp(patches, 'facecolor', 'g', 'alpha', 0.75) + +P.show() + |