FPGA Features
Direct Digital Synthesizers
For FPGA based systems ADI reference designs include direct digital synthesizer (DDS) which can generate tones with arbitrary phase, frequency, and amplitude. For each individual DAC channel there are two DDSs which can have a unique phase, frequency, and phase. To configure the DDSs there are a number of methods and properties available depending on the complexity of the configuration.
For the most basic or easiest configuration options use the methods dds_single_tone and dds_dual_tone which generate a one tone or two tones respectively on a specific channel.
import adi
sdr = adi.ad9361()
# Generate a single complex tone
dds_freq_hz = 10000
dds_scale = 0.9
# Enable all DDSs
sdr.dds_single_tone(dds_freq_hz, dds_scale)
To configure DDSs individually a list of scales can be passed to the properties dds_scales, dds_frequencies, and dds_phases.
import adi
sdr = adi.ad9361()
n = len(sdr.dds_scales)
# Enable all DDSs
sdr.dds_enabled = [True] * n
# Set all DDSs to same frequency, scale, and phase
dds_freq_hz = 10000
sdr.dds_phases = [0] * n
sdr.dds_frequencies = [dds_freq_hz] * n
sdr.dds_scales = [0.9] * n
Methods
- class adi.dds.dds
DDS Signal generators: Each reference design contains two DDSs per channel. this allows for two complex tones to be generated per complex channel.
- dds_dual_tone(frequency1, scale1, frequency2, scale2, channel=0)
Generate two tones simultaneously using the DDSs For complex data devices this will create two complex or single sided tones spectrally using four DDSs. For non-complex devices the tone will use two DDSs.
- parameters:
- frequency1: type=integer
Frequency of first tone in hertz of the generated tone. This must be less than 1/2 the sample rate.
- scale1: type=float
Scale of the first tone generated tone in range [0,1]. At 1 the tone will be full-scale.
- frequency2: type=integer
Frequency of second tone in hertz of the generated tone. This must be less than 1/2 the sample rate.
- scale2: type=float
Scale of the second tone generated tone in range [0,1]. At 1 the tone will be full-scale.
- channel: type=integer
Channel index to generate tone from. This is zero based and for complex devices this index relates to the pair of related converters. For non-complex devices this is the index of the individual converters.
- property dds_enabled
DDS generator enable state
- property dds_frequencies
Frequencies of DDSs in Hz
- property dds_phases
Phases of DDS signal generators. Range in millidegrees [0,360000]
- property dds_scales
Scale of DDS signal generators Ranges [0,1]
- dds_single_tone(frequency, scale, channel=0)
Generate a single tone using the DDSs For complex data devices this will create a complex or single sided tone spectrally using two DDSs. For non-complex devices the tone will use a single DDS.
- parameters:
- frequency: type=integer
Frequency in hertz of the generated tone. This must be less than 1/2 the sample rate.
- scale: type=float
Scale of the generated tone in range [0,1]. At 1 the tone will be full-scale.
- channel: type=integer
Channel index to generate tone from. This is zero based and for complex devices this index relates to the pair of related converters. For non-complex devices this is the index of the individual converters.