Loudia

Introduction

Features

The following algorithms are implemented:

  • Window
  • Unwrap
  • Fast Fourier Transform (FFT / IFFT) (wrapper around libfftw [http://www.fftw.org/])
  • Discrete Cosine Transform (DCT)
  • Filter and BandFilter (based on Scipy [http://www.scipy.org/] implementation):
    • Band type
      • LowPass
      • HighPass
      • BandPass
      • BandStop
    • Filter type
      • Chebyshev I
      • Chebyshev II
      • Bessel
      • Butterworth
  • Correlation / Autocorrelation
    • Direct calculation
    • FFT based calculation
  • Resample (wrapper around libsamplerate [http://www.mega-nerd.com/SRC/])
  • Onset Detection Functions:
    • High Frequency Content (HFC)
    • Flux
    • Phase Deviation
    • Complex Domain
    • Modified Kullback-Liebler
    • Peak Center of Gravity
  • Pitch Estimation:
  • Spectral Bands
    • Mel bands
  • MFCC
  • LPC
  • Sinusoidal Modelling:
    • Peak Detection
    • Peak Interpolation
    • Peak Tracking
  • Spectral Whitening
  • Spectral Noise Suppression
  • Non-negative Matrix Factorization (NMF)
  • Other experimental and/or unfinished algorithm implementations
    • Spectral Reassignment
    • Adaptative Optimized Kernel (AOK) (modification of AOK 4.1 [http://www.macunix.net/aok.html])
    • Peak Synthesis
    • Incremental Non-negative Matrix Factorization (INMF)
    • LPC residual

Numerous examples which can also be used for testing in some cases can be found in python/ Some of the examples require an audio WAVE filename as input argument.

Credits

License

Loudia is Free Software licensed under GNU General Public License version 3 or later

Download

Loudia (version 0.1) (March 31 2009)

The git repository may be found at github:

git clone git://github.com/rikrd/loudia.git

Note that Loudia has only been tested on GNU/Linux

Overview

The library is composed by algorithms. Algorithms are classes that represent a processing unit.

All algorithms share two methods:

  • setup()
  • reset()

Additionally a method called process() is also always present. Depending on the algorithm the method will take different number and types of arguments.

The algorithms return the results in a C-style way. The process() method also takes as input arguments pointers to matrices where the results will be written.

All inputs and outputs to the process() methods are of type Eigen::Matrix.

Quick HOWTO

From Python you may create algorithm, change its parameters and call the process method:

import numpy
import pylab
import loudia

# We create a 120 samples frame 
# of a sine at 440 Hz 
# with a samplerate of 8000 Hz
data_frame = numpy.array(numpy.sin(2*numpy.pi*440.0*numpy.arange( 0.0, 120/8000.0, 1/8000.0)))


fft = loudia.FFT()
fft.setFftSize( 256 )

result = fft.process( data_frame )

# Note that the results of the FFT algorithm 
# are stacked in rows (we only plot the first)
pylab.subplot(211)
pylab.plot( abs( result[0,:] ) ) 


# When setting several parameters we might 
# not want the algorithm to reconfigure itself
# method after each parameter setting, 
# and we will call the setup() manually 
fft.setFftSize( 1024, False )
fft.setZeroPhase( True, False )
fft.setup()

result = fft.process( data_frame )

# Note that the results of the FFT algorithm 
# are stacked in rows (we only plot the first)
pylab.subplot(212)
pylab.plot( abs( result[0,:] ) )

pylab.show()

Documentation

The documentation is available here.

Limitations

A few assumptions are used when using the library:

  • Loudia has no algorithm for loading audio frames

  • All algorithms take Eigen::Matrix types as inputs and outputs in the process() methods

  • Loudia does NOT have a streaming mode. All algorithms mantain a state which can be reset using reset(). And the process() methods may act on preallocated matrices. Therefore with the use of Eigen::Map, Loudia can be used inside streaming libraries that expose the buffers.