Reusable C++ DSP code library
  • C++ 99.7%
  • Makefile 0.3%
Find a file
2018-07-28 21:13:53 +02:00
tests test double and single float in Kahan summation 2018-03-16 08:13:49 +01:00
.gitignore Initial commit 2018-03-02 14:04:46 +01:00
const.hh added FourPi() 2018-03-04 09:11:00 +01:00
crc.hh need CRCs way to often 2018-07-28 21:13:53 +02:00
kahan.hh added same() method to Kahan summation 2018-03-03 12:14:22 +01:00
LICENSE Initial commit 2018-03-02 14:04:46 +01:00
pcm.hh added skip() to PCM reader 2018-03-14 09:03:25 +01:00
README.md need CRCs way to often 2018-07-28 21:13:53 +02:00
spline.hh init variables using ITYPE 2018-03-29 08:57:36 +02:00
wav.hh added skip() to PCM reader 2018-03-14 09:03:25 +01:00
window.hh added a divisor argument with default 1 to normalize() 2018-04-11 14:48:02 +02:00

This is a work in progress and a long overdue attempt to bring all our DSP code together and make it reusable for our future projects.

Before using any of this you should enter the tests directory and execute "make". This will check if your compiler is able to create binaries that are able to produce correct results when executed.

What we have included so far:

kahan.hh

When working with Floating-point arithmetic we soon realize, that addition is not necessarily associative. For example, whenever we need to add values with an ever decreasing magnitude to a running sum with an ever increasing magnitude, the Kahan summation algorithm comes in handy and helps keeping the error growth small.

window.hh

Implemented are the follwing Window functions:

const.hh

Some constants we need

pcm.hh

Interface for reading and writing PCM data

wav.hh

Read and write WAV files

spline.hh

Algorithm for computing uniform and natural cubic splines Very useful for data interpolation.

crc.hh

A Cyclic redundancy check may not really be DSP-related, but it is needed over and over again when you do DSP that it fits just perfectly here.

For example, if we need to integrate CRC32 checking for a few bytes, like in the following:

# echo -n 'Hello World!' | rhash -C -
(stdin) 1C291CA3

We can add it to our project as simple as that:

DSP::CRC<uint32_t> crc(0xEDB88320, 0xFFFFFFFF);
for (uint8_t c: std::string("Hello World!")) crc(c);
assert(!crc(uint32_t(~0x1C291CA3)));