WaveformList

WaveformList#

class WaveformList(name, options)#

Bases: handle

WaveformList manages a collection of waveforms for complex sequences.

Combines multiple Waveform objects into a single sequence using either sequential concatenation or simultaneous superposition. Supports periodic waveforms with repeat counts and trigger-advance modes for hardware control.

Example1:

% Create a sequence of different waveforms
sine = SineWave(frequency = 1000, amplitude = 1.0, duration = 0.01);
const = ConstantWave(amplitude = 2.0, duration = 0.005);
list = WaveformList(name = 'mySequence', waveformOrigin = {sine, const});
list.plot();

Example2:

% Simultaneous waveforms
list = WaveformList(name = 'simultaneous', concatMethod = 'Simultaneous', ...
                    waveformOrigin = {sine, const});
Constructor Summary
WaveformList(name, options)#

Construct a WaveformList object.

Parameters:
  • name (string) – Name of the waveform list

  • samplingRate (double, optional) – Sampling rate in Hz (default: 1000)

  • concatMethod (string, optional) – Concatenation method (default: ‘Sequential’)

  • patchMethod (string, optional) – Gap filling method (default: ‘Continue’)

  • patchConstant (double, optional) – Constant for gap filling (default: 0)

  • isTriggerAdvance (logical, optional) – Use trigger advance mode (default: false)

  • waveformOrigin (cell, optional) – Cell array of waveform objects (default: {})

  • nCycle (double, optional) – Number of cycles for periodic waveforms (default: 10)

Example:

sine = SineWave(frequency = 1000, amplitude = 1.0);
list = WaveformList(name = 'myList', waveformOrigin = {sine}, samplingRate = 10000);
Property Summary
ConcatMethod string {mustBeMember(ConcatMethod,{'Sequential','Simultaneous'})} = "Sequential"#

Method for combining waveforms: ‘Sequential’ or ‘Simultaneous’.

IsEmpty logical#

WaveformPrepared Table % Table containing prepared waveform segments with play modes and repeat counts.

IsTriggerAdvance logical = false#

Whether to use trigger-advance mode for hardware control.

NPeriodPerCycle double = 10#

Number of cycles for periodic waveforms.

NSample double#

Total number of samples in the combined waveform.

Name string#

Name of the waveform list.

OverrideFunction string = "None"#

To override the waveform output. Can take variable input. Must be a function that outputs a WaveformList.

OverrideWaveformList#
PatchConstant double = 0#

Constant value used when PatchMethod is ‘Constant’.

PatchMethod string {mustBeMember(PatchMethod,{'Continue','Constant'})} = "Continue"#

Method for filling gaps between waveforms: ‘Continue’ or ‘Constant’.

PlotNumberLimit = 1e6#

Maximum number of points to plot before downsampling for display.

RepeatMode string#

Repeat mode for hardware control (‘Repeat’ or ‘RepeatTilTrigger’).

Sample#

Combined waveform samples as a vector.

SamplingRate double#

In Hz - Sampling rate for all waveforms in the list.

TimeStep#

Time step between samples (1/SamplingRate).

TransformFunction string = "None"#

To transform the waveform. Must be a function defined in matlab’s search path.

WaveformOrigin cell#

Cell array of waveform objects to be combined.

Method Summary
TimeFunc()#

Get the time function for the combined waveform.

Creates a function handle that evaluates the combined waveform at any time point, handling the concatenation method and timing.

Returns:

Function that takes time array and returns combined waveform values

Return type:

function_handle

Check waveform origin

WaveformPrepared()#

Prepare waveform segments for hardware output.

Combines individual waveforms according to the concatenation method and returns a table with segments, play modes, and repeat counts.

Returns:

Table with columns: Sample, PlayMode, NRepeat

Return type:

table

Check waveform origin

convert2Table()#

Convert list configuration to a table for serialization.

Returns:

Table with list configuration fields suitable for saving

Return type:

table

plot(ax)#

Plot the combined waveform.

Parameters:

ax (axes, optional) – Target axes for plotting (default: new figure)

Example:

list = WaveformList(name = 'myList', waveformOrigin = {sine, const});
list.plot();