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

Related tags

Miscellaneous aquila
Overview

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/.

Comments
  • make problems on arch linux

    make problems on arch linux

    [[email protected] 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 [[email protected] aquilla]$ ls aquila-build CMakeCache.txt cmake_install.cmake DartConfiguration.tcl lib Testing uninstall.cmake aquila-src CMakeFiles CTestTestfile.cmake examples Makefile tests [[email protected] 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 [[email protected] aquilla]$

    opened by cavapoo2 6
  • Error when I try to 'make'

    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...

    [[email protected] 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.

    opened by gavincangan 6
  • Error building on OSX

    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

    opened by jfdupuis 5
  • Calculate nextPowerOf2 using only bitshifts

    Calculate nextPowerOf2 using only bitshifts

    This commit allows the calculation of nextPowerOf2 in O(log(Nbits)) operations, using only bitshifts and OR operations (worst case scenario: 5 shifts and ORs for a 64 bit integer), and avoiding the costly usage of std::log2 function

    opened by samuel-navarro 4
  • MFCC Oura DFT undefined symbol

    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.

    opened by cnvandev 4
  • Segment fault with Aquila::OouraFft::ifft()

    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.

    opened by sqbing 3
  • mfcc crashes

    mfcc crashes

    I'm trying to calculate mfcc for wav files as below, but crashes every time. WaveFile->FramesCollection->Mfcc

    Source code and lldb log have been uploaded to gist, https://gist.github.com/sqbing/13e7fba7342f96d54dfe

    aquila version: dd83e58f231a369e7cc02074e6cba6999cb76b21 host: Mac OS X 10.10.2 compiler: clang-600.0.57

    opened by sqbing 2
  • Added Gaussian window function.

    Added Gaussian window function.

    I'm using Aquila in a personal project based on a MATLAB prototype, and I needed a Gaussian window function to do some blurring, similar to MATLAB's gausswin() (see http://www.mathworks.com/help/signal/ref/gausswin.html). This pull adds that function based on the formula at http://en.wikipedia.org/wiki/Window_function#Gaussian_window, as well as a (admittedly-basic) test.

    As a demonstration, here's the MATLAB output:

    >> gausswin(10)
    ans =
        0.0439
        0.1510
        0.3812
        0.7066
        0.9622
        0.9622
        0.7066
        0.3812
        0.1510
        0.0439
    

    and here's the output of the Aquila::GaussianWindow() function with the same size and their default standard deviation (they use α = 1/σ as input, default α is 2.5, so σ = 0.4).

    Aquila::GaussianWindow gaussian(10, 0.4)
    0.0439369
    0.151007
    0.381171
    0.706648
    0.962154
    0.962154
    0.706648
    0.381171
    0.151007
    0.0439369
    
    opened by cnvandev 2
  • Use some unit testing framework

    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.

    opened by zsiciarz 2
  • FFTPack implementation

    FFTPack implementation

    Hi Zbigniew,

    I did not created this message in order to inform you about an issue with your code. I wanted to ask you what source is your FFT implementation based on? Usually when I am in need of some specific mathematical functionality my main option is to rely on Fortran codes either as underlying implementation of C++ interface or as a model to build my own robust implementation.

    Regards,

    Bernard

    opened by bgin 1
  • audio visualizer

    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

    opened by ducklin5 1
  • DSP and Pi

    DSP and Pi

    Hello, I have calculated a more accurate value of Pi, which is 3.24 ((360/55.55555556)/2=3.24) that is Pi=3.24, not Pi=3.14159........ which is involved in the Fourier transform, in particular in the generation of hormone wave transforms, and is the basis of Digital Signal Processing.

    opened by KonstaMF 0
  • Bug while reading .wav file

    Bug while reading .wav file

    Hi, I'm using the Aquila library for a personal project and I was trying to load some .wav files in order to feed them to a neural network.

    The problem is that the Aquila::WaveFile constructor takes a very long time and it doesn't read the .wav file properly. More explicitly, Aquila::WaveFile yields a total number of 1283469498 samples, while, if we read the same file with another library, that one yields a total number of 19584 samples. Certainly, something went wrong.

    This link contains the .wav file.

    I'm using Visual Studio 2017 and Windows 10 x64.

    Could you help me solve this problem?

    Thanks in advance.

    opened by ISilviu 2
  • undefined reference to Aquila::WaveFile

    undefined reference to Aquila::WaveFile

    Hello, I have installed Aquila and I am getting one error when trying to compile a simple example. I have posted the issue in detail in: https://stackoverflow.com/questions/44317406/undefined-reference-to-aquilawavefile I've also found the very same issue posted by another person here: https://cpc110.blogspot.com.ar/2016/04/aquila-dsp-undefined-reference-error.html?showComment=1496407327002#c773423373309047410 Any help will be highly appreciated. Thanks, Dario

    opened by dariodematties 1
  • Is there a way to set calculation presesion to float/double/long-double?

    Is there a way to set calculation presesion to float/double/long-double?

    I want to use this lib in program that is running on 32-bit ARM machine. float operations are much faster than double on this arch. Please describe how to configure Aquila to calculate only float and don't use double.

    opened by qywx 0
  • Undefined reference to cdft in  OouraFft.cpp File not found error in lib

    Undefined reference to cdft in OouraFft.cpp File not found error in lib

    OouraFft.cpp:-1: error: undefined reference to cdft' /usr/local/lib/libAquila.a(OouraFft.cpp.o):-1: In functionAquila::OouraFft::ifft(std::vectorstd::complex<double, std::allocatorstd::complex >, double*)': OouraFft.cpp:-1: error: undefined reference to `cdft'

    opened by ecsschikane 1
Owner
Zbigniew Siciarz
Zbigniew Siciarz
Digital Signal Processing Library and Audio Toolbox for the Modern Synthesist.

Digital Signal Processing Library and Audio Toolbox for the Modern Synthesist. Attention This library is still under development! Read the docs and ch

everdrone 81 Nov 25, 2022
Itpp - IT++ library mirror/fork. C++ library of mathematical, signal processing and communication classes and functions.

Introduction ************ IT++ is a C++ library of mathematical, signal processing and communication classes and functions. Its main use is in simula

null 19 Oct 20, 2022
The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

The Synthesis ToolKit in C++ (STK) By Perry R. Cook and Gary P. Scavone, 1995--2021. This distribution of the Synthesis ToolKit in C++ (STK) contains

null 821 Nov 25, 2022
The PNT Integrity Library provides users a method to verify the integrity of the received GPS data and ranging signals, thereby improving resiliency against potential GPS signal loss.

PNT Integrity Library The PNT Integrity Library provides users a method to verify the integrity of the received GPS data and ranging signals, thereby

Cybersecurity and Infrastructure Security Agency 40 Oct 21, 2022
Thread aware Signal/Slot library

CsSignal Introduction CsSignal is a library for thread aware Signal/Slot delivery. This library does not depend upon CopperSpice or any other librarie

CopperSpice 57 Oct 18, 2022
multi-sdr-gps-sim generates a IQ data stream on-the-fly to simulate a GPS L1 baseband signal using a SDR platform like HackRF or ADLAM-Pluto.

multi-sdr-gps-sim generates a GPS L1 baseband signal IQ data stream, which is then transmitted by a software-defined radio (SDR) platform. Supported at the moment are HackRF, ADLAM-Pluto and binary IQ file output. The software interacts with the user through a curses based text user interface (TUI) in terminal.

null 66 Oct 29, 2022
mstatus is a super minimal entirely signal based statusbar for DWM.

mstatus is a uber-minimalistic signal based statusbar for DWM. All components of the statusbar are modules that must either be written by the user, or written by someone else and copied by the user.

Thomas Voss 1 Feb 2, 2022
JUCE Signal Generator

JUCE Signal Generator Application This project serves as a re-introduction to JUCE programming (I haven't used it since under-grad, circa 2012). Build

Tom Wilson 1 Dec 22, 2021
Vectron VGA Plus generates a [email protected] VGA signal and has an interface that works with retro computers or microcontrollers.

Vectron VGA Plus Vectron VGA Plus generates a [email protected] VGA signal and has an interface that works with retro computers or microcontrollers. Screen

Nick Bild 31 Jul 27, 2022
C++11 signal/slot implementation

sigslot C++11 signal/slot implementation Requirements c++11 How to use For a code sample, see test.cpp class Emitter { public: Signal<int>

Supergrover 73 Oct 27, 2022
Voltage Controlled Digital Core Multimode Oscillator using Mozzi library on Arduino

Arduino-VDCO Voltage Controlled Digital Core Multimode Oscillator using Mozzi library on Arduino Its a digital Oscillator/Voice for the Eurorack Stand

null 45 Nov 19, 2022
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Paul Ryan Santiago 3 Apr 11, 2022
This is an Arduino library for Aosong ASAIR AHT1x, AHT2x Digital Humidity & Temperature Sensor

Aosong ASAIR AHT1x/AHT2x This is an Arduino library for Aosong ASAIR AHT10/AHT15/AHT20/AHT21/AHT25/AM2301B/AM2311B Digital Humidity & Temperature Sens

enjoyneering 44 Nov 15, 2022
esp32 cam digital low latency fpv

esp32-cam-fpv esp32 cam digital, low latency FPV This project uses a modified esp-camera component running on an AI Thinker board to send low-latency

null 125 Nov 30, 2022
Comparing the performance of Wave Digital Filter implementations

WDF Bakeoff Comparing performance between Wave Digital Filters implemented in C++ and Faust. Building First clone the repository and submodules: git c

null 11 Oct 8, 2022
Direct Digital Synthesis DDS with microcontroller

Direct Digital Synthesis DDS with microcontroller DDS is a cool thing. To understand how it works is even cooler. So I wrote a little tutorial about D

weigu 2 Nov 8, 2022
A set of tutorial projects for creating a simple digital radio receiver based on the STM32G431KB microcontroller

simple-radio Обучающие проекты по созданию простого цифрового радиоприемника на базе микроконтроллера STM32G431KB. Разработка программ выполнялась в W

null 9 Sep 21, 2022
Avian is an experimental digital currency that enables instant payments to anyone, anywhere in the world.

Avian Network [AVN] What is Avian? Avian is an experimental digital currency that enables instant payments to anyone, anywhere in the world. Avian use

null 45 Nov 8, 2022
Neo - Simulates the digital rain from "The Matrix" (cmatrix clone with 32-bit color and Unicode support)

neo WARNING: neo may cause discomfort and seizures in people with photosensitive epilepsy. User discretion is advised. neo recreates the digital rain

Stew Reive 455 Nov 26, 2022