DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExpInstr::FunctionGeneratorDefs Namespace Reference

Definitions to describe waveforms. More...

Classes

struct  FunctionDescType
 Type describing a generic periodic function. More...
 
struct  SineFunctionDescType
 Type describing a sine function. More...
 
struct  RectFunctionDescType
 Type describing a rectangular function. More...
 
struct  RampFunctionDescType
 Type describing a ramp function. More...
 
struct  PulsesDescType
 Type describing function consisting of a series of pulses. More...
 
struct  ModulationDescType
 Type describing modulation parameters for a waveform. More...
 
struct  SweepDescType
 Type describing sweep parameters for a waveform. More...
 
struct  TriggerDescType
 Type describing trigger parameters determining when the waveform is generated. More...
 

Enumerations

enum  WaveformTypes {
  None , Sine , Rect , Ramp ,
  Pulse
}
 Type to determine the waveform type. More...
 

Functions

constexpr FunctionDescType GetDefaultMinFunctionDesc ()
 Determines minimal values assignable to a description of a generic periodic function. More...
 
constexpr FunctionDescType GetDefaultMaxFunctionDesc ()
 Determines maximal values assignable to a description of a generic periodic function. More...
 
constexpr FunctionDescType GetDefaultDefaultFunctionDesc ()
 Determines default values to assign to a description of a generic periodic function. More...
 
constexpr Util::seconds PeriodFromFunctionDesc (const FunctionDescType &FunctionDesc)
 Calculates the period from the given function description. More...
 
double RectFunc (double DutyCycle, double Phase)
 Calculates the value of a rectangular function depending on the current Phase. More...
 
double InvRectFunc (double DutyCycle, double Phase)
 Calculates the value of an inverse rectangular function depending on the current Phase. More...
 
double RampFunc (double RiseFallRatio, double Phase)
 Calculates the value of a ramp function depending on the current Phase. More...
 

Detailed Description

Definitions to describe waveforms.

Enumeration Type Documentation

◆ WaveformTypes

Type to determine the waveform type.

Enumerator
None 

Unspecified/arbitrary waveform.

Sine 

Sine waveform.

Rect 

Rectangular waveform.

Ramp 

Ramp waveform.

Pulse 

Manually defined pulses.

Definition at line 26 of file FunctionGenerator.h.

Function Documentation

◆ GetDefaultDefaultFunctionDesc()

constexpr FunctionDescType DynExpInstr::FunctionGeneratorDefs::GetDefaultDefaultFunctionDesc ( )
constexpr

Determines default values to assign to a description of a generic periodic function.

Returns
Returns a FunctionDescType instance with default values assigned to each field.

Definition at line 337 of file FunctionGenerator.h.

◆ GetDefaultMaxFunctionDesc()

constexpr FunctionDescType DynExpInstr::FunctionGeneratorDefs::GetDefaultMaxFunctionDesc ( )
constexpr

Determines maximal values assignable to a description of a generic periodic function.

Returns
Returns a FunctionDescType instance with maximal possible values assigned to each field.

Definition at line 331 of file FunctionGenerator.h.

◆ GetDefaultMinFunctionDesc()

constexpr FunctionDescType DynExpInstr::FunctionGeneratorDefs::GetDefaultMinFunctionDesc ( )
constexpr

Determines minimal values assignable to a description of a generic periodic function.

Returns
Returns a FunctionDescType instance with minimal possible values assigned to each field.

Definition at line 325 of file FunctionGenerator.h.

◆ InvRectFunc()

double DynExpInstr::FunctionGeneratorDefs::InvRectFunc ( double  DutyCycle,
double  Phase 
)
inline

Calculates the value of an inverse rectangular function depending on the current Phase.

Parameters
DutyCycleDuty cycle of the function (in between 0 and 1)
PhasePhase the function depends on.
Returns
Returns
Heaviside((Phase mod 2*pi) - 2*pi * DutyCycle)

Definition at line 53 of file FunctionGenerator.cpp.

◆ PeriodFromFunctionDesc()

constexpr Util::seconds DynExpInstr::FunctionGeneratorDefs::PeriodFromFunctionDesc ( const FunctionDescType FunctionDesc)
inlineconstexpr

Calculates the period from the given function description.

Parameters
FunctionDescDescription of a generic periodic function
Returns
Returns the period in seconds.

Definition at line 41 of file FunctionGenerator.cpp.

◆ RampFunc()

double DynExpInstr::FunctionGeneratorDefs::RampFunc ( double  RiseFallRatio,
double  Phase 
)
inline

Calculates the value of a ramp function depending on the current Phase.

Parameters
RiseFallRatioRatio between the ramp's falling and rising edge lengths (in between 0 and 1)
PhasePhase the function depends on.
Returns
Returns
RectFunc(Phase, RiseFallRatio) * (Phase mod(2*pi)) / (pi * RiseFallRatio)
+ InvRectFunc(Phase, RiseFallRatio) * ((-Phase) mod(2*pi)) / (pi * (1 - RiseFallRatio))
- 1
double RectFunc(double DutyCycle, double Phase)
Calculates the value of a rectangular function depending on the current Phase.
double InvRectFunc(double DutyCycle, double Phase)
Calculates the value of an inverse rectangular function depending on the current Phase.

Definition at line 61 of file FunctionGenerator.cpp.

◆ RectFunc()

double DynExpInstr::FunctionGeneratorDefs::RectFunc ( double  DutyCycle,
double  Phase 
)
inline

Calculates the value of a rectangular function depending on the current Phase.

Parameters
DutyCycleDuty cycle of the function (in between 0 and 1)
PhasePhase the function depends on.
Returns
Returns
Heaviside(-(Phase mod 2*pi) + 2*pi * DutyCycle)

Definition at line 47 of file FunctionGenerator.cpp.