KCL-BMEIS / spectrumdevice

Python library for communicating with digitisers manufactured by Spectrum Instrumentation
MIT License
6 stars 2 forks source link

Implement a notify size for faster acquisition, enabling bulk acquisitions #31

Closed crnbaker closed 1 year ago

crnbaker commented 1 year ago

Previously, the "notify size" feature of the driver was not made use of: samples were only read from a transfer buffer after the transfer was complete. Now, samples are read once notification from the driver is received that "notify size" samples have been transferred, so that samples are read out of the transfer buffer while the acquisition is still going on.

This means that waveforms can now be acquired in bulk: get_waveforms has a new argument num_acquisitions which specifies the number of acquisitions that should be carried out before the samples are returns. This allows the user to carry out fast software averaging:

from numpy import array
...
num_averages = 4
average_waveforms = array(card.get_waveforms(num_averages)).mean(axis=0)

This branch also includes some more refactoring in preparation for supporting AWGs.

Fixes #30