This makes Amplitude Modulated Pulse Train, which can be regarded as the discretized wave of the signal. Pulse Train can be defined by frequency and duty cycle, which can be temporarily changed, referring to PWM.

Dependents:   Interference_Simple

Embed: (wiki syntax)

« Back to documentation index

PulseTrain Class Reference

PulseTrain Class Reference

Pulse Train Model More...

#include <PulseTrain.h>

Public Member Functions

 PulseTrain (uint32_t const arg_freq_init=4000, float const arg_duty_init=0.5, uint32_t const arg_freq_max=8000)
 Constractor.
void incrementClock ()
 Increment the clock to let go ahead the wave state.
void attachCallback_asClock (Callback< void(bool)> arg_callback)
 Executes a callback fanction called as clock is incremented.
void attachCallback_asPulseEdge (Callback< void(bool)> arg_callback)

Detailed Description

Pulse Train Model

Pulse Train Model which clock is defined in scale of [us]; You can define the carrier pulse train's freq and duty cycle like PWM. Kinds of Frequency is dealed as unsigned 32bit int For the other int vars, allocated is 32bit.

Definition at line 20 of file PulseTrain.h.


Constructor & Destructor Documentation

PulseTrain ( uint32_t const   arg_freq_init = 4000,
float const   arg_duty_init = 0.5,
uint32_t const   arg_freq_max = 8000 
)

Constractor.

Parameters:
arg_freq_initInitial carrier pulse frequency
arg_duty_initInitial carrier pulse duty cycle
arg_freq_maxInitialize FREQ_MAX

Definition at line 3 of file PulseTrain.cpp.


Member Function Documentation

void attachCallback_asClock ( Callback< void(bool)>  arg_callback )

Executes a callback fanction called as clock is incremented.

If callback as rising/falling is also called, this "asClock" is called at the last.

Parameters:
arg_callbackCalled back as clock incremented
  • <pulsestate> indicate whther pulse (not clock pulse but one of pulse train) has risen/fallen

Definition at line 19 of file PulseTrain.cpp.

void attachCallback_asPulseEdge ( Callback< void(bool)>  arg_callback )
Parameters:
arg_callbackCalled back as a pulse rising/falling
  • <pulsestate> indicate whther pulse has risen/fallen

Definition at line 24 of file PulseTrain.cpp.

void incrementClock (  )

Increment the clock to let go ahead the wave state.

If callback as rising/falling is also called, this "asClock" is called earlier

Definition at line 67 of file PulseTrain.cpp.