#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(): infile = input("Enter the name of the file to read >>> ") srate = int(input("What is the sampling rate of your SDR? >>> ")) data = [] size = os.path.getsize(infile) / 4 shape = (size/1024, 1024) x = np.memmap(infile, dtype='float32', mode = 'r', shape=shape) idx = np.linspace(0, (len(x)*1024)/srate, len(x)) chan=522 ts = [] for i in x: ts.append(i[chan]) #appends each time sample from this channel freqPlot = np.mean(x, axis=0) fidx = np.linspace(124000000, 126000000, len(freqPlot)) plt.plot(fidx, freqPlot) plt.show() plt.plot(idx, ts) plt.show() if __name__ == "__main__": main()