Giter Site home page Giter Site logo

cwu307 / pyaca Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexanderlerch/pyaca

0.0 0.0 0.0 153 KB

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

License: MIT License

Python 100.00%

pyaca's Introduction

pyACA

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

This package comprises implementations of simple algorithms and features for audio content analysis.

Please note that the provided code examples are only intended to showcase algorithmic principles – they are not suited to be used without parameter optimization and additional algorithmic tuning. Furthermore, the python code might violate typical python style conventions in order to be consistent with the Matlab code at https://github.com/alexanderlerch/ACA-Code

The majority of these python sources require the numpy and scipy packages installed. Several functions (such as MFCCs and Gammatone filters) are based on implementations in Slaney’s Auditory Matlab Toolbox.

Please feel free to visit http://www.audiocontentanalysis.org/code/ to find links to the latest versions of this code or to submit comments or code that fixes, improves and adds functionality.

The top-level functions are:

  • computeFeature: calculates instantaneous features
  • computePitch: calculates a fundamental frequency estimate
  • computeKey: calculates a simple key estimate
  • computeNoveltyFunction: simple onset detection
  • computeBeatHisto: calculates a simple beat histogram

The names of the additional functions follow the following conventions:

  • Feature*: instantaneous features
  • Pitch*: pitch tracking approach
  • Novelty*: novelty function computation
  • Tool*: additional help functions such as frequency scale conversion, dynamic time warping, gammatone filterbank, ...

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 multiple 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)

pyaca's People

Contributors

alexanderlerch avatar kaushalsali avatar richard-yang-bose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.