Frequency-swept cosine generator.
In the following, ‘Hz’ should be interpreted as ‘cycles per time unit’; there is no assumption here that the time unit is one second. The important distinction is that the units of rotation are cycles, not radians.
Parameters : | t : ndarray
f0 : float
t1 : float
f1 : float
method : {‘linear’, ‘quadratic’, ‘logarithmic’, ‘hyperbolic’}, optional
phi : float, optional
vertex_zero : bool, optional
qshape : str (deprecated)
|
---|---|
Returns : | A numpy array containing the signal evaluated at ‘t’ with the requested : time-varying frequency. More precisely, the function returns: :
where `phase` is the integral (from 0 to t) of ``2*pi*f(t)``. : ``f(t)`` is defined below. : |
See also
scipy.signal.waveforms.sweep_poly
Notes
There are four options for the method. The following formulas give the instantaneous frequency (in Hz) of the signal generated by chirp(). For convenience, the shorter names shown below may also be used.
linear, lin, li:
f(t) = f0 + (f1 - f0) * t / t1
quadratic, quad, q:
The graph of the frequency f(t) is a parabola through (0, f0) and (t1, f1). By default, the vertex of the parabola is at (0, f0). If vertex_zero is False, then the vertex is at (t1, f1). The formula is:
if vertex_zero is True:
f(t) = f0 + (f1 - f0) * t**2 / t1**2else:
f(t) = f1 - (f1 - f0) * (t1 - t)**2 / t1**2To use a more general quadratic function, or an arbitrary polynomial, use the function scipy.signal.waveforms.sweep_poly.
logarithmic, log, lo:
f(t) = f0 * (f1/f0)**(t/t1)
f0 and f1 must be nonzero and have the same sign.
This signal is also known as a geometric or exponential chirp.
hyperbolic, hyp:
f(t) = f0*f1*t1 / ((f0 - f1)*t + f1*t1)
f1 must be positive, and f0 must be greater than f1.