X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gr-msdd6000%2Fsrc%2Fpython_test%2Fcapture_tcp_one_set.py;fp=gr-msdd6000%2Fsrc%2Fpython_test%2Fcapture_tcp_one_set.py;h=7a106a63a695ba0ac5fa42434f0639d9c9e47aba;hb=8a9ddbb0675f9bfcc6e03b457fba6c79474a3693;hp=0000000000000000000000000000000000000000;hpb=82d471b9b4a8b389b5da44b19c69c36420828382;p=debian%2Fgnuradio diff --git a/gr-msdd6000/src/python_test/capture_tcp_one_set.py b/gr-msdd6000/src/python_test/capture_tcp_one_set.py new file mode 100644 index 00000000..7a106a63 --- /dev/null +++ b/gr-msdd6000/src/python_test/capture_tcp_one_set.py @@ -0,0 +1,156 @@ +#!/usr/bin/python + +from socket import * +import string +import time +import struct; +import random; +import array; +import cmath; +from numpy import *; +from numpy.fft import *; +from pylab import *; + +myport = random.randint(1025,65535); +filename = "output.dat"; + +port = 10000 +host = "10.45.4.46" +#host = "10.45.4.41" +myaddr = ('',myport); + +buf = 100000; + +TCPSock = socket(AF_INET,SOCK_STREAM); +TCPSock.bind(myaddr); +TCPSock.connect((host,port)); + +#f_mhz = 2647; # roof ofdm +if(len(sys.argv)!= 3): + print "usage: %s fc_ghz decim_pow2_exponent"%(sys.argv[0]); + sys.exit(-1); + +f_mhz = float(sys.argv[1])*1000; +decim = int(sys.argv[2]); + +#f_mhz = 3500; +#f_mhz = 2600; +f_hz = 0; # offset +gain = 0; +window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman + +samples = 65536; +#samples = 16777216; +samples = samples*4; #bytes of data we are requesting +samples=samples*2; +#decim = 2; #0-8 (3 => 2^3 = 8) +decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats +mode = 0; #0=IQ, 1=MAG, 2=MAGDB +sets = 1; + +raw_data = struct.pack("