Skip to content

Commit

Permalink
DOC: improve docstring of correlate and correlate2d (scipy#11487)
Browse files Browse the repository at this point in the history
* updated docstring
  • Loading branch information
AtsushiSakai authored and gwgundersen committed Jul 18, 2020
1 parent e7b8bfe commit 5ef1bc3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scipy/signal/signaltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def correlate(in1, in2, mode='full', method='auto'):
`fftconvolve`. In certain cases (i.e., arrays of objects or when
rounding integers can lose precision), ``method='direct'`` is always used.
When using "same" mode with even-length inputs, the outputs of `correlate`
and `correlate2d` differ: There is a 1-index offset between them.
Examples
--------
Implement a matched filter using cross-correlation, to recover a signal
Expand Down Expand Up @@ -1613,6 +1616,11 @@ def correlate2d(in1, in2, mode='full', boundary='fill', fillvalue=0):
A 2-dimensional array containing a subset of the discrete linear
cross-correlation of `in1` with `in2`.
Notes
-----
When using "same" mode with even-length inputs, the outputs of `correlate`
and `correlate2d` differ: There is a 1-index offset between them.
Examples
--------
Use 2D cross-correlation to find the location of a template in a noisy
Expand Down

0 comments on commit 5ef1bc3

Please sign in to comment.