AcousticFeatures.jl

MFCC/Fbank/LPC/LPCC
Author sonosole
Popularity
0 Stars
Updated Last
2 Years Ago
Started In
May 2022

AcousticFeatures

CI codecov

This package implements a set of methods to compute generic acoustic features in AxisArrays for 1-D time series acoustic data.

The acoustic features are:

Installation

using Pkg; pkg"add https://github.com/ymtoo/AcousticFeatures.jl.git"

Usage

using AcousticFeatures, DSP, SignalAnalysis, Plots

function compare(sc1, sc2)
    plot(sc1.axes[1] ./ fs, vec(sc1.data),
         xlabel = "Time (sec)",
         ylabel = "Permutation Entropy",
         label  = "without chirp",
         color  = :blue,
         dpi    = 150,
         thickness_scaling = 1.0,
         legend=:bottomleft
    )
    plot!(sc2.axes[1] ./ fs, vec(sc2.data),
          xlabel = "Time (sec)",
          ylabel = "Permutation Entropy",
          label  = "with chirp",
          color  = :red,
          dpi    = 150,
          thickness_scaling = 1.0,
          legend=:bottomleft
    )
end

N  = 2400
fs = 2400
v  = randn(Float64, 3*N)
s  = real(chirp(500, 1000, 1.0, fs))
x  = copy(v); 
x[N:2*N-1] += s

specgram(signal(x,fs); fs=fs,nfft=128)

window

winlen = 2400
noverlap = 1200
pe = PermutationEntropy(5, 1, true, true)
sc1 = Score(
    pe,
    v;
    winlen = winlen,
    noverlap = noverlap
)
sc2 = Score(
    pe,
    x;
    winlen = winlen,
    noverlap = noverlap
)
compare(sc1, sc2)

window

N  = 2400
fs = 2400
v  = randn(Float64, 3*N)
Ns = fs ÷ 100
bpf = fir(13, 500, 1000; fs=fs) 
s  = 10 .* filtfilt(bpf, randn(Float64, Ns)) #real(chirp(500, 1100, 0.1, fs))
x  = copy(v); 
Ngap = fs ÷ 10
x[N:N+Ns-1] += s
x[N+5Ngap:N+5Ngap+Ns-1] += s
x[N+9Ngap:N+9Ngap+Ns-1] += s

specgram(signal(x,fs); nfft=128, fs=fs)

window

winlen = 2400
noverlap = 1200
pe = PermutationEntropy(5, 1, true, true)
sc1 = Score(
    pe,
    v;
    winlen = winlen,
    noverlap = noverlap,
)
sc2 = Score(
    pe,
    x;
    winlen = winlen,
    noverlap = noverlap,
)
compare(sc1, sc2)

window

Used By Packages

No packages found.