GithubHelp home page GithubHelp logo

zsiciarz / aquila Goto Github PK

View Code? Open in Web Editor NEW
455.0 42.0 113.0 5.54 MB

Aquila is a digital signal processing library for C++11.

Home Page: http://aquila-dsp.org

License: MIT License

Python 0.74% CMake 10.00% C++ 79.00% C 10.17% Shell 0.09%

aquila's Introduction

What is Aquila?

Aquila is an open source and cross-platform DSP (Digital Signal Processing) library for C++11.

Build Status Windows Build Status Coverage Status Coverity Scan Build Status

Example

#include "aquila/aquila.h"

int main()
{
    // input signal parameters
    const std::size_t SIZE = 64;
    const Aquila::FrequencyType sampleFreq = 2000, f1 = 125, f2 = 700;

    Aquila::SineGenerator sine1(sampleFreq);
    sine1.setAmplitude(32).setFrequency(f1).generate(SIZE);
    Aquila::SineGenerator sine2(sampleFreq);
    sine2.setAmplitude(8).setFrequency(f2).setPhase(0.75).generate(SIZE);
    auto sum = sine1 + sine2;

    Aquila::TextPlot plot("Input signal");
    plot.plot(sum);

    // calculate the FFT
    auto fft = Aquila::FftFactory::getFft(SIZE);
    Aquila::SpectrumType spectrum = fft->fft(sum.toArray());

    plot.setTitle("Spectrum");
    plot.plotSpectrum(spectrum);

    return 0;
}

For more usage examples see the examples directory or browse them online.

Features

  • various signal sources (generators, text/binary/WAVE files)
  • signal windowing and filtering
  • performing operations on a frame-by-frame basis
  • calculating energy, power, FFT and DCT of a signal
  • feature extraction, including MFCC and HFCC features, widely used in speech recognition
  • pattern matching with DTW (dynamic time warping) algorithm

Requirements

The following dependencies are required to build the library from source.

  • a modern C++11 compiler
  • CMake >= 2.8

Contributing

See CONTRIBUTING.md for some guidelines how to get involved.

License

The library is licensed under the MIT (X11) license. A copy of the license is distributed with the library in the LICENSE file.

Authors

Zbigniew Siciarz (zbigniew at siciarz dot net)

This library includes code from Takuya Ooura's mathematical software packages, which are available at http://www.kurims.kyoto-u.ac.jp/~ooura/.

aquila's People

Contributors

cnvandev avatar liam-middlebrook avatar samuel-navarro avatar xantares avatar zsiciarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aquila's Issues

Missing a function to set bits per sample of a SignalSource and a bug in WaveFileHandler

  1. A SignalSource always returns getBitsPerSample = 64 bits. To save to wav file, bps is set to 16bit, I can't save to wave file with 8 bits per sample. I think that class SignalSource should have a property bps and its gettter, setter.
  2. A bug in function readHeaderAndChannels() of class WaveFileHandler
    short* data = new short[header.WaveSize/2];
    fs.read((char_)data, header.WaveSize);
    Ex header.WaveSize = 5, data was allocated with 4 bytes but filled with 5 bytes (from fs.read)
    delete [] data; can crash ( always crash in Visual C++ 2012 (win 64bit))
    Simple fix: short_ data = new short[header.WaveSize/2 + 1];

Zero-crossing detection

Add a way toalculate number of zero-crossings in a given signal. This can be useful for example to detect acoustic signals and separate them from silence.

Can't link with ooura when building aquila as external project

Following is my entry in CMake

include(ExternalProject)
SET(DSP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/aquila)
ExternalProject_Add(
    aquila
    PREFIX ${DSP_SOURCE_DIR}
    URL https://github.com/zsiciarz/aquila/archive/master.zip
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${DSP_SOURCE_DIR}
    ) 
INCLUDE_DIRECTORIES(${DSP_SOURCE_DIR}/include)

It does not link OouraFft library with aquila therefore causing an undefined referece to cdft fault.

My project is hosted here

audio visualizer

