detrend | R Documentation |

'Detrending' is often used before the signal power calculation.

```
detrend(x, trend = c("constant", "linear"), break_points = NULL)
```

`x` |
numerical or complex, a vector or a matrix |

`trend` |
the trend of the signal; choices are |

`break_points` |
integer vector, or |

The signals with trend removed in matrix form; the number of columns is the number of signals, and number of rows is length of the signals

```
x <- rnorm(100, mean = 1) + c(
seq(0, 5, length.out = 50),
seq(5, 3, length.out = 50))
plot(x)
plot(detrend(x, 'constant'))
plot(detrend(x, 'linear'))
plot(detrend(x, 'linear', 50))
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.