i am looking for how to use the filter possibilities of the Analog Discovery 2. In the first step i want filter the min and max values of my incomming signal, if possible with time stamp or something else. (my receiving signal is a sinus). Maybe someone can help me how to get this function working. Following my code example.
Question
Weevil
Hello,
i am looking for how to use the filter possibilities of the Analog Discovery 2. In the first step i want filter the min and max values of my incomming signal, if possible with time stamp or something else. (my receiving signal is a sinus). Maybe someone can help me how to get this function working. Following my code example.
Greetings from Germany
libdwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0), c_bool(True))
libdwf.FDwfAnalogInFrequencySet(hdwf, c_double(100000000))
libdwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(-1), c_double(5))
libdwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(5000))
#####----
#Filter
libdwf.FDwfAnalogInChannelFilterSet(c_int(1), c_int(1))
#FILTER
#filterDecimate = c_int(0)
#filterAverage = c_int(1)
#filterMinMax = c_int(2)
#####-----
time.sleep(2)
sts = c_int()
rgc1 = (c_double(5000))()
rgc2 = (c_double(5000))()
libdwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1))
libdwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
#Channel 1
libdwf.FDwfAnalogInStatusData(hdwf, c_int(0), byref(rgc1), len(rgc1))
results1 = np.array(rgc1)
#Channel 2
libdwf.FDwfAnalogInStatusData(hdwf, c_int(1), byref(rgc2), len(rgc2))
results2 = np.array(rgc2)
print(results1)
libdwf.FDwfDeviceCloseAll()
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.