-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathREADME
194 lines (131 loc) · 4.38 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
WHAT YOU WILL FIND HERE
-----------------------
A C++ library with Python bindings "Loudia"
It is used to build audio applications.
Loudia is specially targeted for researchers.
The algorithms are not necessarily tuned for performance
but rather for:
* Ease of use
* Flexibility and clarity of the algorithms
* Variety of algorithms
The following algorithms are implemented:
* Window
* Unwrap
* Fast Fourier Transform (FFT/IFFT) (wrapper around libfftw [http://www.fftw.org/])
* Discrete Cosine Transform (DCT)
* Filters (based on Scipy [http://www.scipy.org] implementation):
- LowPass
- HighPass
- BandPass
- BandStop
in the following types:
- Chebyshev I
- Chebyshev II
- Bessel
- Butterworth
* Correlation / Autocorrelation
- Direct calculation
- FFT based calculation
* Resampling (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:
- Autocorrelation Function based (ACF)
- Inverse Problem based
* 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.
DEPENDENCIES
------------
The C++ library Libaudio requires:
- libsamplerate-dev >=0.1.3
- libfftw3-dev >=3.1.2
- gcc
- python >=2.5
The Python bindings Libaudio require:
- swig
- numpy-dev
- python-dev
Libaudio uses a template library called Eigen (http://eigen.tuxfamily.org).
In C++ all algorithms use Eigen::Matrix types as inputs and outputs.
In the Python bindings use Numpy arrays as inputs and outputs.
BUILD/INSTALL LOUDIA
--------------------
To build and install Loudia run:
./waf configure --prefix=/some/install/dir
./waf build
sudo ./waf install
To uninstall it run:
sudo ./waf uninstall
Several options allow different building modes.
To build without Python bindings run:
./waf configure --no-python-bindings
./waf build --no-python-bindings
To build the documentation run:
./waf configure --doc
./waf build --doc
To build in debug mode run:
./waf configure --debug
./waf build --debug
These options can be combined.
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()
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.
---------------------------
Loudia (C) 2008, 2009 Ricard Marxer