Interval of logarithmicly equidistant points (geometric serie).

Namespace: dsp

Prototype

static Vecf logspace(float a, float b, int n)

Parameters

aLogarithm (base 10) of the initial point
bLogarithm (base 10) of the final point
nNumber of points

Returns

Geometric serie

Description

Computes \(n\) points logarithmicly equidistants between \(a\) and \(b\), that is, the following geometric serie:

\[ x_k = 10^{a + k \frac{b-a}{n-1}},\quad k = 0,\dots,n-1 \]

Example

  // 5 points entre 1=10^0 et et 100=10^2
  soit x = logspace(0, 2, 5);

  Figure f;
  f.plot(x, "r-o");

  // Axe vertical : affichage logarithmique
  f.axes().def_echelle("lin", "log");

See also

linspace()