
U\c           @   sz   d  d l  m Z d  d l Z d g Z d d d d d d	 d
 d d d d d d d d d d d d d g Z d d d  Z d S(   i(   t   divisionNt   demo_signalt   Blockst   Bumpst	   HeaviSinet   Dopplert   Rampt   HiSinet   LoSinet   LinChirpt   TwoChirpt	   QuadChirpt   MishMasht   WernerSorrowst	   HypChirpst	   LinChirpst   Chirpst   Gabort   sineoneoverxs   Piece-Regulars   Piece-Polynomialt   Riemannc   0      C   s  |  j    d k r t S| dC k	 ru | d k  s> | d d k rM t d   n  t j d | d d | d |  } n  d d g } |  j    }  |  | k r | dC k	 r t d j |     n0 | dC k r |  | k r t d j |     n  |  d	 k rd
 d d d d d d d d d d g } d d d d d d d d d d d g } d } xct | |  D]/ \ } } | | d t j | |  d 7} q]Wn |  d k rjd
 d d d d d d d d d d g } d d d d d d  d d d! d" d  g } d# d# d$ d% d% d& d% d% d# d' d# g }	 d } xt | | |	  D]6 \ } } }
 | | d t j	 | | |
  d 7} q-WnI|  d( k rd t j
 d t j |  t j | d)  t j d* |  } n|  d+ k rt j | d |  t j
 d t j d, | d-  } n|  d. k r| | d/ k } n|  d0 k rKt j
 t j | d1 |  } nh|  d2 k rxt j
 t j | d3 |  } n;|  d4 k rt j
 t j | | d5 |  } n
|  d6 k rt j
 t j | | |  t j
 t j d | | |  } n|  d7 k r+t j
 t j d | | | d  } n|  d8 k rt j
 t j d | | | d  } | t j
 t j | d1 |  7} | t j
 t j | | d9 |  7} n|  d: k rt j
 t j | | d | d  } | t j
 t j | d1 |  } | t j
 t j | | |  } d
 d d d d d d d d d d g } d d d d d d  d d d! d" d  g } d# d# d$ d% d% d& d% d% d# d' d# g } xt | | |  D]6 \ } } }
 | | d t j	 | | |
  d 7} qWn|  d; k rd< | t j d= } d | t j d= } t j d> | d? d  | } t j |  } t j |  } t j
 | d@ |  d
 | k  | dA k  } t j
 | d@ |  d
 | k  | dB k  } t t j d |   } | d } t j |  } t j d | d  t j |  } d t j
 t j d | | d t j  d | | *| |  dC dC dD  | | | | +t j |  } | |  | t t j | dE   d | t t j | dE   d +| | | } n	|  dF k redG | t j d= } dH | t j d= } t j d | d  | } t j | d | d |  } | t j | | d  t j | | | | d  } nN	|  dI k r
