From d7b0065ff343cdc7d53644bacac39eef32367c6c Mon Sep 17 00:00:00 2001 From: Joao Felipe Santos Date: Tue, 11 Dec 2018 16:18:35 -0500 Subject: [PATCH] Fixed use of StepRangeLen --- src/Gammatonegram.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gammatonegram.jl b/src/Gammatonegram.jl index c746de2..fdb414c 100644 --- a/src/Gammatonegram.jl +++ b/src/Gammatonegram.jl @@ -9,7 +9,7 @@ mutable struct Gammatonegram{T, F<:Real} <: DSP.Periodograms.TFR{T} time::StepRangeLen{Float64} end -function gammatonegram(x,sr::Integer,twin::Real,thop::Real,N::Integer,fmin,fmax,width) +function gammatonegram(x, sr::Integer, twin::Real, thop::Real, N::Integer, fmin, fmax, width) nfft = floor(Integer, 2^(ceil(log(2*twin*sr)/log(2)))) nhop = round(Integer, thop*sr) nwin = round(Integer, twin*sr) @@ -17,7 +17,7 @@ function gammatonegram(x,sr::Integer,twin::Real,thop::Real,N::Integer,fmin,fmax, # perform FFT and weighting in amplitude domain S = stft(x, nwin, nwin-nhop; nfft=nfft, fs=sr, window=hanning) Y = 1/nfft*W*abs.(S) - Gammatonegram(Y, Vector(vec(F)), ((0:size(Y,2).-1)*(nhop) .+ nwin/2)/sr) + Gammatonegram(Y, Vector(vec(F)), StepRangeLen(nhop, nhop, size(Y, 2))) end function fft2gammatonemx(nfft::Integer, sr::Integer, N::Integer, width, fmin, fmax)