22 #ifndef EDSP_OSCILLATOR_SAWTOOTH_HPP 23 #define EDSP_OSCILLATOR_SAWTOOTH_HPP 28 namespace edsp {
namespace oscillators {
100 const value_type result = (t >= width_) ? -2 * t / (1 - width_) + 1 : 2 * t / width_ - 1;
108 #endif // EDSP_OSCILLATOR_SAWTOOTH_HPP The class sawtooth_oscillator generates a sawtooth signal.
Definition: sawtooth.hpp:41
constexpr value_type timestamp() const noexcept
Returns the current timestamp of the signal in seconds.
Definition: sinusoidal.hpp:213
constexpr value_type sampling_period() const noexcept
Returns the sampling period in secs.
Definition: sinusoidal.hpp:269
The oscillator class generates a periodic signal.
Definition: sinusoidal.hpp:48
constexpr sawtooth_oscillator(value_type amplitude, value_type samplerate, value_type frequency, value_type width) noexcept
Creates a sawtooth oscillator that generates a waveform with the configuration.
Definition: sawtooth.hpp:82
constexpr value_type frequency() const noexcept
Returns the fundamental frequency in Hz.
Definition: sinusoidal.hpp:239
constexpr value_type samplerate() const noexcept
Returns the sampling frequency in Hz.
Definition: sinusoidal.hpp:228
constexpr value_type amplitude() const noexcept
Returns the amplitude of the periodic signal.
Definition: sinusoidal.hpp:259
T value_type
Definition: sawtooth.hpp:43
constexpr void set_timestamp(value_type timestamp) noexcept
Sets the current timestamp of the periodic signal.
Definition: sinusoidal.hpp:218
constexpr value_type width() const noexcept
Returns the width of the periodic signal.
Definition: sawtooth.hpp:93
constexpr void set_width(value_type width) noexcept
Set the width of the periodic signal.
Definition: sawtooth.hpp:88
Definition: amplifier.hpp:29
constexpr value_type operator()()
Generates one step.
Definition: sawtooth.hpp:98