How would I go about programming an audio visualizer with this library. Is it porrbile to get the fft of a wav file every few miliseconds and plot the results. I couldn't find any examples for audio files like wav with aquila library

Making & Installing the Aquila library on Windows

Can you give a step-by-step description on how to make, install, and run an example for the Aquila library (if possible using Eclipse).

Can we us the dtw and mfcc code from 2.5 in the 3.0 version?

Segment fault with Aquila::OouraFft::ifft()

I wrote a demo following examples/fft_filter.cpp.
Instead of using sine generator, i read a wav file as data source.
When size is big enough, say 44100, aquila cores with ifft().

Here is my gdb output:
(gdb) bt
#0 0x0000000100012e14 in cftmdl ()
#1 0x000000010000e950 in cftfsub ()
#2 0x000000010000e006 in cdft ()
#3 0x000000010000bc15 in Aquila::OouraFft::ifft ()
#4 0x0000000100001ce9 in main (argc=2, argv=0x7fff5fbffad0) at filter_wav.cpp:32

Code is here: https://gist.github.com/sqbing/8516543

Thank you.

MFCC Oura DFT undefined symbol

I've been trying to work with an MFCC calculation, and tried copying the example into my project. When it ran, I got the following:

Undefined symbols for architecture x86_64:
  "_cdft", referenced from:
      Aquila::OouraFft::fft(double const*) in libaquila.a(OouraFft.cpp.o)
      Aquila::OouraFft::ifft(std::__1::vector<std::__1::complex<double>, std::__1::allocator<std::__1::complex<double> > >, double*) in libaquila.a(OouraFft.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm still new to C++, but I believe that's indicating it can find the header file for the DFT function, but not an object file compiled for x86_64. I'd recompile/reinstall the library, but I'm using other parts of it in other places which are working fine. Do I need to do something with Ooura? Thanks in advance.

MFCC very large coefficients value

I am computing mfcc for some file both using Auditory toolbox in matlab and aquila in C++, the values from Aquila don't look right. When I see the code, I don't see any mel-scale conversion and neither the log of values before DCT. Generally we apply some windowing function also, I don't see that too. I think I will have to use another library for it.

Bad access error when reading wav files in a loop

I'm writing an xcode project to read a large amount of wav files in a loop. After reading each file I proceed to calculate the MFCCs.
I randomly get a bad access error for the mfccobj.calculate() function.

Does anyone know how to solve this?

Refactor synthesizer examples

sfml_imperial_march and sfml_karplus_strong examples are quite similar. Consider refactoring them to use pluggable synthesizers (plain sine waves / Karplus-Strong guitar synth) and don't keep notes in the source file (how about loading notes at runtime?).

Bug loading .wav file

I try to load with WaveFile but i got a core with a message
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

Use some unit testing framework

Writing unit tests at the moment is tedious - each test case is a separate program, test inputs are in the code, but expected outputs are in CMakeLists.txt. This approach discourages from writing new tests, so a better unit testing framework is required. Bonus points if it could be easily integrated with CTest.

OouraFft should use forward transform

Had a look at the Aquila library mainly to get some understanding for how to use the Ooura FFT algortihms. I was eventually able to understand how to use them, but that also made me come to the conclusion that the algorithm used in Aquila is not the intended one.

If I have not misunderstood how the Ooura algorithms work, the line

    cdft(2*N, -1, a, ip, w);

should be replaced with

    cdft(2*N, 1, a, ip, w);

The current code performs the inverse transform, from spectrum to samples.

Also, the code returns a spectrum that has the same size as the input array. I believe that is also incorrect. The size of the spectrum is half the input plus one. I.e., the line

    SpectrumType spectrum(tmpPtr, tmpPtr + N);

should be replaced with

    SpectrumType spectrum(tmpPtr, tmpPtr + N / 2 + 1);

Finally, the code uses non-complex input, so it could use the rdft function instead of the cdft function. So, instead of this:

        // create a temporary storage array and copy input to even elements
        // of the array (real values), leaving imaginary components at 0
        double* a = new double[2 * N];
        for (std::size_t i = 0; i < N; ++i)
        {
            a[2 * i] = x[i];
            a[2 * i + 1] = 0.0;
        }

        // let's call the C function from Ooura's package
        cdft(2*N, -1, a, ip, w);

        // convert the array back to complex values and return as vector
        ComplexType* tmpPtr = reinterpret_cast<ComplexType*>(a);
        SpectrumType spectrum(tmpPtr, tmpPtr + N);

you could use this:

        // Create a copy of the input array to use for the FFT
        double *a = new double[N];
        for (std::size_t i = 0; i < N; ++i)
            a[i] = x[i];

        // Call the Ooura FFT function
        rdft(N, 1, a, ip, w);

        // The result is stored as complex numbers in a (where the last number's
        // real value is stored as the first number's complex value)
        ComplexType *tmpPtr = reinterpret_cast<ComplexType*>(a);
        SpectrumType spectrum(tmpPtr, tmpPtr + N / 2 + 1);
        spectrum[N / 2] = std::complex<double>(spectrum[0].imag(), 0);
        spectrum[0] = std::complex<double>(spectrum[0].real(), 0);

Since I am totally new to the world of DSP and FFT, I cannot guarantee that my conclusions are correct, but I'd say I'm at least 90% sure this is how it should be.

OouraFft::fft smashes heap if N is not a power of 2

The underlying fft4g library requires (but does not check for) the input size to be a power of 2. If you invoke OouraFft::OouraFft with a parameter that is not a power of 2, it will seem to work, but the first call to OouraFft::fft will write to unallocated memory. This may or may not cause SIGSEGV later in the program (how I discovered it) but it can always be detected with Valgrind.

A simple assert in the constructor would have saved me much time and aggravation. An addition to the documentation of the constructor and more importantly FftFactory::getFft would also be a good idea. Actual support for unevenly sized input data would be nice.

MFCC calculation

Once we have Mel frequency filters (discussed in #20) and the DCT (#19), we're ready to reimplement MFCC/HFCC calculation.

Kaiser Window

In some of my projects I'm using the Kaiser Window as a DPSS window approximation. In some cases I was able to improve the SNR by using Kaiser windows instead of .

In #51 I added some extra window functions. However, I couldn't add the Kaiser function because the formula depends on the modified Bessel function of the first kind.

My implementation (which is hereby released under CC0 1.0 Universal) depends on boost::math which provides Bessel functions:

template<typename T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr>
void kaiserWindow(T* out, size_t n, T alpha = 2.0) {
    using namespace boost::math;
    const T denom = (T)n - 1.0;
    const T piAlpha = boost::math::constants::pi<T>() * alpha;
    for (size_t i = 0; i < n; ++i) {
        T term1 = (2.0 * i / denom) - 1.0;
        out[i] = cyl_bessel_i(0, piAlpha * std::sqrt(1.0 - term1 * term1)) / cyl_bessel_i(0, piAlpha);
    }
}

However, boost::math is a huge template library. I'd like to avoid introducing it as a aquila dependency just because of a single window function.

Do you see any alternative to using boost::math for this?

Error when I try to 'make'

What steps will reproduce the problem?

  1. make

What is the expected output? What do you see instead?
Here's my error...

[root@localhost aquila]# make
[ 3%] Built target Ooura_fft
[ 7%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/SignalSource.cpp.o
/home/gavincangan/aquila/aquila/source/SignalSource.cpp: In member function ‘Aquila::SignalSource& Aquila::SignalSource::operator+=(Aquila::SampleType)’:
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:36:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:37:13: error: ‘end’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:38:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp: In member function ‘Aquila::SignalSource& Aquila::SignalSource::operator+=(const Aquila::SignalSource&)’:
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:53:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:54:13: error: ‘end’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:55:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:56:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp: In member function ‘Aquila::SignalSource& Aquila::SignalSource::operator_=(Aquila::SampleType)’:
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:71:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:72:13: error: ‘end’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:73:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp: In member function ‘Aquila::SignalSource& Aquila::SignalSource::operator_=(const Aquila::SignalSource&)’:
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:88:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:89:13: error: ‘end’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:90:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:91:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp: In function ‘double Aquila::mean(const Aquila::SignalSource&)’:
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:189:38: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:189:62: error: ‘end’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp: In function ‘double Aquila::energy(const Aquila::SignalSource&)’:
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:202:13: error: ‘begin’ is not a member of ‘std’
/home/gavincangan/aquila/aquila/source/SignalSource.cpp:203:13: error: ‘end’ is not a member of ‘std’
make[2]: *** [CMakeFiles/Aquila.dir/aquila/source/SignalSource.cpp.o] Error 1
make[1]: *** [CMakeFiles/Aquila.dir/all] Error 2
make: *** [all] Error 2

What version of the product are you using? On what operating system?
Aquila 3.0 on Fedora 14

Please provide any additional information below.

missing aquila community forum

For beginners like me there should be some community forum

I would like to ask
"can I use the aquila libraries to (partially) extract the sheet of music from any analog input signal"
in other words:
"can aquaila libraries work in many parallel threads so that it will be worth trying to extract midi or sheet from an analog or mp3 input"

Of course, not only the harmonics of individual instruments must then be fouriered but also the phase distances of the two stereo inputs must be used in order to identify each instruments.

Well - this will be quite a task to do - so my question is:

"Is it worth trying such huge task with aquila and has anyone
ever used the aquila libs in thousands of parallel threads?"

And my topmost question is:
where is the community forum to expect the best answers to my question ?

Maybe I missed something and I did not find the link to the discussion page

in any way, please, keep me informed and, please, add the discussion link to the aquila home page.

make problems on arch linux

[andy@arobson aquilla]$ cmake aquila-src/ -DCMAKE_INSTALL_PREFIX=aquila-build/
-- The CXX compiler identification is GNU 4.7.2
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The C compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found SFML: /usr/lib/libsfml-system.so;/usr/lib/libsfml-audio.so
SFML was found, wrappers and examples using SFML will be built.
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt4: /usr/bin/qmake-qt4 (found version "4.8.4")
Qt4 was found, GUI examples using Qt will be built.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/andy/src/aquilla
[andy@arobson aquilla]$ ls
aquila-build CMakeCache.txt cmake_install.cmake DartConfiguration.tcl lib Testing uninstall.cmake
aquila-src CMakeFiles CTestTestfile.cmake examples Makefile tests
[andy@arobson aquilla]$ make
Scanning dependencies of target Ooura_fft
[ 3%] Building C object lib/CMakeFiles/Ooura_fft.dir/ooura/fft4g.c.o
Linking C static library libOoura_fft.a
[ 3%] Built target Ooura_fft
Scanning dependencies of target Aquila
[ 3%] Building CXX object CMakeFiles/Aquila.dir/aquila/filter/MelFilter.cpp.o
[ 7%] Building CXX object CMakeFiles/Aquila.dir/aquila/filter/MelFilterBank.cpp.o
[ 11%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/SignalSource.cpp.o
[ 14%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/Frame.cpp.o
[ 18%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/FramesCollection.cpp.o
[ 22%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/PlainTextFile.cpp.o
[ 25%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/WaveFile.cpp.o
[ 29%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/WaveFileHandler.cpp.o
[ 29%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/generator/Generator.cpp.o
[ 33%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/generator/SineGenerator.cpp.o
[ 37%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/generator/SquareGenerator.cpp.o
[ 40%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/generator/TriangleGenerator.cpp.o
[ 44%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/generator/PinkNoiseGenerator.cpp.o
[ 48%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/generator/WhiteNoiseGenerator.cpp.o
[ 51%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/window/BarlettWindow.cpp.o
[ 55%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/window/BlackmanWindow.cpp.o
[ 55%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/window/FlattopWindow.cpp.o
[ 59%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/window/HammingWindow.cpp.o
[ 62%] Building CXX object CMakeFiles/Aquila.dir/aquila/source/window/HannWindow.cpp.o
[ 66%] Building CXX object CMakeFiles/Aquila.dir/aquila/transform/Dft.cpp.o
[ 70%] Building CXX object CMakeFiles/Aquila.dir/aquila/transform/AquilaFft.cpp.o
[ 74%] Building CXX object CMakeFiles/Aquila.dir/aquila/transform/OouraFft.cpp.o
[ 77%] Building CXX object CMakeFiles/Aquila.dir/aquila/transform/FftFactory.cpp.o
[ 81%] Building CXX object CMakeFiles/Aquila.dir/aquila/transform/Dct.cpp.o
[ 81%] Building CXX object CMakeFiles/Aquila.dir/aquila/transform/Spectrogram.cpp.o
[ 85%] Building CXX object CMakeFiles/Aquila.dir/aquila/tools/TextPlot.cpp.o
[ 88%] Building CXX object CMakeFiles/Aquila.dir/aquila/wrappers/SoundBufferAdapter.cpp.o
/home/andy/src/aquilla/aquila-src/aquila/wrappers/SoundBufferAdapter.cpp: In member function ‘bool Aquila::SoundBufferAdapter::LoadFromSignalSource(const Aquila::SignalSource&)’:
/home/andy/src/aquilla/aquila-src/aquila/wrappers/SoundBufferAdapter.cpp:82:92: error: ‘LoadFromSamples’ was not declared in this scope
make[2]: *** [CMakeFiles/Aquila.dir/aquila/wrappers/SoundBufferAdapter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Aquila.dir/all] Error 2
make: *** [all] Error 2
[andy@arobson aquilla]$

Unable to run example codes

I am new to this library...i am done with the installationbut can't run the example codes in the example folder. please guide

MFCC, unnecessary DCT reuse

In the class Mfcc.cpp, you have this function "calculate()",

   32     std::vector Mfcc::calculate(const SignalSource &source,
   33                                         std::size_t numFeatures)
   34     {
   35         auto spectrum = m_fft->fft(source.toArray());
   36 
   37         Aquila::MelFilterBank bank(source.getSampleFrequency(), m_inputSize);
   38         auto filterOutput = bank.applyAll(spectrum);
   39 
   40         Aquila::Dct dct;
   41         return dct.dct(filterOutput, numFeatures);
   42     }

Every time you call "calculate()", a new DCT is created (line 40). You need to pull the DCT object out of the calculate() scope and put it in the class scope privately.

You have a lot of heavy lifting in DCT, especially with the cosign tables. You even go through all the trouble of caching the cosine tables! So, take advantage of that.

The MFCC calculation will speed up tremendously, especially if you are doing tons of calculations on data that is the same size.

Great job on the library... I have been using it successfully. Ported most of it back to C++98 (had to -- working on a legacy project)

Thanks!

Move Window to sources

It makes sense for window functions to be subclasses of SignalSource in the way generators are. With the point-by-point source multiplication introduced today, windowing would be as simple as:

const std::size_t N = 1024;
sine = SineGenerator(44100);
sine.setAmplitude(2000).setFrequency(1000).generate(N);
HammingWindow w(N);
auto result = sine * w;

Improve the documentation

API docs are back up, but this is not enough. We need to write some technical prose documents, like an overview, introduction, topic guides, some cookbooks etc.

Some inspiration:

Essential parts of the documentation - these need to be written in the first place:

  • main page (introduction, motivation, short usage example)
  • feature overview
  • building and installing on Linux
  • building and installing on Windows
  • troubleshooting

Non-essential topic guides:

  • wave file processing
  • generators overview
  • spectra and spectrograms
  • the road to automated speech recognition

Examples and tests fail to build when compiled for the first time

Running make builds also example and test programs (does not run them, though, as that is handled by make test). If the library is built for the first time, examples and tests are compiled before make install. Yet they rely on installed library files, not on the local versions in source or build directory. Therefore build fails with an error like:

/home/zbyszek/Development/Aquila3/aquila/examples/wave_info/wave_info.cpp:1:36: error: aquila/source/WaveFile.h: No such file or directory  
/home/zbyszek/Development/Aquila3/aquila/examples/wave_info/wave_info.cpp: In function ‘int main(int, char**)’:
/home/zbyszek/Development/Aquila3/aquila/examples/wave_info/wave_info.cpp:11: error: ‘Aquila’ has not been declared
/home/zbyszek/Development/Aquila3/aquila/examples/wave_info/wave_info.cpp:11: error: expected ‘;’ before ‘wav’
/home/zbyszek/Development/Aquila3/aquila/examples/wave_info/wave_info.cpp:12: error: ‘wav’ was not declared in this scope

There must be a way to enforce the following build order:

  • make (builds only the library)
  • make install
  • make examples
  • make tests (and then make test)

Or, alternatively, let make run all those targets, but only build examples and tests after successful installation.

Add Aquila to biicode

biicode is a dependency manager for C/C++. It would be nice to have support for Aquila there! I think it's actually really easy to add a new library to the service and I could do it myself, but it might be better to have one of the project managers to do that.

Dynamic Time Warping

Implement DTW as in Aquila 2.5 with the following features:

  • various distance functions
  • straight/diagonal passes
  • lowest-cost path tracking

Complete speech recognition example

As there is growing demand for a complete speech recognition example using Aquila, we should put together one or more well documented examples.

Applying calculation to frames in FramesCollection

It may be desirable to calculate some properties for every frame in a FramesCollection object. For example:

Aquila::FramesCollection frames(source, 1024);
auto result = frames.apply(Aquila::energy); // or frames.forEach(...), naming undetermined yet

In this case result would be a std::vector<double> of energies of individual frames. One possible implementation may use std::transform and return vector by value (so move semantics kick in).

std::vector everywhere

All signal sources should be implemented (as efficiently as possible) in terms of std::vector, not C-style arrays.

Lazy loading of wave file data

WaveFile::load() should be called only when the data is actually needed. By default, only header information should be read.

When to implicitly request data loading?

  • getData() and getDataVector()
  • frames()
  • begin()
  • sample()? Probably not, as it may be an overhead to check at each call

Perhaps add a private helper method ensureDataLoaded()?

"Incorrect checksum for freed object" when calling calculate() on vector-based SignalSource.

I apologize in advance if this is a rookie mistake (or a painfully obvious one), but I've been completely stumped for weeks now, figured I'd ask at the source. I posted a fuller explanation (with source) on Stack Overflow, I'm trying to calculate the MFCC constants of multiple sections of a larger std::vector, and running into:

prog(15384,0x7fff7cafb310) malloc: *** error for object 0x7f8781863208: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

when trying to calculate MFCC constants with an Aquila::SignalSource created from a std::vector - trying to run the same code as the MFCC example. I've debugged it with lldb and run it through valgrind (as much as OSX can run valgrind), and it says it's reading beyond a vector's bounds somewhere, but I can't for the life of me find where that would be (the comments on the post go through where I've checked so far).

Similar questions suggest it's a dumb index-math error, and I get the feeling it's something with how I'm creating/using the Aquila::SignalSource, but I'm not sure what would be better. Any insight on how it should be done?

Error building on OSX

Trying to compile on OSX generate the following error:

/usr/bin/c++ -std=c++0x -o CMakeFiles/Aquila.dir/aquila/source/SignalSource.cpp.o -c aquila-src/aquila/source/SignalSource.cpp
aquila-src/aquila/source/SignalSource.cpp:34:43: error: no member named 'begin' in namespace 'std'
double sum = std::accumulate(std::begin(source), std::end(source), 0.0);

aquila-src/aquila/source/SignalSource.cpp:47:18: error: no member named 'begin' in namespace 'std'
std::begin(source),

Compiler used:
/usr/bin/c++ --version
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

Aquila shouldn't depend on double for everything

Aquila assumes all calculations occur in double precision floats. This is not appropriate or necessary for much DSP work. Replace references to double to a user-defined type or permit templated definitions.

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.