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

chirp

A chirp signal


Description

Generate a chirp signal. A chirp signal is a frequency swept cosine wave.

Usage

chirp(t, f0 = 0, t1 = 1, f1 = 100, 
      form = c("linear", "quadratic", "logarithmic"), phase = 0)

Arguments

t

array of times at which to evaluate the chirp signal.

f0

frequency at time t=0.

t1

time, s.

f1

frequency at time t=t1.

form

shape of frequency sweep, one of "linear", "quadratic", or "logarithmic".

phase

phase shift at t=0.

Details

'linear' is:

f(t) = (f1-f0)*(t/t1) + f0

'quadratic' is:

f(t) = (f1-f0)*(t/t1)^2 + f0

'logarithmic' is:

f(t) = (f1-f0)^{t/t1} + f0

Value

Chirp signal, an array the same length as t.

Author(s)

Original Octave version by Paul Kienzle. Conversion to R by Tom Short.

References

Octave Forge http://octave.sf.net

See Also

Examples

ch <- chirp(seq(0, 0.6, len=5000))
plot(ch, type = "l")

# Shows a quadratic chirp of 400 Hz at t=0 and 100 Hz at t=10
# Time goes from -2 to 15 seconds.
specgram(chirp(seq(-2, 15, by=0.001), 400, 10, 100, "quadratic"))

# Shows a logarithmic chirp of 200 Hz at t=0 and 500 Hz at t=2
# Time goes from 0 to 5 seconds at 8000 Hz.
specgram(chirp(seq(0, 5, by=1/8000), 200, 2, 500, "logarithmic"))

signal

Signal Processing

v0.7-6
GPL-2
Authors
Uwe Ligges [aut, cre] (new maintainer), Tom Short [aut] (port to R), Paul Kienzle [aut] (majority of the original sources), Sarah Schnackenberg [ctb] (various test cases and bug fixes), David Billinghurst [ctb], Hans-Werner Borchers [ctb], Andre Carezia [ctb], Pascal Dupuis [ctb], John W. Eaton [ctb], E. Farhi [ctb], Kai Habel [ctb], Kurt Hornik [ctb], Sebastian Krey [ctb], Bill Lash [ctb], Friedrich Leisch [ctb], Olaf Mersmann [ctb], Paulo Neis [ctb], Jaakko Ruohio [ctb], Julius O. Smith III [ctb], Doug Stewart [ctb], Andreas Weingessel [ctb]
Initial release
2015-07-29

We don't support your browser anymore

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