PeriodicWaveform

PeriodicWaveform#

class PeriodicWaveform#

Bases: Waveform

PeriodicWaveform abstract base class for periodic waveform generation.

Provides common functionality for waveforms that repeat with a defined frequency, period, and phase. Supports cycle-based repetition and hardware-optimized sample generation for efficient waveform output.

Example1:

% Create a periodic sine wave
sine = SineWave(frequency = 1000, amplitude = 1.0, duration = 0.01);
sine.plotOneCycle();

Example2:

% Check repetition properties
disp(['Period: ', num2str(sine.Period), ' s']);
disp(['Number of repeats: ', num2str(sine.NRepeat)]);
Constructor Summary
PeriodicWaveform()#

Construct a PeriodicWaveform object.

Abstract base class constructor. Subclasses should implement their own constructors with appropriate parameters.

Property Summary
Amplitude double = 0#

Peak-to-peak amplitude, usually in Volts.

DurationOneCycle#

Duration of one complete cycle segment.

EndTimeAllCycle#

End time of all complete cycles.

Frequency double {mustBePositive} = 100#

In Hz

NPeriod#

Number of complete periods in the waveform duration.

NRepeat#

Number of times the cycle segment repeats.

Offset double = 0#

Offset, usually in Volts.

Period#

In s - Time period of one complete cycle.

Phase double = 0#

In radians

SampleExtra#

Extra samples beyond complete cycles.

SampleOneCycle#

Sample values for one complete cycle.

Method Summary
plotExtra()#

Plot extra samples beyond complete cycles.

Example:

sine = SineWave(frequency = 1000, amplitude = 1.0, duration = 0.015);
sine.plotExtra();
plotOneCycle()#

Plot one complete cycle of the periodic waveform.

Example:

sine = SineWave(frequency = 1000, amplitude = 1.0);
sine.plotOneCycle();