Band-limited impulse train. More...
#include <Oscillator.h>
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. |
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.
Impulse | ( | Tv | frq = 440 , |
Tv | phs = 0 |
||
) |
[in] | frq | Frequency |
[in] | phs | Phase, in [0, 1) |