PSD (correlogram).

Namespace: dsp::fourier

Prototype

tuple<Vecf, Vecf> psd(const Vector<T> &x)

Parameters

xSignal to be analyzed.

Returns

A tuple with two elements: frequences vectors (normalized, between -0.5 and 0.5), and the spectrum.

Description

Computes the correlogram using a Hann window:

\[ S(k) = \left|TFD(x \cdot w)(k)\right| \]

The resulting spectrum is 0 Hz centered (frequency vector: linspace(-0.5,0.5-1.0/N,N)).

Example

  soit x = sigtri(20, 1000);
  soit [fr, S] = psd(x);

  Figures f;
  f.subplot().plot(x);
  f.subplot().plot(fr, S);
  f.gcf().titres("Spectre", "Frequence (Hz)", "Magnitude (dB)");

PSD signal triangulaire

See also

psd_welch(), psd_subspace()