#NEWLINE# def chirp( t , f0 , t1 , f1 , method = 'linear' , phi = 0 , vertex_zero = True ) : #NEWLINE# #INDENT# "Frequency-swept cosine generator.\n\n    In the following, 'Hz' should be interpreted as 'cycles per unit';\n    there is no requirement here that the unit is one second.  The\n    important distinction is that the units of rotation are cycles, not\n    radians. Likewise, `t` could be a measurement of space instead of time.\n\n    Parameters\n    ----------\n    t : array_like\n        Times at which to evaluate the waveform.\n    f0 : float\n        Frequency (e.g. Hz) at time t=0.\n    t1 : float\n        Time at which `f1` is specified.\n    f1 : float\n        Frequency (e.g. Hz) of the waveform at time `t1`.\n    method : {'linear', 'quadratic', 'logarithmic', 'hyperbolic'}, optional\n        Kind of frequency sweep.  If not given, `linear` is assumed.  See\n        Notes below for more details.\n    phi : float, optional\n        Phase offset, in degrees. Default is 0.\n    vertex_zero : bool, optional\n        This parameter is only used when `method` is 'quadratic'.\n        It determines whether the vertex of the parabola that is the graph\n        of the frequency is at t=0 or t=t1.\n\n    Returns\n    -------\n    y : ndarray\n        A numpy array containing the signal evaluated at `t` with the\n        requested time-varying frequency.  More precisely, the function\n        returns ``cos(phase + (pi/180)*phi)`` where `phase` is the integral\n        (from 0 to `t`) of ``2*pi*f(t)``. ``f(t)`` is defined below.\n\n    See Also\n    --------\n    sweep_poly\n\n    Notes\n    -----\n    There are four options for the `method`.  The following formulas give\n    the instantaneous frequency (in Hz) of the signal generated by\n    `chirp()`.  For convenience, the shorter names shown below may also be\n    used.\n\n    linear, lin, li:\n\n        ``f(t) = f0 + (f1 - f0) * t / t1``\n\n    quadratic, quad, q:\n\n        The graph of the frequency f(t) is a parabola through (0, f0) and\n        (t1, f1).  By default, the vertex of the parabola is at (0, f0).\n        If `vertex_zero` is False, then the vertex is at (t1, f1).  The\n        formula is:\n\n        if vertex_zero is True:\n\n            ``f(t) = f0 + (f1 - f0) * t**2 / t1**2``\n\n        else:\n\n            ``f(t) = f1 - (f1 - f0) * (t1 - t)**2 / t1**2``\n\n        To use a more general quadratic function, or an arbitrary\n        polynomial, use the function `scipy.signal.waveforms.sweep_poly`.\n\n    logarithmic, log, lo:\n\n        ``f(t) = f0 * (f1/f0)**(t/t1)``\n\n        f0 and f1 must be nonzero and have the same sign.\n\n        This signal is also known as a geometric or exponential chirp.\n\n    hyperbolic, hyp:\n\n        ``f(t) = f0*f1*t1 / ((f0 - f1)*t + f1*t1)``\n\n        f0 and f1 must be nonzero.\n\n    " #NEWLINE# phase = _chirp_phase ( t , f0 , t1 , phi , method , vertex_zero ) #NEWLINE# phi *= ( pi / 180 ) #NEWLINE# return cos ( ( phase + phi ) )