t j d | d  | dE t j } t j | d | d=  } dJ | d= } t j d | d  | t j } t j | | d  } | dC dC dD  } t j | | d  | dK } t j | d d | d=  } t | d | d |  } t | dL | dL |  } t j d | d  | } | | t j dM t j | | d=  } | | t j dN t j | | d=  }  | | | |  } t j |  } t j d | dL d  t j | dL  } d t j
 t j d | | dL d t j  d | | dL *| | dL  dC dC dD  | dO | dL | +| | } n|  d k rdP } t j | | d  d | } t j d | d  | } t j | d dK  } t d | d d | d |  } t | d | d |  } d | | t j dQ | dR t j |  } d | | t j dQ | d t j |  } | | } n|  d k r,d= } t j | d | d dS t } dc | | d k <| | d } t j
 dT |  } | dP dU !} n|  dV k rt j |  } t t j | dW   }! t t j | dO   }" t t j | d   }# t t j | d   }$ t t j | d   }% t t j | dK   }& dX t d |  } t j d |! d  |! } t j d |  } t j d |" d  |" } t j d |  t j d  }' t j d |$ d  |$ } dd }( d[ t j | d5 | d5 d |( d  }) |) |"  | |" *d5 |) |" |# !| |" |# +|) |# |$ !| |# |$ +| |$ |% !| |$ |% +| | |% |% |! +| | |% d |! d |% |! d dD  <t j |% d |! d |& |% d |! |&  d\ | |% d |! |& |% d |! d |& +|% d |! d |& }* |' | |* |* |" +| d |# }+ | |+ d dC dD  | d |# | +t j |  | }, |, | } n|  d] k rt j |  } t t j | d   }# t t j | dE   }- t t j | dK   }& t j d |# d  |# } dK | d | d d } dZ d | d | dG } dE | d d^ } dR | d dL | dR }  dK | d }' t j |-  dK }) | | |# *| | d |# d |# d dD  <| | d |# d |# +|  | d |# d |# +|' |# dC dD  | d |# d |# +| d |# }+ | |+ d dC dD  | d |# | +t j |-  dE | |& |& |- +t j |&  d_ | | |- | |& |- +t j |  | }, | |, } n |  d` k rt t j t j |    }. t j d |. d  }/ |/ |/ 9}/ t j |  } da t j d |. d  | |/ d <t j t j j |   } n t db j |  t    | S(e   sL  Simple 1D wavelet test functions.

    This function can generate a number of common 1D test signals used in
    papers by David Donoho and colleagues (e.g. [1]_) as well as the wavelet
    book by Stéphane Mallat [2]_.

    Parameters
    ----------
    name : {'Blocks', 'Bumps', 'HeaviSine', 'Doppler', ...}
        The type of test signal to generate (`name` is case-insensitive). If
        `name` is set to `'list'`, a list of the avialable test functions is
        returned.
    n : int or None
        The length of the test signal. This should be provided for all test
        signals except `'Gabor'` and `'sineoneoverx'` which have a fixed
        length.

    Returns
    -------
    f : np.ndarray
        Array of length ``n`` corresponding to the specified test signal type.

    References
    ----------
    .. [1] D.L. Donoho and I.M. Johnstone.  Ideal spatial adaptation by
           wavelet shrinkage. Biometrika, vol. 81, pp. 425–455, 1994.
    .. [2] S. Mallat. A Wavelet Tour of Signal Processing: The Sparse Way.
           Academic Press. 2009.

    Notes
    -----
    This function is a partial reimplementation of the `MakeSignal` function
    from the [Wavelab](https://statweb.stanford.edu/~wavelab/) toolbox. These
    test signals are provided with permission of Dr. Donoho to encourage
    reproducible research.

    t   listi   i    s   n must be an integer >= 1t   gaborR   s/   Parameter n must be set to None when name is {}s,   Parameter n must be provided when name is {}t   blocksg?gp=
ף?g333333?gq=
ףp?g      ?g?g)\(?g?gRQ?g(\?gQ?i   ii   ii   gg @g333333@gi   t   bumpsg@g@gffffff@g{Gzt?g~jtx?g{Gz?gQ?gMb?t	   heavisineg333333?g
ףp=
?t   dopplerg?g?t   rampgGz?t   hisineg_vO?t   losinegioT?t   linchirpg      ?t   twochirpt	   quadchirpt   mishmashg      ?t   wernersorrowst	   hypchirpsi   i   gjt?gMbP?g?g(\?g      ?Nii
   t	   linchirpsid   i   t   chirpsi   i   i   i2   i^  i   i   y              ?i   t   dtypeg      ?i   s   piece-regulari   ii   i(   ii   s   piece-polynomiali-   i   t   riemanng      ?s*   unknown name: {}.  name must be one of: {}g{Gz?g333333?(   t   lowert   _implemented_signalst   Nonet
   ValueErrort   npt   aranget   formatt   zipt   signt   abst   sint   pit   sqrtt   zerost   intt   roundt   onest   ceilt   cost   expt   slicet   floatt   fixR   t   sumt
   zeros_liket   realt   fftt   ifft(0   t   namet   nt   tt   n_hard_codedt   t0st   hst   ft   t0t   ht   wst   wt   post   hgtt   wtht   pt   alphat   betat   f1t   f2t   mt   envelopet   tmpt   envt   bt   at   A1t   ixt   gt   i1t   i2t   jt   f3t   f4t   n_12t   n_7t   n_5t   n_3t   n_2t   n_20t   f5t   fmat   f6t   kt   difft   biast   n_10t   sqnt   idx(    (    s9   lib/python2.7/site-packages/pywt/data/_wavelab_signals.pyR      sh   &(''*'''".C:!!%A)&")&""'''".++
#6"C;%! **+>*#..! ,'Q"
""&
"(   t
   __future__R    t   numpyR+   t   __all__R(   R)   R   (    (    (    s9   lib/python2.7/site-packages/pywt/data/_wavelab_signals.pyt   <module>   s.   		