cbfs_red: Generate an artificial event with red noise

Description Usage Arguments Value Examples

View source: R/cbfs_red.R

Description

This function generates a box, cliff-ramp, ramp-cliff or a sine function with red noise (AR(1)) as the background noise. Length of the generated event is 128.

Usage

1
2
cbfs_red(type = c("box", "rc", "cr", "sine"), A = 10, s = 1,
  coeff = 0.5)

Arguments

type

type of the event to be generated. There are four options: “box', “rc',“cr',“sine' representing a box, cliff-ramp, ramp-cliff or a sine function.

A

amplitude of the event; default is 10.

s

standard deviation of the AR(1) model innovations. Default is 1.

coeff

coefficient of the AR(1) process, which is used to control the level of red noise. Default is 0.5.

Value

an artificial event with red noise.

Examples

1
2
3
4
5
# generate a box function with red noise
set.seed(123)
x = cbfs_red(type = 'box', coeff=0.5, s=1, A=10)
# plot it
plot(x,type='l',xlab='t',ylab='x')

Example output

Warning message:
no DISPLAY variable so Tk is not available 

TED documentation built on May 2, 2019, 4:26 a.m.