Previous topic

pyadb module

Next topic

audiocollection module

This Page

audiodb module

class bregman.audiodb.adb
A helper class for handling audiodb databases
static cov_dir(dir_expr, **kwargs)
load features from wildcard search into vectorized covariance stacked matrix, one file per row
static cov_list(fileList, **kwargs)
read time-series features from a file list, convert to covariance vectors and stack as a matrix    
static cov_vector(data, mn=True, cv=True, num_blocks=1, deltas=True, num_frames=None, norm_type=0, post_norm=0, frame_off=0, normalize=0)
turn time-series into Gaussian parameter vector consisting of mean and vectorized covariance
data - multidimensional feature array
mn - use means, True/False [True]
cv - use covariances, True/False [True]
    if mn==False and cv==False, use raw data
num_blocks - divide data into blocks, must be an integral divisor of rows [1] 
deltas - use derivatives, True/False [True]
num_frames - number of frames to keep, 0=all [0]
norm_type - vector norming, 0=none, 1=L1, 2=L2, 3=infinity [0]
post_norm - apply norming to output vectors (in addition to data vectors) [0]
frame_off - offset start of data by frame_off [0]

Returns:
   a vector corresponding to requested features
static cov_vector_file(fname, **kwargs)
read time-series features from a file and convert to vectorized means and covariance matrix
static get(dbname, mode='r')
Retrieve ADB database, or create if doesn't exist
static insert(db, X, P, Key, T=None)
Place features X and powers P into the adb database with unique identifier given by string "Key"
static insert_audio_files(fileList, dbName, chroma=True, mfcc=False, cqft=False, progress=None)
Simple insert features into an audioDB database named by dbBame.
Features are either chroma [default], mfcc, or cqft. 
Feature parameters are default.
static insert_feature_files(featureList, powerList, keyList, dbName, delta_time=None, undo_log10=False)
Walk the list of features, powers, keys, and, optionally, times, and insert into database
static read(fname, dtype='<f8')
read a binary little-endien row-major adb array from a file.
Uses open, seek, fread
static read_dir(dir_expr)
read directory of binary features with wilcards, e.g. dir('Features/*/*.mfcc')
returns a list of observation matrices, one for each file in the wildcard search
static read_list(fileList)
read feature data from a list of filenames into a list of arrays
static resample_vector(data, prop)
resample the columns of data by a factor of prop e.g. 0.75, 1.25,...)
static search(db, Key)
Static search method
returns sorted list of results
static sort_search_result(res)
Sort search results by stripping out repeated results and placing in increasing order of distance.
static sparseness(data)
Sparseness measure of row vector data.
Returns a value between 0.0 (smooth) and 1.0 (impulse)
static stack_vectors(data, win=1, hop=1, zero_pad=True)
::
create an overlapping stacked vector sequence from a series of vectors
data - row-wise multidimensional data to stack win - number of consecutive vectors to stack [1] hop - number of vectors to advance per stack [1] zero_pad - zero pad if incomplete stack at end
Static tempo-invariant search
Returns search results for query resampled over a range of tempos.
static uniquify(seq, idfun=None)
Remove repeated results from result list
static write(fname, data, dtype='<f8')
write a binary little-endien row-major adb array to a file.