[Scipy-svn] r6820 - trunk/scipy/signal

scipy-svn@scip... scipy-svn@scip...
Thu Sep 23 04:18:07 CDT 2010


Author: rgommers
Date: 2010-09-23 04:18:06 -0500 (Thu, 23 Sep 2010)
New Revision: 6820

Modified:
   trunk/scipy/signal/waveforms.py
   trunk/scipy/signal/wavelets.py
   trunk/scipy/signal/windows.py
Log:
DOC: make docs of signal.windows/waveforms/wavelets conform to doc standard.

Modified: trunk/scipy/signal/waveforms.py
===================================================================
--- trunk/scipy/signal/waveforms.py	2010-09-23 09:17:48 UTC (rev 6819)
+++ trunk/scipy/signal/waveforms.py	2010-09-23 09:18:06 UTC (rev 6820)
@@ -381,9 +381,10 @@
 
 def _chirp_phase(t, f0, t1, f1, method='linear', vertex_zero=True):
     """
-    Calculate the phase used by chirp_phase to generate its output.  See
-    chirp_phase for a description of the arguments.
+    Calculate the phase used by chirp_phase to generate its output.
 
+    See `chirp_phase` for a description of the arguments.
+
     """
     f0 = float(f0)
     t1 = float(t1)
@@ -477,9 +478,10 @@
 
 def _sweep_poly_phase(t, poly):
     """
-    Calculate the phase used by sweep_poly to generate its output.  See
-    sweep_poly for a description of the arguments.
+    Calculate the phase used by sweep_poly to generate its output.
 
+    See `sweep_poly` for a description of the arguments.
+
     """
     # polyint handles lists, ndarrays and instances of poly1d automatically.
     intpoly = polyint(poly)

Modified: trunk/scipy/signal/wavelets.py
===================================================================
--- trunk/scipy/signal/wavelets.py	2010-09-23 09:17:48 UTC (rev 6819)
+++ trunk/scipy/signal/wavelets.py	2010-09-23 09:18:06 UTC (rev 6820)
@@ -72,34 +72,47 @@
     asgn = [{0:1,1:-1}[k%2] for k in range(N+1)]
     return hk[::-1]*np.array(asgn)
 
-def wavedec(amn,hk):
+def wavedec(amn, hk):
     gk = qmf(hk)
     return NotImplemented
 
-def cascade(hk,J=7):
-    """(x,phi,psi) at dyadic points K/2**J from filter coefficients.
+def cascade(hk, J=7):
+    """Return (x, phi, psi) at dyadic points K/2**J from filter coefficients.
 
-    Inputs:
-      hk  -- coefficients of low-pass filter
-      J   -- values will be computed at grid points $K/2^J$
+    Parameters
+    ----------
+    hk :
+        Coefficients of low-pass filter.
+    J : int. optional
+        Values will be computed at grid points ``K/2**J``.
 
-    Outputs:
-      x   -- the dyadic points $K/2^J$ for $K=0...N*(2^J)-1$
-              where len(hk)=len(gk)=N+1
-      phi -- the scaling function phi(x) at x
-               $\phi(x) = \sum_{k=0}^{N} h_k \phi(2x-k)$
-      psi -- the wavelet function psi(x) at x
-               $\psi(x) = \sum_{k=0}^N g_k \phi(2x-k)$
-             Only returned if gk is not None
+    Returns
+    -------
+    x :
+        The dyadic points K/2**J for ``K=0...N * (2**J)-1`` where
+        ``len(hk) = len(gk) = N+1``
+    phi :
+        The scaling function ``phi(x)`` at `x`:
 
-    Algorithm:
+                     N
+          phi(x) = sum   hk * phi(2x-k)
+                     k=0
+    psi :
+        The wavelet function ``psi(x)`` at `x`:
 
-      Uses the vector cascade algorithm described by Strang and Nguyen in
-      "Wavelets and Filter Banks"
+                     N
+          phi(x) = sum   gk * phi(2x-k)
+                     k=0
 
-      Builds a dictionary of values and slices for quick reuse.
-      Then inserts vectors into final vector at then end
+        `psi` is only returned if `gk` is not None.
 
+    Notes
+    -----
+    The algorithm uses the vector cascade algorithm described by Strang and
+    Nguyen in "Wavelets and Filter Banks".  It builds a dictionary of values
+    and slices for quick reuse.  Then inserts vectors into final vector at the
+    end.
+
     """
 
     N = len(hk)-1

Modified: trunk/scipy/signal/windows.py
===================================================================
--- trunk/scipy/signal/windows.py	2010-09-23 09:17:48 UTC (rev 6819)
+++ trunk/scipy/signal/windows.py	2010-09-23 09:18:06 UTC (rev 6820)
@@ -262,10 +262,9 @@
 def general_gaussian(M, p, sig, sym=True):
     """Return a window with a generalized Gaussian shape.
 
-    exp(-0.5*(x/sig)**(2*p))
+    The Gaussian shape is defined as ``exp(-0.5*(x/sig)**(2*p))``, the
+    half-power point is at ``(2*log(2)))**(1/(2*p)) * sig``.
 
-    half power point is at (2*log(2)))**(1/(2*p))*sig
-
     """
     if M < 1:
         return np.array([])
@@ -286,13 +285,13 @@
 def chebwin(M, at, sym=True):
     """Dolph-Chebyshev window.
 
-    INPUTS:
-
-      M : int
-        Window size
-      at : float
-        Attenuation (in dB)
-      sym : bool
+    Parameters
+    ----------
+    M : int
+        Window size.
+    at : float
+        Attenuation (in dB).
+    sym : bool
         Generates symmetric window if True.
 
     """



More information about the Scipy-svn mailing list