Waveform#
- class Waveform#
Bases:
handleWaveformgenerates and stores waveforms for experimental control.A waveform can represent either a continuous function of time or a discrete time-sequence of samples. The definition is given by
TimeFunc(), which returns a function handle mapping time \(t\) to the waveform value.The waveform samples are calculated lazily when
Sampleis accessed, based onTimeFunc()and timing parameters (StartTime,Duration,SamplingRate).Example1:
% Create a sine wave sine = SineWave(frequency = 1000, amplitude = 1.0, duration = 0.01); samples = sine.Sample; % Get waveform samples sine.plot(); % Plot the waveform
Example2:
% Create a constant waveform const = ConstantWave(amplitude = 5.0, duration = 0.005); const.plot();
- Constructor Summary
- Property Summary
- Duration double {mustBeNonnegative} = 0.1#
Duration \(T\) [s]
- NSample#
Number of samples derived from
SamplingRateandDuration
- Sample#
Samples constructed by evaluating
TimeFunc()on [StartTime, EndTime]
- SamplingRate double {mustBePositive} = 1#
Sampling rate [Hz]
- Scan = table(string.empty,string.empty,'VariableNames',{'ParameterName','VariableName'})#
Parameter scan table for control panels
- StartTime double = 0#
Start time \(t_0\) [s]
- TimeStep#
\(\Delta t = 1/\)
SamplingRate[s]
- Method Summary
- convert2Table()#
Get a table representation of waveform parameters for UI/database.
Collects configurable properties, applies scan mappings if present, and returns a compact table for storage or display.
- Returns:
Table with columns: Type, SamplingRate, Parameter, and optionally modulation IDs
- Return type:
table
- plot()#
Plot waveform samples versus time with LaTeX-formatted labels.
Example:
sine = SineWave(frequency = 1000, amplitude = 1.0); sine.plot();