summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-11-14 21:16:18 +0100
committerPaul B Mahol <onemda@gmail.com>2019-11-23 11:54:20 +0100
commit93414ce831864ec3589294bf27481f6bdb8007fc (patch)
treea32e47dfd519c63646503ed59214ab0a5085abeb /doc
parentaaac48fb50271aa753eb31bfca24ecabb8abc92b (diff)
avfilter: add axcorrelate filter
Diffstat (limited to 'doc')
-rw-r--r--doc/filters.texi33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 39570d893b..16bf2df6c2 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -2531,6 +2531,39 @@ ffmpeg -i INPUT -af atrim=end_sample=1000
@end itemize
+@section axcorrelate
+Calculate normalized cross-correlation between two input audio streams.
+
+Resulted samples are always between -1 and 1 inclusive.
+If result is 1 it means two input samples are highly correlated in that selected segment.
+Result 0 means they are not correlated at all.
+If result is -1 it means two input samples are out of phase, which means they cancel each
+other.
+
+The filter accepts the following options:
+
+@table @option
+@item size
+Set size of segment over which cross-correlation is calculated.
+Default is 256. Allowed range is from 2 to 131072.
+
+@item algo
+Set algorithm for cross-correlation. Can be @code{slow} or @code{fast}.
+Default is @code{slow}. Fast algorithm assumes mean values over any given segment
+are always zero and thus need much less calculations to make.
+This is generally not true, but is valid for typical audio streams.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Calculate correlation between channels in stereo audio stream:
+@example
+ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
+@end example
+@end itemize
+
@section bandpass
Apply a two-pole Butterworth band-pass filter with central