View source: R/generate_wave.R
generate_wave | R Documentation |
Generate y-values for the wave signal at the given time points with:
amplitude * trig_fn(2 * pi * (1 / fs) * ts + phase)
generate_wave(ts, fs = 44100, amplitude = 1, phase = 0, trig_fn = sin)
generate_sine_wave(ts, fs = 44100, amplitude = 1, phase = 0)
generate_cosine_wave(ts, fs = 44100, amplitude = 1, phase = 0)
ts |
Time points. |
fs |
Sampling frequency (samples per second). Can be a vector with one frequency per time point. |
amplitude |
Scaling constant. Can be a vector with one amplitude per time point. |
phase |
Offset in radians. Can be a vector with one phase offset per time point. |
trig_fn |
Trigonometric function like |
y-values for the wave signal.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.