HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
HephAudio::TriangleWaveOscillator Class Referencefinal

generates triangle wave signals. More...

#include <TriangleWaveOscillator.h>

Inheritance diagram for HephAudio::TriangleWaveOscillator:
HephAudio::Oscillator

Public Member Functions

 TriangleWaveOscillator ()
 
 TriangleWaveOscillator (uint32_t sampleRate)
 
 TriangleWaveOscillator (double peakAmplitude, double frequency, uint32_t sampleRate, double phase_rad)
 
double operator[] (size_t n) const override
 
- Public Member Functions inherited from HephAudio::Oscillator
virtual ~Oscillator ()=default
 
Heph::DoubleBuffer GenerateBuffer () const
 
Heph::DoubleBuffer GenerateBuffer (size_t size) const
 
Heph::DoubleBuffer GenerateBuffer (size_t index, size_t size) const
 

Additional Inherited Members

- Public Attributes inherited from HephAudio::Oscillator
double peakAmplitude
 
double frequency
 
double phase_rad
 
uint32_t sampleRate
 
- Protected Member Functions inherited from HephAudio::Oscillator
 Oscillator ()
 
 Oscillator (double peakAmplitude, double frequency, uint32_t sampleRate, double phase_rad)
 

Detailed Description

generates triangle wave signals.

Constructor & Destructor Documentation

◆ TriangleWaveOscillator() [1/3]

HephAudio::TriangleWaveOscillator::TriangleWaveOscillator ( )

creates a new instance and initializes it with default values.

◆ TriangleWaveOscillator() [2/3]

HephAudio::TriangleWaveOscillator::TriangleWaveOscillator ( uint32_t sampleRate)

creates a new instance and initializes it with the provided values.

Parameters
sampleRatesampling rate of the periodic signal.

◆ TriangleWaveOscillator() [3/3]

HephAudio::TriangleWaveOscillator::TriangleWaveOscillator ( double peakAmplitude,
double frequency,
uint32_t sampleRate,
double phase_rad )

creates a new instance and initializes it with the provided values.

Parameters
peakAmplitudemaximum amplitude of the periodic signal.
frequencyfrequency of the periodic signal.
sampleRatesampling rate of the periodic signal.
phase_radphase angle, in radians, of the periodic signal.

Member Function Documentation

◆ operator[]()

double HephAudio::TriangleWaveOscillator::operator[] ( size_t n) const
overridevirtual

calculates the sample at index n.

Implements HephAudio::Oscillator.