T <- 10 * (1 / 50)
fs <- 1000
t <- seq(0, T-1/fs, 1/fs)
y <- sawtooth(2 * pi * 50 *t)
plot(t, y, type="l", xlab = "", ylab = "", main = "50 Hz sawtooth wave")
T <- 10 * (1 / 50)
fs <- 1000
t <- seq(0, T-1/fs, 1/fs)
y <- sawtooth(2 * pi * 50 * t, 1/2)
plot(t, y, type="l", xlab = "", ylab = "", main = "50 Hz triangle wave")
Run the code above in your browser using DataLab