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 )
if (A[4]) < 0b111:
for i in range(len(A)/2-1):
value = 256*(A[2*i+2]&0b11) + A[2*i+1] - 512
tmp.append( value )
else:
for i in range(len(A)/2-1):
value = 256*(A[2*i+1]&0b11) + A[2*i] - 512
tmp.append( value )
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) )
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()