Skip to content

Commit 3349186

Browse files
committed
Adding fixes suggested by simonster
1 parent e5a0d01 commit 3349186

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

src/periodograms.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,6 @@ function fft2oneortwosided!{T}(out::Array{Complex{T}}, s_fft::Vector{Complex{T}}
162162
out
163163
end
164164

165-
# Calculate sum of abs2
166-
# Remove this once we drop support for Julia 0.2
167-
if isdefined(Base, :sumabs2)
168-
sumabs2(x) = Base.sumabs2(x)
169-
else
170-
function sumabs2(s)
171-
x = zero(eltype(s))
172-
for i = 1:length(s)
173-
@inbounds x += abs2(s[i])
174-
end
175-
x
176-
end
177-
end
178-
179165
## PERIODOGRAMS
180166
abstract TFR{T}
181167
immutable Periodogram{T,F<:Union(Frequencies,Range)} <: TFR{T}

src/util.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function istft{T<:Union(Float32, Float64)}(S::AbstractMatrix{Complex{T}}, wlen::
104104
nframes = size(S,2)-1
105105
outlen = nfft + nframes*winc
106106
out = zeros(T, outlen)
107-
tmp1 = similar(S[:,1])
107+
tmp1 = Array(eltype(S), size(S, 1))
108108
tmp2 = zeros(T, nfft)
109109
p = backward_plan(tmp1, tmp2)
110110
wsum = zeros(outlen)

0 commit comments

Comments
 (0)