3.3 KiB
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:
- Rectangular window
- Hann window
- Hamming window
- Lanczos window
- Blackman window
- Gaussian window
- Kaiser window
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() == 0x1C291CA3);
regression.hh
Implemented Simple linear regression for Regression analysis of data.
complex.hh
Faster alternative (no Inf/NaN handling) to the std::complex implementation.
fft.hh
Mixed-radix decimation-in-time fast Fourier transform
utils.hh
Some everyday helpers, like the signum function or the lerp function.