Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qlibs::timeDelay Struct Reference

Represents a time delay value for use in transportDelay constructor. More...

#include <ltisys.hpp>

Public Member Functions

constexpr timeDelay (real_t v)
 Construct a new timeDelay object.
 
constexpr size_t operator() (const real_t dt) const
 Computes the number of discrete steps equivalent to the delay.
 
constexpr size_t operator[] (const real_t dt) const
 Alternate syntax to compute delay in steps using indexing operator.
 

Public Attributes

real_t value
 Delay duration in seconds.
 

Detailed Description

Represents a time delay value for use in transportDelay constructor.

This utility provides a convenient way to convert a continuous-time delay (in seconds) into a discrete-time delay step count based on a given time step `dt`.

Example usage:

transportDelay< 2.5_td(dt) > processDelay;
Delays the input by a specified amount of time. You can use this class to simulate a time delay.
Definition ltisys.hpp:212

Constructor & Destructor Documentation

◆ timeDelay()

qlibs::timeDelay::timeDelay ( real_t v)
inlineexplicitconstexpr

Construct a new timeDelay object.

Parameters
vThe delay value in seconds.

Member Function Documentation

◆ operator()()

size_t qlibs::timeDelay::operator() ( const real_t dt) const
inlineconstexpr

Computes the number of discrete steps equivalent to the delay.

Parameters
dtThe time step used in the simulation.
Returns
The delay expressed in number of steps, rounded to the nearest integer.

◆ operator[]()

size_t qlibs::timeDelay::operator[] ( const real_t dt) const
inlineconstexpr

Alternate syntax to compute delay in steps using indexing operator.

Parameters
dtThe time step used in the simulation.
Returns
The delay expressed in number of steps, rounded to the nearest integer.

Member Data Documentation

◆ value

real_t qlibs::timeDelay::value

Delay duration in seconds.