atomiq.components.electronics.adc module¶
All analog voltages have to go through an ADC at some point to enter the digital world. Often ADCs appear as
multi-channel devices that sample several channels at once. Thus the ADC itself and its channels are represented
by seperate classes. The ADC
class provides a ADC.measure()
function to sample all channels at once
while the ADCChannel
provides a ADCChannel.measure()
method to extract only a single channel from the
ADC.
- class atomiq.components.electronics.adc.ADC(num_chan, *args, **kwargs)[source]¶
Bases:
Component
,Measurable
An analog-to-ditigal converter (ADC) with multiple channels
Many ADCs come with multiple channels that are always sampled together. This class represents such ADCs
- Parameters:
num_chan (TInt32) -- Number of channels the ADC has.
A Measurable has one or more channels at which data can be measured
- kernel_invariants = {'num_chan'}¶
- measure(samples=1, channel='')[source]¶
Measures all channels and returns the mean for a given number of subsequent samples.
This method advances the timeline by samples * sampling_time
- Parameters:
samples (TInt32) -- number of samples to take and average
channel (TStr)
- Return type:
TArray(TFloat)
- measurement_channels()¶
- class atomiq.components.electronics.adc.ADCChannel(adc_device, channel, *args, **kwargs)[source]¶
Bases:
Component
,Measurable
A single channel of a (possibly multichannel) ADC
- Parameters:
adc_device (ADC) -- The ADC the channel belongs to
channel (TInt32) -- The number of the channel
- kernel_invariants = {'adc_device', 'channel'}¶
- measure(samples=1, cached=False, channel='')[source]¶
- Parameters:
samples (artiq.language.types.TInt32)
cached (artiq.language.types.TBool)
channel (artiq.language.types.TStr)
- Return type:
artiq.language.types.TFloat
- measurement_channels()¶