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 ore 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 (artiq.compiler.types.TMono('int', OrderedDict({'width': artiq.compiler.types.TValue(32)}))) -- number of samples to take and average

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

Return type:

artiq.compiler.types.TMono('array', OrderedDict({'elt': artiq.compiler.types.TMono('float', OrderedDict()), 'num_dims': artiq.compiler.types.TValue(1)}))

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.compiler.types.TMono('int', OrderedDict({'width': artiq.compiler.types.TValue(32)})))

  • cached (artiq.compiler.types.TMono('bool', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

Return type:

artiq.compiler.types.TMono('float', OrderedDict())