sigsin
Efficient computing of a sinusoid.
Namespace: dsp
Prototype
static Vecf sigsin(float f, int n)
Parameters
f | Normalized frequency of the sinusoid (between -0.5 et 0.5) |
n | Number of points to generate. |
Returns
Real vector defined by:
Description
This function generates a real sinusoidal signal, based on an harmonic oscillator (which is far more efficient than by using the trigonometric functions of the standard library). Note however that if \(n\) is a big number, there can be some divergence, both in gain and in phase.
Example
