ExpSpike: Generation of a Spike Signal with Exponential Rise and...

Description Usage Arguments Details Value Examples

Description

This function takes in numeric arguments for a customizable, spike shape, in which rise and decline are modelled by means of an exponential function. A discretized time course is returned.

Usage

1
2
ExpSpike(baseline, peak, period, duty_cycle, peak_pos, trend, duration,
  resolution)

Arguments

baseline

minimal oscillation value

peak

maximal oscillation value

period

oscillation period of the oscillating species (reciprocal of the frequency)

duty_cycle

ratio of the active phase (oscillator above baseline) to the total oscillation period

peak_pos

position of the peak value in the active phase of an oscillation cycle (example: peak_pos = 0.5, peak position is in the middle of the active phase)

trend

percental decrease or increase in the peak value for the successive oscillation cycles; if set to 1, peak value remains unchanged

duration

duration of the generated time course

resolution

temporal resolution of the generated time course

Details

Standards:

Value

Returns a matrix with two columns: a time vector and an oscillator abundance vector.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# test effect of changes in period
m1 = ExpSpike(baseline = 200, peak = 1000, period = 50, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)
m2 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)
m3 = ExpSpike(baseline = 200, peak = 1000, period = 200, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)

par(mfrow = c(3,1))
plot(m1, type = "l", xlab = "time", ylab = "abundance")
plot(m2, type = "l", xlab = "time", ylab = "abundance")
plot(m3, type = "l", xlab = "time", ylab = "abundance")

# test effect of changes in duty_cycle
m1 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.3,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)
m2 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)
m3 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.9,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)

par(mfrow = c(3,1))
plot(m1, type = "l", xlab = "time", ylab = "abundance")
plot(m2, type = "l", xlab = "time", ylab = "abundance")
plot(m3, type = "l", xlab = "time", ylab = "abundance")

# test effect of changes in peak_pos
m1 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)
m2 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.6, trend = 1, duration = 500, resolution = 0.1)
m3 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.9, trend = 1, duration = 500, resolution = 0.1)

par(mfrow = c(3,1))
plot(m1, type = "l", xlab = "time", ylab = "abundance")
plot(m2, type = "l", xlab = "time", ylab = "abundance")
plot(m3, type = "l", xlab = "time", ylab = "abundance")

# test effect of changes in trend
m1 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.3, trend = 0.7, duration = 500, resolution = 0.1)
m2 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1, duration = 500, resolution = 0.1)
m3 = ExpSpike(baseline = 200, peak = 1000, period = 100, duty_cycle = 0.6,
peak_pos = 0.3, trend = 1.3, duration = 500, resolution = 0.1)

par(mfrow = c(3,1))
plot(m1, type = "l", xlab = "time", ylab = "abundance")
plot(m2, type = "l", xlab = "time", ylab = "abundance")
plot(m3, type = "l", xlab = "time", ylab = "abundance")

OscillatorGenerator documentation built on May 2, 2019, 7:59 a.m.