#plotData.py """ This program will read in a data file from Gnu Radio and plot it. Ellie White 25 Feb. 2017 """ import pylab as plt import os import numpy as np def main(fftsize=8192): infile = 'data-raw.obs' #input("Enter the name of the file to read >>> ") srate = 2000000 #int(input("What is the sampling rate of your SDR? >>> ")) data = [] size = os.path.getsize(infile) / 4 shape = (size/fftsize, fftsize) x = np.memmap(infile, dtype='float32', mode = 'r', shape=shape) #x = np.fromfile(infile, float) print x freqPlot = np.mean(x, axis=0) #print freqPlot fmin = (169010000-(srate/2))/1000000 fmax = (169010000+(srate/2))/1000000 fidx = np.linspace(fmin, fmax, freqPlot.size) plt.plot(fidx, freqPlot) plt.show() if __name__ == "__main__": main()