GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alexanderlerch/pyACA: Python scripts accompanying the book "An Introduction to Audio Content Analysis" (www.AudioContentAnalysis.org)

BranchesTags
Open more actions menu

Latest commit

 

History

210 Commits
210 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.idea
.idea
 
 
.vs/pyACA
.vs/pyACA
 
 
pyACA
pyACA
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
citation.cff
citation.cff
 
 
doxy.config
doxy.config
 
 
pyACA.pyproj
pyACA.pyproj
 
 
pyACA.sln
pyACA.sln
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

GitHub top language PyPI - Python Version GitHub release (latest SemVer) DOI GitHub issues GitHub last commit GitHub

pyACA

Python scripts accompanying the book "An Introduction to Audio Content Analysis". The source code shows example implementations of basic approaches, features, and algorithms for music audio content analysis.

All implementations are also available in:

  • Matlab: ACA-Code
  • C++: libACA

functionality

The top-level functions are (alphabetical):

  • computeBeatHisto: calculates a simple beat histogram
  • computeChords: simple chord recognition
  • computeFeature: calculates instantaneous features
  • computeFingerprint: audio fingerprint extraction
  • computeKey: calculates a simple key estimate
  • computeMelSpectrogram: computes a mel spectrogram
  • computeNoveltyFunction: simple onset detection
  • computePitch: calculates a fundamental frequency estimate
  • computeSpectrogram: computes a magnitude spectrogram

The names of the additional functions follow the following conventions:

  • Feature*: instantaneous features
  • Pitch*: pitch tracking approach
  • Novelty*: novelty function computation
  • Tool*: additional helper functions and basic algorithms such as
    • Blocking of audio into overlapping blocks
    • Pre-processing audio
    • Conversion (freq2bark, freq2mel, freq2midi, mel2freq, midi2freq)
    • Filterbank (Gammatone)
    • Gaussian Mixture Model
    • Principal Component Analysis
    • Feature Selection
    • Dynamic Time Warping
    • K-Means Clustering
    • K Nearest Neighbor classification
    • Non-Negative Matrix Factorization
    • Viterbi algorithm

documentation

The latest full documentation of this package can be found at https://alexanderlerch.github.io/pyACA.

design principles

Please note that the provided code examples are only intended to showcase algorithmic principles – they are not entirely suitable for practical usage without parameter optimization and additional algorithmic tuning. Rather, they intend to show how to implement audio analysis solutions and to facilitate algorithmic understanding to enable the reader to design and implement their own analysis approaches.

minimal dependencies

The required dependencies are reduced to a minimum, more specifically to only numpy and scipy, for the following reasons:

  • accessibility, i.e., clear algorithmic implementation from scratch without obfuscation by using 3rd party implementations,
  • maintainability through independence of 3rd party code. This design choice brings, however, some limitations; for instance, reading of non-RIFF audio files is not supported and the machine learning models are very simple.

readability

Consistent variable naming and formatting, as well as the choice for simple implementations allow for easier parsing. The readability of the source code will sometimes come at the cost of lower performance.

cross-language comparability

All code is matched exactly with Matlab implementations and the equations in the book. This also means that the python code might violate typical python style conventions in order to be consistent.

related repositories and links

The python source code in this repository is matched with corresponding source code in the Matlab repository. A C++ implementation with identical functionality can be found in the C++ repository.

Other, related repositories are

  • ACA-Slides: slide decks for teaching and learning audio content analysis
  • ACA-Plots: Matlab scripts for generating all plots in the book and slides

The main entry point to all book-related information is AudioContentAnalysis.org

getting started

installation

pip install pyACA 

code examples

example 1: computation and plot of the Spectral Centroid

import pyACA
import matplotlib.pyplot as plt 

# file to analyze
cPath = "c:/temp/test.wav"

# extract feature
[v, t] = pyACA.computeFeatureCl(cPath, "SpectralCentroid")

# plot feature output
plt.plot(t,np.squeeze(v))

example 2: Computation of two features (here: Spectral Centroid and Spectral Flux)

import pyACA

# read audio file
cPath = "c:/temp/test.wav"
[f_s, afAudioData] = pyACA.ToolReadAudio(cPath)

# compute feature
[vsc, t] = pyACA.computeFeature("SpectralCentroid", afAudioData, f_s)
[vsf, t] = pyACA.computeFeature("SpectralFlux", afAudioData, f_s)

About

Python scripts accompanying the book "An Introduction to Audio Content Analysis" (www.AudioContentAnalysis.org)

Topics

audio-content-analysisaudio-featuresaudio-processingmusic-informaticsmusic-information-retrievalsignal-processing

Resources

Readme
MIT license
Activity

Stars

178 stars

Watchers

7 watching

Forks

41 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.