Skip to content

Commit

Permalink
Adding fixes suggested by simonster
Browse files Browse the repository at this point in the history
  • Loading branch information
jfsantos committed Apr 23, 2015
1 parent e5a0d01 commit 3349186
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions src/periodograms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,6 @@ function fft2oneortwosided!{T}(out::Array{Complex{T}}, s_fft::Vector{Complex{T}}
out
end

# Calculate sum of abs2
# Remove this once we drop support for Julia 0.2
if isdefined(Base, :sumabs2)
sumabs2(x) = Base.sumabs2(x)
else
function sumabs2(s)
x = zero(eltype(s))
for i = 1:length(s)
@inbounds x += abs2(s[i])
end
x
end
end

## PERIODOGRAMS
abstract TFR{T}
immutable Periodogram{T,F<:Union(Frequencies,Range)} <: TFR{T}
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function istft{T<:Union(Float32, Float64)}(S::AbstractMatrix{Complex{T}}, wlen::
nframes = size(S,2)-1
outlen = nfft + nframes*winc
out = zeros(T, outlen)
tmp1 = similar(S[:,1])
tmp1 = Array(eltype(S), size(S, 1))
tmp2 = zeros(T, nfft)
p = backward_plan(tmp1, tmp2)
wsum = zeros(outlen)
Expand Down

0 comments on commit 3349186

Please sign in to comment.