Gamma  0.9.5
Generic Synthesis Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Impulse< Tv, Ts > Struct Template Reference

Band-limited impulse train. More...

#include <Oscillator.h>

Inheritance diagram for Impulse< Tv, Ts >:
Buzz< Tv, Ts > AccumPhase< Tv, Ts > Saw< Tv, Ts > Square< Tv, Ts >

List of all members.

Public Member Functions

 Impulse (Tv frq=440, Tv phs=0)
void freq (Tv v)
 Set frequency.
void antialias ()
 Adjust number of harmonics to prevent aliasing.
void harmonics (Tv num)
 Set number of harmonics.
void harmonicsMax ()
 Set number of harmonics to fill Nyquist range.
Tv operator() ()
 Returns next sample of all harmonic impulse.
Tv odd ()
 Returns next sample of odd harmonic impulse.
Tv saw (Tv intg=0.997)
 Returns next sample of saw waveform.
Tv square (Tv intg=0.997)
 Returns next sample of square waveform.
Tv maxHarmonics ()
 Get number of harmonics below Nyquist based on current settings.
Tv nextPhase ()
 Generate next sample. Stored phase is post-incremented.
Tv nextPhase (Tv frqOffset)
 Generate next sample with a frequency offset.
Tv freq ()
 Get frequency.
void period (Tv v)
 Set period length.
Tv period ()
 Get period.
void phase (Tv v)
 Set phase from [0, 1) of one period.
Tv phase ()
 Get normalized phase in [0, 1)
void phaseAdd (Tv v)
 Add value to unit phase.

Detailed Description

template<class Tv = gam::real, class Ts = Synced>
struct gam::Impulse< Tv, Ts >

Band-limited impulse train.

This produces a Fourier representation of an impulse train where the number of harmonics is adjusted automatically to prevent aliasing. Due to numerical issues, this generator should not be used for producing very low frequency modulation signals. For that purpose, it is better to use the LFO class.


Constructor & Destructor Documentation

Impulse ( Tv  frq = 440,
Tv  phs = 0 
)
Parameters:
[in]frqFrequency
[in]phsPhase, in [0, 1)

The documentation for this struct was generated from the following file: