Waveforms | R Documentation |
Create a Wave
object of special waveform such as
silcence, power law (white, red, pink, ...) noise, sawtooth, sine, square, and pulse.
noise(kind = c("white", "pink", "power", "red"), duration = samp.rate,
samp.rate = 44100, bit = 1, stereo = FALSE,
xunit = c("samples", "time"), alpha = 1, ...)
pulse(freq, duration = samp.rate, from = 0, samp.rate = 44100,
bit = 1, stereo = FALSE, xunit = c("samples", "time"),
width = 0.1, plateau = 0.2, interval = 0.5, ...)
sawtooth(freq, duration = samp.rate, from = 0, samp.rate = 44100,
bit = 1, stereo = FALSE, xunit = c("samples", "time"),
reverse = FALSE, ...)
silence(duration = samp.rate, from = 0, samp.rate = 44100,
bit = 1, stereo = FALSE, xunit = c("samples", "time"), ...)
sine(freq, duration = samp.rate, from = 0, samp.rate = 44100,
bit = 1, stereo = FALSE, xunit = c("samples", "time"), ...)
square(freq, duration = samp.rate, from = 0, samp.rate = 44100,
bit = 1, stereo = FALSE, xunit = c("samples", "time"),
up = 0.5, ...)
kind |
The kind of noise, “white”, “pink”, “power”, or “red” (these are not dB adjusted (!) but all except for “white” are linear decreasing on a log-log scale). Algorithm for generating power law noise is taken from Timmer and König (1995). |
freq |
The frequency (in Hertz) to be generated. |
duration |
Duration of the |
from |
Starting value of the |
samp.rate |
Sampling rate of the |
bit |
Resolution of the The |
stereo |
Logical, if |
xunit |
Character indicating which units are used
(both in arguments |
alpha |
The power for the power law noise (defaults are 1 for pink and 1.5 for red noise)
|
reverse |
Logical, if |
up |
A number between 0 and 1 giving the percentage of the waveform at max value (= 1 - percentage of min value). |
width |
Relative pulses width: the proportion of time the amplitude is non-zero. |
plateau |
Relative plateau width: the proportion of the pulse width where amplitude is ±1. |
interval |
Relative interval between the up-going and down-going pulses with respect to the center of the wave period (0: immediatly after up-going, 1: center of the wave period). |
... |
Further arguments to be passed to |
A Wave
object.
Uwe Ligges ligges@statistik.tu-dortmund.de, partly based on code from Matthias Heymann's former package ‘sound’, Anita Thieler, Guillaume Guénard
J. Timmer and M. König (1995): On generating power law noise. Astron. Astrophys. 300, 707-710.
Wave-class, Wave
, normalize
, noSilence
Wobj <- sine(440, duration = 1000)
Wobj2 <- noise(duration = 1000)
Wobj3 <- pulse(220, duration = 1000)
plot(Wobj)
plot(Wobj2)
plot(Wobj3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.