Filter for DC (low frequencies) suppression.

Namespace: dsp::filter

Prototype

sptr<FilterGen<T>> filter_dc(float fc)

Parameters

fcNormalized cut-off frequency (0 - 0.5)

Description

Implement the following filter: \[ y_k = \frac{1+\alpha}{2}\cdot \left(x_k - x_{k-1}\right) + \alpha y_{k-1} \]

Example

  soit fc = 0.01f;
  soit n = 500;

  soit filtre = filtre_dc<float>(fc);

  soit x = 0.2 * sigsin(0.1, n) + 1.0f,
       y = filtre->step(x);

  Figures f;
  f.subplot(221).plot(x, "b-", "Signal d'entrée");
  f.subplot(222).plot_psd(x, 1, "b-", "Spectre signal d'entrée");
  f.subplot(223).plot(y, "b-", "Signal de sortie");
  f.subplot(224).plot_psd(y.tail(y.rows()-200), 1, "b-", "Spectre signal de sortie");


bibliography

Stein, Digital Signal Processing, 2000

See also

design_dc_blocker()