Skip to content

Commit 0aaae42

Browse files
committedAug 2, 2013
Merge pull request #3913 from JuliaLang/sf/dspdocs
Add documentation for conv2()/plan_brfft()
2 parents dee81ae + d757046 commit 0aaae42

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed
 

‎base/dsp.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ conv{T<:Integer}(u::Vector{T}, v::Vector{T}) = conv(float(u), float(v))
9898
conv{T<:Integer, S<:LinAlg.BlasFloat}(u::Vector{T}, v::Vector{S}) = conv(float(u), v)
9999
conv{T<:Integer, S<:LinAlg.BlasFloat}(u::Vector{S}, v::Vector{T}) = conv(u, float(v))
100100

101-
function conv2{T}(y::Vector{T}, x::Vector{T}, A::Matrix{T})
102-
m = length(y)+size(A,1)-1
103-
n = length(x)+size(A,2)-1
101+
function conv2{T}(u::Vector{T}, v::Vector{T}, A::Matrix{T})
102+
m = length(u)+size(A,1)-1
103+
n = length(v)+size(A,2)-1
104104
B = zeros(T, m, n)
105105
B[1:size(A,1),1:size(A,2)] = A
106-
y = fft([y;zeros(T,m-length(y))])
107-
x = fft([x;zeros(T,n-length(x))])
108-
C = ifft(fft(B) .* (y * x.'))
106+
u = fft([u;zeros(T,m-length(u))])
107+
v = fft([v;zeros(T,n-length(v))])
108+
C = ifft(fft(B) .* (u * v.'))
109109
if T <: Real
110110
return real(C)
111111
end

‎doc/stdlib/base.rst

+16
Original file line numberDiff line numberDiff line change
@@ -2877,6 +2877,13 @@ FFT functions in Julia are largely implemented by calling functions from `FFTW <
28772877
arguments, and the size of the transformed result, are the same as
28782878
for :func:`rfft`.
28792879

2880+
.. function:: plan_brfft(A, d [, dims [, flags [, timelimit]]])
2881+
2882+
Pre-plan an optimized real-input unnormalized transform, similar to
2883+
:func:`plan_rfft` except for :func:`brfft` instead of :func:`rfft`.
2884+
The first two arguments and the size of the transformed result, are
2885+
the same as for :func:`brfft`.
2886+
28802887
.. function:: plan_irfft(A, d [, dims [, flags [, timelimit]]])
28812888

28822889
Pre-plan an optimized inverse real-input FFT, similar to :func:`plan_rfft`
@@ -2958,6 +2965,15 @@ FFT functions in Julia are largely implemented by calling functions from `FFTW <
29582965

29592966
Convolution of two vectors. Uses FFT algorithm.
29602967

2968+
.. function:: conv2(u,v,A)
2969+
2970+
2-D convolution of the matrix ``A`` with the 2-D separable kernel generated by
2971+
the vectors ``u`` and ``v``. Uses 2-D FFT algorithm
2972+
2973+
.. function:: conv2(B,A)
2974+
2975+
2-D convolution of the matrix ``B`` with the matrix ``A``. Uses 2-D FFT algorithm
2976+
29612977
.. function:: xcorr(u,v)
29622978

29632979
Compute the cross-correlation of two vectors.

0 commit comments

Comments
 (0)
Please sign in to comment.