eDSP
0.0.1
A cross-platform DSP library written in C++.
|
The oscillator class generates a periodic signal. More...
#include <sinusoidal.hpp>
Public Types | |
using | value_type = T |
Public Member Functions | |
constexpr | oscillator (value_type amplitude, value_type samplerate, value_type frequency, value_type phase) noexcept |
Creates an oscillator that generates a waveform with the configuration. More... | |
constexpr value_type | frequency () const noexcept |
Returns the fundamental frequency in Hz. More... | |
constexpr void | set_frequency (value_type frequency) noexcept |
Sets the fundamental frequency of the periodic signal. More... | |
constexpr value_type | phase () const noexcept |
Returns the phase shift in radians. More... | |
constexpr void | set_phase (value_type phase) noexcept |
Sets the phase shift of the periodic signal. More... | |
constexpr value_type | timestamp () const noexcept |
Returns the current timestamp of the signal in seconds. More... | |
constexpr void | set_timestamp (value_type timestamp) noexcept |
Sets the current timestamp of the periodic signal. More... | |
constexpr value_type | samplerate () const noexcept |
Returns the sampling frequency in Hz. More... | |
constexpr void | set_samplerate (value_type samplerate) noexcept |
Sets the sampling frequency. More... | |
constexpr value_type | sampling_period () const noexcept |
Returns the sampling period in secs. More... | |
constexpr value_type | amplitude () const noexcept |
Returns the amplitude of the periodic signal. More... | |
constexpr void | set_amplitude (value_type amplitude) noexcept |
Set the amplitude of the periodic signal. More... | |
constexpr void | reset () noexcept |
Reset the oscillator to the original state. More... | |
The oscillator class generates a periodic signal.
An oscillator is a repeating waveform with a fundamental frequency and peak amplitude. Aside from the frequency or pitch of the oscillator and its amplitude, one of the most important features is the shape of its waveform.
T |
using edsp::oscillators::oscillator< T >::value_type = T |
|
noexcept |
Creates an oscillator that generates a waveform with the configuration.
amplitude | Amplitude of the waveform. |
samplerate | The sampling frequency in Hz. |
frequency | The fundamental frequency of the signal (also known as pitch). |
phase | Phase shift in radians. |
|
noexcept |
Returns the amplitude of the periodic signal.
|
noexcept |
Returns the fundamental frequency in Hz.
|
noexcept |
Returns the phase shift in radians.
|
noexcept |
Reset the oscillator to the original state.
|
noexcept |
Returns the sampling frequency in Hz.
|
noexcept |
|
noexcept |
Set the amplitude of the periodic signal.
amplitude | Amplitude of the signal |
|
noexcept |
Sets the fundamental frequency of the periodic signal.
frequency | Fundamental frequency in Hz. |
|
noexcept |
Sets the phase shift of the periodic signal.
phase | Phase shift in radians. |
|
noexcept |
Sets the sampling frequency.
samplerate | Sampling frequency in Hz. |
|
noexcept |
Sets the current timestamp of the periodic signal.
timestamp | Timestamp of the signal in secs. |
|
noexcept |
Returns the current timestamp of the signal in seconds.