import pandas as pd import matplotlib.pyplot as plt from math import floor #Reads in CSV. CSV should have a header. Adjust voltage levels as needed to suite the source data. df = pd.read_csv('CSV00.csv', sep=',') #Trigger levels v_rising = 0.04 v_falling = 0.02 #Extracts voltage data and discards time references y=df['voltage'] #State tracking variable high=0 #Empty array that will contain random bits triggered=[] #Triggers on the rising edge of events exceeding v_rising and does not allow for retriggering until voltage drops below v_falling. for i in range(len(y)): if high==0: if y[i]>v_rising: #The LSB of the event index is stored as the random bit output. triggered.append(i%2) high=1 else: if y[i] 0): workingbyte|=1<