Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
scipy
/
signal
/
__pycache__
/
File Content:
waveforms.cpython-35.opt-1.pyc
��W�9 � @ s d d l m Z m Z m Z d d l Z d d l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z d d d d d g Z d d d � Z d d d � Z d d d d d d d d � Z d d d d d � Z d d d d � Z d d d � Z d d � Z d S)� )�division�print_function�absolute_importN)�asarray�zeros�place�nan�mod�pi�extract�log�sqrt�exp�cos�sin�polyval�polyint�sawtooth�square� gausspulse�chirp� sweep_poly� c C se t | � t | � } } t | | | � } t | | | � } | j j d k rb | j j } n d } t | j | � } | d k | d k B} t | | t � t | d t � } d | | | d t k @} t | | � } t | | � } t | | | t | d � d | d | @} t | | � } t | | � } t | | t | d | t d | � | S)a� Return a periodic sawtooth or triangle waveform. The sawtooth waveform has a period ``2*pi``, rises from -1 to 1 on the interval 0 to ``width*2*pi``, then drops from 1 to -1 on the interval ``width*2*pi`` to ``2*pi``. `width` must be in the interval [0, 1]. Note that this is not band-limited. It produces an infinite number of harmonics, which are aliased back and forth across the frequency spectrum. Parameters ---------- t : array_like Time. width : array_like, optional Width of the rising ramp as a proportion of the total cycle. Default is 1, producing a rising ramp, while 0 produces a falling ramp. `width` = 0.5 produces a triangle wave. If an array, causes wave shape to change over time, and must be the same length as t. Returns ------- y : ndarray Output array containing the sawtooth waveform. Examples -------- A 5 Hz waveform sampled at 500 Hz for 1 second: >>> from scipy import signal >>> import matplotlib.pyplot as plt >>> t = np.linspace(0, 1, 500) >>> plt.plot(t, signal.sawtooth(2 * np.pi * 5 * t)) �fFdD�dr r � )r ) r �dtype�charr �shaper r r r r )�t�width�w�ytype�y�mask1�tmod�mask2ZtsubZwsub�mask3� r( � /waveforms.pyr s&