TrapezoidalPulse

TrapezoidalPulse#

class TrapezoidalPulse(options)#

Bases: PartialPeriodicWaveform, ConstantTop

TrapezoidalPulse generates trapezoidal pulse signals with rise and fall transitions.

Creates pulse signals with linear rise and fall transitions and a constant amplitude plateau. Useful for smooth pulse generation with controlled transition times. Inherits from PartialPeriodicWaveform and ConstantTop.

Example1:

% Create a trapezoidal pulse with rise and fall times
pulse = TrapezoidalPulse(amplitude = 2.0, duration = 0.01, ...
                         riseTime = 0.001, fallTime = 0.001);
pulse.plot();

Example2:

% Create a pulse with only rise time
pulse = TrapezoidalPulse(amplitude = 1.0, duration = 0.01, riseTime = 0.002);
pulse.plot();
Constructor Summary
TrapezoidalPulse(options)#

Construct a TrapezoidalPulse object.

Parameters:
  • samplingRate (double, optional) – Sampling rate in Hz (default: [])

  • startTime (double, optional) – Start time in seconds (default: 0)

  • duration (double, optional) – Duration in seconds (default: [])

  • amplitude (double, optional) – Peak-to-peak amplitude (default: [])

  • offset (double, optional) – DC offset (default: 0)

  • riseTime (double, optional) – Rise transition time in seconds (default: 0)

  • fallTime (double, optional) – Fall transition time in seconds (default: 0)

Method Summary
TimeFunc()#

Get the time function for the trapezoidal pulse.

Creates a function handle that generates trapezoidal pulse values with linear rise and fall transitions. Implements the abstract TimeFunc() method from Waveform.

Returns:

Function that takes time array and returns trapezoidal pulse values

Return type:

function_handle