scipy.signal.sweep_poly¶

scipy.signal.
sweep_poly
(t, poly, phi=0)[source]¶ Frequencyswept cosine generator, with a timedependent frequency.
This function generates a sinusoidal function whose instantaneous frequency varies with time. The frequency at time t is given by the polynomial poly.
Parameters: t : ndarray
Times at which to evaluate the waveform.
poly : 1D array_like or instance of numpy.poly1d
The desired frequency expressed as a polynomial. If poly is a list or ndarray of length n, then the elements of poly are the coefficients of the polynomial, and the instantaneous frequency is
f(t) = poly[0]*t**(n1) + poly[1]*t**(n2) + ... + poly[n1]
If poly is an instance of numpy.poly1d, then the instantaneous frequency is
f(t) = poly(t)
phi : float, optional
Phase offset, in degrees, Default: 0.
Returns: sweep_poly : ndarray
A numpy array containing the signal evaluated at t with the requested timevarying frequency. More precisely, the function returns
cos(phase + (pi/180)*phi)
, where phase is the integral (from 0 to t) of2 * pi * f(t)
;f(t)
is defined above.See also
Notes
New in version 0.8.0.
If poly is a list or ndarray of length n, then the elements of poly are the coefficients of the polynomial, and the instantaneous frequency is:
f(t) = poly[0]*t**(n1) + poly[1]*t**(n2) + ... + poly[n1]
If poly is an instance of
numpy.poly1d
, then the instantaneous frequency is:f(t) = poly(t)
Finally, the output
s
is:cos(phase + (pi/180)*phi)
where phase is the integral from 0 to t of
2 * pi * f(t)
,f(t)
as defined above.