Skip to content

Commit

Permalink
Fixed use of StepRangeLen
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Felipe Santos committed Dec 11, 2018
1 parent dab91f9 commit 766b2b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Gammatonegram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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)
(W,F) = fft2gammatonemx(nfft, sr, N, width, 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(thop, thop, size(Y, 2)))
end

function fft2gammatonemx(nfft::Integer, sr::Integer, N::Integer, width, fmin, fmax)
Expand Down

0 comments on commit 766b2b6

Please sign in to comment.