libsmu  1.0.4
Library for interfacing with ADALM1000 devices
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
smu::Signal Class Reference

Generic signal class. More...

#include <libsmu.hpp>

Public Member Functions

 Signal (const sl_signal_info *info=NULL)
 internal: Do not call the constructor directly; obtain a Signal from a Device.
 
const sl_signal_infoinfo () const
 Get the descriptor struct of the Signal. Pointed-to memory is valid for the lifetime of the Device.
 
void constant (std::vector< float > &buf, uint64_t samples, float val)
 Generate a constant waveform. More...
 
void square (std::vector< float > &buf, uint64_t samples, float midpoint, float peak, double period, double phase, double duty)
 Generate a square waveform. More...
 
void sawtooth (std::vector< float > &buf, uint64_t samples, float midpoint, float peak, double period, double phase)
 Generate a sawtooth waveform. More...
 
void stairstep (std::vector< float > &buf, uint64_t samples, float midpoint, float peak, double period, double phase)
 Generate a stairstep waveform. More...
 
void sine (std::vector< float > &buf, uint64_t samples, float midpoint, float peak, double period, double phase)
 Generate a sinusoidal waveform. More...
 
void triangle (std::vector< float > &buf, uint64_t samples, float midpoint, float peak, double period, double phase)
 Generate a triangle waveform. More...
 

Public Attributes

const sl_signal_info *const m_info
 Signal information.
 

Protected Member Functions

float get_sample ()
 Generate value for currently selected waveform.
 

Detailed Description

Generic signal class.

Member Function Documentation

◆ constant()

void smu::Signal::constant ( std::vector< float > &  buf,
uint64_t  samples,
float  val 
)

Generate a constant waveform.

Parameters
bufBuffer object to store waveform into.
samplesNumber of samples to create for the waveform.
valThe constant value used to populate the buffer

◆ sawtooth()

void smu::Signal::sawtooth ( std::vector< float > &  buf,
uint64_t  samples,
float  midpoint,
float  peak,
double  period,
double  phase 
)

Generate a sawtooth waveform.

Parameters
bufBuffer object to store waveform into.
samplesNumber of samples to create for the waveform.
midpointValue at the middle of the wave.
peakMaximum value of the wave.
periodNumber of samples the wave takes for one cycle.
phasePosition in time (sample number) that the wave starts at.

◆ sine()

void smu::Signal::sine ( std::vector< float > &  buf,
uint64_t  samples,
float  midpoint,
float  peak,
double  period,
double  phase 
)

Generate a sinusoidal waveform.

Parameters
bufBuffer object to store waveform into.
samplesNumber of samples to create for the waveform.
midpointValue at the middle of the wave.
peakMaximum value of the wave.
periodNumber of samples the wave takes for one cycle.
phasePosition in time (sample number) that the wave starts at.

◆ square()

void smu::Signal::square ( std::vector< float > &  buf,
uint64_t  samples,
float  midpoint,
float  peak,
double  period,
double  phase,
double  duty 
)

Generate a square waveform.

Parameters
bufBuffer object to store waveform into.
samplesNumber of samples to create for the waveform.
midpointValue at the middle of the wave.
peakMaximum value of the wave.
periodNumber of samples the wave takes for one cycle.
phasePosition in time (sample number) that the wave starts at.
dutyDuty cycle of the waveform (fraction of time in which the signal is active, e.g. 0.5 is half the time).

◆ stairstep()

void smu::Signal::stairstep ( std::vector< float > &  buf,
uint64_t  samples,
float  midpoint,
float  peak,
double  period,
double  phase 
)

Generate a stairstep waveform.

Parameters
bufBuffer object to store waveform into.
samplesNumber of samples to create for the waveform.
midpointValue at the middle of the wave.
peakMaximum value of the wave.
periodNumber of samples the wave takes for one cycle.
phasePosition in time (sample number) that the wave starts at.

◆ triangle()

void smu::Signal::triangle ( std::vector< float > &  buf,
uint64_t  samples,
float  midpoint,
float  peak,
double  period,
double  phase 
)

Generate a triangle waveform.

Parameters
bufBuffer object to store waveform into.
samplesNumber of samples to create for the waveform.
midpointValue at the middle of the wave.
peakMaximum value of the wave.
periodNumber of samples the wave takes for one cycle.
phasePosition in time (sample number) that the wave starts at.

The documentation for this class was generated from the following file: