diff options
author | Bernhard Spinnler <Bernhard.Spinnler@gmx.net> | 2013-10-15 21:21:33 +0200 |
---|---|---|
committer | Bernhard Spinnler <Bernhard.Spinnler@gmx.net> | 2013-10-15 21:21:33 +0200 |
commit | f6492d927206cf87006e005f0ab19d2db20bc889 (patch) | |
tree | 8aca868ed6abfd27f7d197c250fca3d1732cb1b7 /numpy/core/numeric.py | |
parent | 53cafa064698dd877acb82aa1b6319510fe70ef5 (diff) | |
download | numpy-f6492d927206cf87006e005f0ab19d2db20bc889.tar.gz |
DOC: replaced typeset formulas by pure ASCII equivalents.
Replaced typeset formulas by pure ASCII equivalents. Should now be
easier to read in source files.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index a5f6140f1..fd6295a47 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -820,8 +820,13 @@ def correlate(a, v, mode='valid', old_behavior=False): """ Cross-correlation of two 1-dimensional sequences. - This function computes the cross-correlation of two sequences a and v - as generally defined in signal processing text. + This function computes the correlation as generally defined in signal + processing texts:: + + c_{av}[k] = sum_n a[n+k] * conj(v[n]) + + with a and v sequences being zero-padded where necessary and conj being + the conjugate. Parameters ---------- @@ -847,18 +852,12 @@ def correlate(a, v, mode='valid', old_behavior=False): Notes ----- - The discrete cross-correlation of two sequences a and v is defined as - - .. math:: c_{av}[k] = \\sum_{n = -\\infty}^{\\infty} a[n+k] v^{*}[n] - - where :math:`v^{*}[n]` is the complex conjugate of :math:`v[n]`. - - Note that sometimes correlation may be defined differently. - Another common definition is + The definition of correlation above is not unique and sometimes correlation + may be defined differently. Another common definition is:: - .. math:: c'_{av}[k] = \\sum_{n = -\\infty}^{\\infty} a[n] v^{*}[n+k] + c'_{av}[k] = sum_n a[n] conj(v[n+k]) - which is related to :math:`c_{av}[k]` by :math:`c'_{av}[k] = c_{av}[-k]`. + which is related to ``c_{av}[k]`` by ``c'_{av}[k] = c_{av}[-k]``. Examples -------- @@ -876,7 +875,7 @@ def correlate(a, v, mode='valid', old_behavior=False): Note that you get the time reversed, complex conjugated result when the two input sequences change places, i.e., - :math:`c_{va}[k] = c^{*}_{av}[-k]`: + ``c_{va}[k] = c^{*}_{av}[-k]``: >>> np.correlate([0, 1, 0.5j], [1+1j, 2, 3-1j], 'full') array([ 0.0+0.j , 3.0+1.j , 1.5+1.5j, 1.0+0.j , 0.5+0.5j]) |