20180403a - Client side

  • Testing with the "20180224b-binary.bin" binary
  • Wanted to test the 75V pulser
import numpy as np
import matplotlib.pyplot as plt
import re
import glob, os

AA = []
lbl = []
filenames = []
for CSVFile in glob.glob("*.csv"):
    A = np.genfromtxt(CSVFile, delimiter=';').astype(int)[1:]
    tmp = [] 
    N = len(A)
    FF = CSVFile.split(".")[0].split("-")[-1]
    lbl.append(  CSVFile.split("-")[2] )
    f = int(re.sub('[^0-9]','', FF))
    filenames.append(  CSVFile )
    #F = int(CSVFile.split(".")[0])

    if (A[4]) < 0b111: 
        for i in range(len(A)/2-1):
            value = 256*(A[2*i+2]&0b11) + A[2*i+1] - 512
            #print A[2*i]&0b10000000,A[2*i+1]&0b10000000,
            tmp.append( value )
            #print A[2*i+1]
            #print A[i+1]-A[i]
    else:

        for i in range(len(A)/2-1):
            value = 256*(A[2*i+1]&0b11) + A[2*i] - 512
            #print A[2*i]&0b10000000,A[2*i+1]&0b10000000,
            tmp.append( value )
            #print A[2*i+1]
            #print A[i+1]-A[i] 

    AA.append(tmp)

    t = [ 1.0*x/f for x in range(len(tmp))]

    plt.plot(t,tmp)
    plt.title(str(f) + " Msps - "+ CSVFile)
    plt.savefig("./"+CSVFile.split(".")[0].split("/")[-1]+".jpg")
    plt.show()


    np.savez("20180403a.npz", np.int16(t), np.int16(tmp) )

png

Reviewing the spectrum of the acquisition

plt.figure(figsize=(15,5))

FFT = np.fft.fft(AA[0])
l = len(FFT)/2
fx = [ f*1.0*x/(2.0*l) for x in range(len(FFT))]

plt.title("FFT of "+filenames[0])
plt.plot(fx[1:l],np.abs(FFT)[1:l])
plt.xlabel("Frequency (MHz)")
plt.savefig("fft.jpg")
plt.show()

png



results matching ""

    No results matching ""