Efficient computing of a complex exponential.

Namespace: dsp

Prototype

static Veccf sigexp(float f, int n)

Parameters

fNormalized frequency of the exponential (between -0.5 et 0.5)
nNumber of points to generate.

Returns

Complex vector defined by: \[ y_k = e^{2\pi\mathbf{i} k f},\quad k = 0\dots n-1 \]

Description

This function generates a complex exponential 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


  // Fréquence = 1 centième de la fréquence d'échantillonage,
  // Nombre d'échantillons à générer : 200.
  soit x = sigexp(0.01, 200);
  Figure f;
  f.plot(x);

See also

sigcos(), sigsin(), sigcar(), sigtri()