InterpolatedWaveform

InterpolatedWaveform#

class InterpolatedWaveform(options)#

Bases: Waveform

Constructor Summary
InterpolatedWaveform(options)#

Construct a SineWave.

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

  • startTime (double, optional) – Start time \(t_0\) [s] (default: 0)

  • duration (double, optional) – Duration \(T\) [s] (default: [])

  • amplitude (double, optional) – Waveform amplitude (default: [])

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

  • frequency (double, optional) – Frequency \(f\) [Hz] (default: [])

  • phase (double, optional) – Phase \(\phi\) [rad] (default: 0)

Property Summary
SampleData double#
TimeData double#
Method Summary
TimeFunc()#

Get the time function for the sine wave.

Implements the abstract TimeFunc() from Waveform by returning \(f(t) = \mathbb{1}_{[t_0,t_0+T]}(t)\,(A/2\,\sin(2\pi f (t-t_0)+\phi)+\mathrm{offset})\).

Returns:

Function that takes time array and returns sine wave values

Return type:

function_handle

Example:

sine = SineWave(frequency = 1000, amplitude = 1.0);
func = sine.TimeFunc();
t = 0:0.001:0.01;
y = func(t);