https://github.com/folkengine/bregman
Automatically exported from code.google.com/p/bregman
https://github.com/folkengine/bregman
Last synced: 3 months ago
JSON representation
Automatically exported from code.google.com/p/bregman
- Host: GitHub
- URL: https://github.com/folkengine/bregman
- Owner: folkengine
- License: other
- Created: 2015-11-08T17:37:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-08T18:49:49.000Z (over 9 years ago)
- Last Synced: 2025-03-06T00:52:44.458Z (3 months ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Bregman Audio-Visual Information Toolbox
****************************************
*Advanced Tools for the Digital Arts and Humanities**This file is ported from [http://digitalmusics.dartmouth.edu/~mcasey/bregman/](http://digitalmusics.dartmouth.edu/~mcasey/bregman/). Source imported from [https://code.google.com/p/bregman/](https://code.google.com/p/bregman/)*
Introduction
============
Welcome to the Bregman toolbox from the Bregman Music and Audio
Research Studio at Dartmouth College. These pages document the
toolbox and provide a set of guided tutorials to its use.Who is Bregman for?
===================
Bregman provides Python tools to support research and development including, but not limited to:
* Music IR - explore methods for audio and music machine learning and information retrieval
* Multimedia IR - explore methods for video information retrieval (requires OpenCV package)
* Music Cognition/Neuroscience - classify/predict music evoked fMRI and EEG signals (requires PyMVPA package)
* Computational Musicology - run queries on music collections
* Teaching (e.g. Music Information Retrieval) - hands-on tools for undergraduate, Masters, and Ph.D. students
* Application development - make new Python-based MIR applications such as music search and recommender systemsLibraries and Dependencies
==========================
* Required: pylab (numpy + scipy + matplotlib).
* Linux and OSX users with package management tools (e.g. easy_install, dpkg, apt-get, ports, yum), should install the unix packages from their distributions, e.g. (using apt-get):sudo apt-get install ipython python-numpy python-matplotlib python-scipy
* Windows, and OSX without package manager, install the Enthought Python Distribution (EPD). Available for `FREE for academic use `_.
* Strongly recommended: instal `scikits.audiolab `_ for audio play and wavread/wavwrite functions.Download Bregman
================
Save the ZIP file `Bregman Toolbox Version 0.12-09.15 `_ to your machine.Installation
============
unzip the installer directory. You will need to install as administrator. In a UNIX terminal:cd /path/to/installer/directory
sudo python setup.py installIf you do not have admin (sudo) privileges, you can install in your home path using the --prefix "$HOME" option to setup.py
Tutorial 0: Getting Started
===========================
First launch the *ipython* shell with *pylab* preloaded:ipython --pylab # launch the ipython shell with pylab
Import the entire bregman toolbox and specify an audio file to work with:
from bregman.suite import *
#use built-in audio examples in audio_dir
audio_file = os.path.join(audio_dir,"gmin.wav")Extract short-time Fourier transform, specifying window parameters:
linspec = LinearFrequencySpectrum(audio_file, nfft=1024, wfft=512, nhop=256)
linspec.feature_plot(dbscale=True)
title('Wide-band Linear Spectrum')Play the audio_file using the built-in play() command":
x,sr,fmt = wavread(audio_file) # load the audio file
play(x, sr) # play itInvert the short-time Fourier transform back to audio using the feature inverse() method.
x_hat = linspec.inverse(usewin=0) # invert features to audio (use original phases, no windowing)
play(x_hat)Extract the log-frequency spectrum, specifying windowing parameters:
logspec = LogFrequencySpectrum(audio_file, nhop=2205) # extract log spectrum
logspec.feature_plot(dbscale=True) # plot features on dB scale
title('Narrow-band Log Spectrum')Invert the log spectrum using the feature inverse() method. The log-frequency spectrum does not contain complete information so we'll need to estimate the phases, via the *pvoc=True* flag, and use a reconstruction window, *usewin=True*. The signal should also be balanced to ensure no clipping on audio output.
x_hat = logspec.inverse(pvoc=True) # invert phaseless features to audio
play(balance_signal(x_hat),sr) # play inverted featuresInspect the default feature parameters and features module help:
# list the (default) parameters that control feature extraction."
Features.default_params() # inspect default parameters
help(features) # see help on the features moduleList the tutorials and run one:
# show list of tutorials:
get_tutorials()
# execute the first tutorial (1. features)
execfile(get_tutorials()[1])Tutorials
=========
Bregman comes with a set of tutorials that we recommend you become familiar with.
* `Tutorial1 `_ - Audio feature extraction and visualization.
* `Tutorial2 `_ - Audio test signal synthesis.
* `Tutorial3 `_ - Audio similarity analysis
* `Tutorial4 `_ - Concatenative audio synthesis with a source and target.
* `Tutorial5 `_ - Audio source separation using non-negative matrix factorization.Bregman Python Modules
======================
.. toctree::
:maxdepth: 2suite - wrapper package to bundle all the bregman tools
testsignal - test signal generators
features - feature extractors and visualizers
segment - media segmentation and segmented feature extraction
psychoacoustics - perceptual methids, critical bands, loudness scales
tuning - methods for generating different tunings, temperaments, and scales
distance - distance metrics, dynamic time-warping, and multidimensional scaling
classifier - unsupervised and supervised learning with feature data
pyadb - interface to audiodb feature-vector database and scalable content-based retrieval
audiodb - audiodb extensions helper class and feature regularization / pre-processing
audiocollection - manage collections of audio and features with audiodb
metadata - tools for searching and manipulating metadata from the Web
testcollection - generate signals and evaluate features and search algorithms
evaluate - general-purpose evaluation module using user-supplied ground-truth
sound - audio input/output utilities and sound-file read/write methods
lsh - fast (sublinear time complexity) search using locality sensitive hashingIndices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`Funding sources:
================
.. figure:: http://www.neh.gov/files/neh_at_logo.png
.. figure:: http://www.dartmouth.edu/~neukom/_permacode/current/styles/images/header-home.jpg
:width: 300px