You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functioncircconv(x::AbstractVector, y::AbstractVector=x)
iflength(x) !=length(y)
throw(ArgumentError("x and y must be of equal length"))
end
n =length(x)
z =similar(x)
for j ∈1:n
z[j] =circshift(x, j-1)'* y
endreturn z
end
I believe it should be instead
functioncircconv(x::AbstractVector, y::AbstractVector=x)
iflength(x) !=length(y)
throw(ArgumentError("x and y must be of equal length"))
end
n =length(x)
z =similar(x)
xuse =circshift(reverse(x), 1) #CHANGEDfor j ∈1:n
z[j] =circshift(xuse, j-1)'* y #CHANGEDendreturn z
end
I made the same mistake when trying to figure out why a convolution behaved the way it did (instead of doing circular convolution using FFT multiplication)
The text was updated successfully, but these errors were encountered:
circconv looks good to me and circcorr follows the definition. I suppose for circcorr to be linear as opposed to circular it also needs both sequences of length n and m to be zero padded to n+m-1? Lastly, another test could be added interchanging input sequences to ensure that the result is commutative.
Hi folks,
In the implementation of circular shift here:
SignalAnalysis.jl/src/dsp.jl
Line 332 in a9a968e
I believe it should be instead
I made the same mistake when trying to figure out why a convolution behaved the way it did (instead of doing circular convolution using FFT multiplication)
The text was updated successfully, but these errors were encountered: