Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tripuls

Sampled aperiodic triangle


Description

Generate a triangular pulse over the interval -w / 2 to w / 2, sampled at times t.

Usage

tripuls(t, w = 1, skew = 0)

Arguments

t

Sample times of triangle wave specified by a vector.

w

Width of the triangular pulse to be generated. Default: 1.

skew

Skew, a value between -1 and 1, indicating the relative placement of the peak within the width. -1 indicates that the peak should be at -w / 2, and 1 indicates that the peak should be at w / 2. Default: 0 (no skew).

Details

y <- tripuls(t) returns a continuous, aperiodic, symmetric, unity-height triangular pulse at the times indicated in array t, centered about t = 0 and with a default width of 1.

y <- tripuls(t, w) generates a triangular pulse of width w.

y <- tripuls(t, w, skew) generates a triangular pulse with skew skew, where -1 ≤ skew ≤ 1. When skew is 0, a symmetric triangular pulse is generated.

Value

Triangular pulse, returned as a vector.

Author(s)

Paul Kienzle, Mike Miller.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

Examples

fs <- 10e3
t <- seq(-0.1, 0.1, 1/fs)
w <- 40e-3
y <- tripuls(t, w)
plot(t, y, type="l", xlab = "", ylab = "",
     main = "Symmetric triangular pulse")

## displace into paste and future
tpast <- -45e-3
spast <- -0.45
ypast <- tripuls(t-tpast, w, spast)
tfutr <- 60e-3
sfutr <- 1
yfutr <- tripuls(t-tfutr, w/2, sfutr)
plot (t, y, type = "l", xlab = "", ylab = "", ylim = c(0, 1))
lines(t, ypast, col = "red")
lines(t, yfutr, col = "blue")

gsignal

Signal Processing

v0.3-1
GPL-3
Authors
Geert van Boxtel [aut, cre] (Maintainer), Tom Short [aut] (Author of 'signal' package), Paul Kienzle [aut] (Majority of the original sources), Ben Abbott [ctb], Juan Aguado [ctb], Muthiah Annamalai [ctb], Leonardo Araujo [ctb], William Asquith [ctb], David Bateman [ctb], David Billinghurst [ctb], Juan Pablo Carbajal [ctb], André Carezia [ctb], Vincent Cautaerts [ctb], Eric Chassande-Mottin [ctb], Luca Citi [ctb], Dave Cogdell [ctb], Carlo de Falco [ctb], Carne Draug [ctb], Pascal Dupuis [ctb], John W. Eaton [ctb], R.G.H Eschauzier [ctb], Andrew Fitting [ctb], Alan J. Greenberger [ctb], Mike Gross [ctb], Daniel Gunyan [ctb], Kai Habel [ctb], Kurt Hornik [ctb], Jake Janovetz [ctb], Alexander Klein [ctb], Peter V. Lanspeary [ctb], Bill Lash [ctb], Friedrich Leissh [ctb], Laurent S. Mazet [ctb], Mike Miller [ctb], Petr Mikulik [ctb], Paolo Neis [ctb], Georgios Ouzounis [ctb], Sylvain Pelissier [ctb], Francesco Potortì [ctb], Charles Praplan [ctb], Lukas F. Reichlin [ctb], Tony Richardson [ctb], Asbjorn Sabo [ctb], Thomas Sailer [ctb], Rolf Schirmacher [ctb], Rolf Schirmacher [ctb], Ivan Selesnick [ctb], Julius O. Smith III [ctb], Peter L. Soendergaard [ctb], Quentin Spencer [ctb], Doug Stewart [ctb], P. Sudeepam [ctb], Stefan van der Walt [ctb], Andreas Weber [ctb], P. Sudeepam [ctb], Andreas Weingessel [ctb]
Initial release
2021-05-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.