Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change documentation for xcorr and conv to be true to the actual implementation. #521

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/dspbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ const RealOrComplexFloat = Union{AbstractFloat, Complex{T} where T<:AbstractFloa
"""
conv(u,v)

Convolution of two arrays. Uses either FFT convolution or overlap-save,
depending on the size of the input. `u` and `v` can be N-dimensional arrays,
Convolution of two arrays by using FFT-convolution.
`u` and `v` can be N-dimensional arrays,
with arbitrary indexing offsets, but their axes must be a `UnitRange`.
"""
function conv(u::AbstractArray{T, N},
Expand Down Expand Up @@ -767,9 +767,7 @@ end
"""
xcorr(u,v; padmode = :none)

Compute the cross-correlation of two vectors, by calculating the similarity
between `u` and `v` with various offsets of `v`. Delaying `u` relative to `v`
will shift the result to the right.
Compute the cross-correlation of two vectors, `u` and `v`, through FFT-correlation.

The size of the output depends on the padmode keyword argument: with padmode =
:none the length of the result will be length(u) + length(v) - 1, as with conv.
Expand All @@ -793,4 +791,4 @@ function xcorr(
else
throw(ArgumentError("padmode keyword argument must be either :none or :longest"))
end
end
end