def chirp(fmin, fmax, sr=<NUM_LIT>, length=None, duration=None, linear=False, phi=None):
if fmin is None or fmax is None:<EOL><INDENT>raise ParameterError('<STR_LIT>')<EOL><DEDENT>period = <NUM_LIT:1.0> / sr<EOL>if length is None:<EOL><INDENT>if duration is None:<EOL><INDENT>raise ParameterError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>duration = period * length<EOL><DEDENT>if phi is None:<EOL><INDENT>phi = -np.pi * <NUM_LIT:0.5><EOL><DEDENT>method = '<STR_LIT>' if linear else '<STR_LIT>'<EOL>return scipy.signal.chirp(<EOL>np.arange(duration, step=period),<EOL>fmin,<EOL>duration,<EOL>fmax,<EOL>method=method,<EOL>phi=phi / np.pi * <NUM_LIT>,  <EOL>)<EOL>
Returns a chirp signal that goes from frequency `fmin` to frequency `fmax`

    Parameters
    ----------
    fmin : float > 0
        initial frequency

    fmax : float > 0
        final frequency

    sr : number > 0
        desired sampling rate of the output signal

    length : int > 0
        desired number of samples in the output signal.
        When both `duration` and `length` are defined, `length` would take priority.

    duration : float > 0
        desired duration in seconds.
        When both `duration` and `length` are defined, `length` would take priority.

    linear : boolean
        - If `True`, use a linear sweep, i.e., frequency changes linearly with time
        - If `False`, use a exponential sweep.
        Default is `False`.

    phi : float or None
        phase offset, in radians.
        If unspecified, defaults to `-np.pi * 0.5`.


    Returns
    -------
    chirp_signal : np.ndarray [shape=(length,), dtype=float64]
        Synthesized chirp signal


    Raises
    ------
    ParameterError
        - If either `fmin` or `fmax` are not provided.
        - If neither `length` nor `duration` are provided.


    See Also
    --------
    scipy.signal.chirp


    Examples
    --------
    >>> # Generate a exponential chirp from A4 to A5
    >>> exponential_chirp = librosa.chirp(440, 880, duration=1)

    >>> # Or generate the same signal using `length`
    >>> exponential_chirp = librosa.chirp(440, 880, sr=22050, length=22050)

    >>> # Or generate a linear chirp instead
    >>> linear_chirp = librosa.chirp(440, 880, duration=1, linear=True)

    Display spectrogram for both exponential and linear chirps

    >>> import matplotlib.pyplot as plt
    >>> plt.figure()
    >>> S_exponential = librosa.feature.melspectrogram(y=exponential_chirp)
    >>> ax = plt.subplot(2,1,1)
    >>> librosa.display.specshow(librosa.power_to_db(S_exponential, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.subplot(2,1,2, sharex=ax)
    >>> S_linear = librosa.feature.melspectrogram(y=linear_chirp)
    >>> librosa.display.specshow(librosa.power_to_db(S_linear, ref=np.max),
    ...                          x_axis='time', y_axis='mel')
    >>> plt.tight_layout()