Skip to content

Detrend

Sambit Paul edited this page Dec 2, 2023 · 4 revisions

Detrend aims to remove the trend in the input signal. It operates in 3 modes:

  1. Constant: Removes only the mean of the signal
  2. Linear: Finds the linear trend in the signal and removes it.
  3. Polynomial: Finds the polynomial curve (based on provided order) on the signal and removes it.

The signal used for "constant" and "linear": [1, 2, 3, 4, 5, 6, 7, 8, 9] + Gaussian Noise

For "poly", the signal is raised to the provided power: [1, 2, 3, 4, 5, 6, 7, 8, 9]power + Gaussian Noise

detrend

Constant

The parameters for this filter are as follows:

  • Mode of Operation ⇨ "constant"
Code
Detrend d1 = new Detrend(signal, "constant");
double[] out = d1.detrendSignal();

Linear

The parameters for this filter are as follows:

  • Mode of Operation ⇨ "constant"
Code
Detrend d1 = new Detrend(signal, "linear");
double[] out = d1.detrendSignal();

Polynomial

The parameters for this filter are as follows:

  • Mode of Operation ⇨ "poly"
  • Power ⇨ 2
Code
int power = 2;
Detrend d1 = new Detrend(signal, power);
double[] out = d1.detrendSignal();

The parameters for this filter are as follows:

  • Mode of Operation ⇨ "poly"
  • Power ⇨ 5
Code
int power = 5;
Detrend d1 = new Detrend(signal, power);
double[] out = d1.detrendSignal();
Clone this wiki locally