awg_creation_demo

Usage
usage: awg_creation_demo.py [-h] [--fn FN] [--w W] [--nsam NSAM] [--nchan NCHAN] [--even_ch_to_zeros EVEN_CH_TO_ZEROS] [--dir DIR] [--scale SCALE] [--ds DS]

Named Arguments

--fn

Generator function default:np.sin()

Default: “np.sin”

--w

Angular frequency

Default: 1

--nsam

Size of wave to generate.

Default: 30000

--nchan

Number of channels in AO module.

Default: 32

--even_ch_to_zeros

Whether to set even channels to zero.

Default: 0

--dir

Location to save files

Default: “waves”

--scale

Raw Scale Factor

Default: 32767

--ds

Data size in bits

Default: 16

Outline:

This script will generate a binary file that can be used to output a waveform on D-TACQ AO modules.

To have the UUT output a single sample the file should have 32 int16s ie (CH1 CH2 … CH32) where the value for each channel can be different (they will not be different for this example). The user can extend this to as many samples as necessary and to any value necessary i.e the values do not need to be the same across channels (channel 1 could be a sine wave, channel 2 could be a sinc wave etc).

In this script we are outputting the same identical sine wave across all 32 channels for nsam number of samples. There is also an argument called even_ch_to_zeros that, if set, will set all of the even channels to zero to illustrate how the channels are ordered.

Example usage:

To create the default file:

python awg_creation_demo.py

To create binary file with even channels set to 0 and a wave size of 3000 samples:

python awg_creation_demo.py --nsam=3000 --even_ch_to_zeros=1

To upload awg files once it has been generated use the following python script:

python acq1001_awg_demo.py --files="../acq400/waves/example_awg" --capture=1 --awglen=<awg_length> <UUT name>
create_array(nsam, args)[source]
generate_awg(args)[source]
run_main(args)[source]
get_parser()[source]