DSP algorithms for embedded. Often integer math.

Overview

Embedded DSP algorithms

GitHub release Documentation QUARTIQ Matrix Chat Continuous Integration

This crate contains some tuned DSP algorithms for general and especially embedded use. Many of the algorithms are implemented on integer datatypes for several reasons that become important in certain cases:

  • Speed: even with a hard FP unit integer operations are faster.
  • Accuracy: single precision FP has a 24 bit mantissa, i32 has full 32 bit.
  • No rounding errors.
  • Natural wrap around (modulo) at the integer overflow: critical for phase/frequency applications.
  • Natural definition of "full scale".

One comprehensive user for these algorithms is Stabilizer.

Cosine/Sine

This uses a small (128 element or 512 byte LUT), smart octant (un)mapping, linear interpolation and comprehensive analysis of corner cases to achieve a very clean signal (4e-6 RMS error, 9e-6 max error, 108 dB SNR), low spurs, and no bias with about 40 cortex-m instruction per call. It computes both cosine and sine (i.e. the complex signal) at once given a phase input.

atan2

This returns a phase given a complex signal (a pair of in-phase/x/cosine and quadrature/y/sine), The RMS phase error is less than 3e-3, max error is 5e-3, relative phase error decreases further near the octant cuts.

ComplexExt

An extension trait for the num::Complex type featuring especially a std-like API to the two functions above.

PLL, RPLL

High accuracy, zero-assumption, fully robust, forward and reciprocal PLLs with dynamically adjustable time constant and arbitrary capture range.

Unwrapper, Accu, saturating_scale

Tools to handle, track, and unwrap phase signals or generate them.

iir_int, iir

i32 and f32 biquad IIR filters with robust and clean clipping and offset (anti-windup, no derivative kick, dynamically adjustable gains).

Lowpass, Lockin

Fast, infinitely cascadable, first-order lowpass and the corresponding integration into a lockin amplifier algorithm.

You might also like...
"Algorithms for approximate string matching" in Rust, with Python bindings.

ukkonen Implementation of a bounded Levenshtein distance by Esko Ukkonen in "Algorithms for approximate string matching" in Rust, with Python bindings

Common data structures and algorithms for competitive programming in Rust
Common data structures and algorithms for competitive programming in Rust

algorithm-rs algorithm-rs is common data structures and algorithms for competitive programming in Rust. Contents TBA How To Contribute Contributions a

Algorithms implemented in Rust, explained.

Rusty Algorithms & Data Structures for Learners This repository presents Rust implementations of common algorithms and data structures, many of which

This library provides implementations of many algorithms and data structures that are useful for bioinformatics.

This library provides implementations of many algorithms and data structures that are useful for bioinformatics. All provided implementations are rigorously tested via continuous integration.

Bandit Algorithms in Rust
Bandit Algorithms in Rust

Multi-armed bandit algorithms in Rust Cargo [dependencies] bandit = "0.12.3" Description and Scope This library currently only implements the annealin

A Rust implementation the HOTP and TOTP Algorithms

xotp A Rust implementation the HOTP and TOTP Algorithms. HOTP was implemented in accordance with RFC4226 TOTP was implemented in accordance with RFC62

A small collection of procedural dungeon generation algorithms.

mapgen A small collection of procedural dungeon generation algorithms. Built with Rust & macroquad. WebAssembly build deployed here. Animated version

Extended precision integer Rust library. Provides signed/unsigned integer 256 to 2048.

Extended precision integer Rust library. Provides signed/unsigned integer 256 to 2048.

DSP real time audio synthesis, effect algorithms and utilities for Rust

synfx-dsp synfx-dsp DSP real time audio synthesis, effect algorithms and utilities for Rust Most of the algorithms and implementations in this library

Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

zine/book about bitmap drawing algorithms and math with code examples in Rust
zine/book about bitmap drawing algorithms and math with code examples in Rust

A Bitmapper's Companion - zine/book about bitmap drawing algorithms and math with code examples in Rust A small zine/book written in LaTeX. In progres

This tool is for those who often want to search for a string deeply into a directory in recursive mode, but not with the great tool: grep, ack, ripgrep .........一个工具最大的价值不是它有多少功能,而是它能够让你以多快的速度达成所愿...... An open-source emulator for small OLED displays that are often used for Arduino/IOT projects.
An open-source emulator for small OLED displays that are often used for Arduino/IOT projects.

SSD1306 OLED Emulator An open-source emulator for small OLED displays that are often used for Arduino/IOT projects. This project is still in an alpha

Comprehensive DSP graph and synthesis library for developing a modular synthesizer in Rust, such as HexoSynth.

HexoDSP - Comprehensive DSP graph and synthesis library for developing a modular synthesizer in Rust, such as HexoSynth. This project contains the com

Effects for simmsb/dsp-stuff that are gpl licensed

DSP-Stuff effects (gpl) Some of the effects I'm interested in have GPL licensed implementations, as the main project is MIT licensed, the effects that

This repository contains the Rust source code for the algorithms in the textbook Algorithms, 4th Edition

Overview This repository contains the Rust source code for the algorithms in the textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

SIMD Floating point and integer compressed vector library

compressed_vec Floating point and integer compressed vector library, SIMD-enabled for fast processing/iteration over compressed representations. This

Pixel-perfect integer scaling for windowed applications

integer-fullscreen Pixel-perfect integer scaling for windowed applications. Usage Run the program. Move your cursor to a window you would like to get

Parse byte size into integer accurately.

parse-size parse-size is an accurate, customizable, allocation-free library for parsing byte size into integer. use parse_size::parse_size; assert_eq

Comments
  • Generic float iir

    Generic float iir

    This PR changes the f32 floating-point iir implementation to be generic over floating-point precision.

    Tested with f32 and f64 on Thermostat using the thermostat-mqtt code.

    opened by nkrackow 0
  • hold iir parameter unnecessary

    hold iir parameter unnecessary

    Instead of "holding" an iir one can just use another iir with the correct coefficients to "hold" the output (aka all b = 0, a1 = 0 and a0 = 1).

    opened by nkrackow 0
Releases(v0.9.2)
  • v0.9.2(Nov 29, 2022)

  • v0.9.1(Nov 29, 2022)

  • v0.9.0(Nov 3, 2022)

    What's Changed

    • remove miniconf dependency by @jordens in https://github.com/quartiq/idsp/pull/18

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.8.6...v0.9.0

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Jun 7, 2022)

    What's Changed

    • Bumping Miniconf version by @ryan-summers in https://github.com/quartiq/idsp/pull/16
    • Upgrading miniconf version by @ryan-summers in https://github.com/quartiq/idsp/pull/17

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.7.1...v0.8.0

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Jan 24, 2022)

    What's Changed

    • v0.6.0 by @jordens in https://github.com/quartiq/idsp/pull/12
    • rj/getters generic by @jordens in https://github.com/quartiq/idsp/pull/13
    • v0.7.0 release prep by @jordens in https://github.com/quartiq/idsp/pull/14

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.6.0...v0.7.0

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Jan 19, 2022)

    What's Changed

    • unwrap: also use i32 by @jordens in https://github.com/quartiq/idsp/pull/11

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.5.0...v0.6.0

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Jan 19, 2022)

    What's Changed

    • pll: add transfer function zeros at Nyquist by @jordens in https://github.com/quartiq/idsp/pull/9
    • prep v0.5.0 by @jordens in https://github.com/quartiq/idsp/pull/10

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.4.0...v0.5.0

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Dec 13, 2021)

    What's Changed

    • Adding Serialize derive by @ryan-summers in https://github.com/quartiq/idsp/pull/7
    • v0.4.0 prep by @jordens in https://github.com/quartiq/idsp/pull/8

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.3...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • v0.3(Nov 2, 2021)

    What's Changed

    • rj/release 0.2 by @jordens in https://github.com/quartiq/idsp/pull/4
    • rj/clamp by @jordens in https://github.com/quartiq/idsp/pull/5

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.2...v0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.2(Nov 1, 2021)

    What's Changed

    • Adding rust CI workflow by @ryan-summers in https://github.com/quartiq/idsp/pull/3
    • Generic float iir by @SingularitySurfer in https://github.com/quartiq/idsp/pull/1

    New Contributors

    • @SingularitySurfer made their first contribution in https://github.com/quartiq/idsp/pull/1

    Full Changelog: https://github.com/quartiq/idsp/compare/v0.1.0...v0.2

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Sep 18, 2021)

Owner
QUARTIQ
QUARTIQ
Fast, parallel, extensible and adaptable genetic algorithms framework written in Rust

oxigen Oxigen is a parallel genetic algorithm framework implemented in Rust. The name comes from the merge of OXIdación (Rust translated to Spanish) a

Martín Pozo 146 Dec 18, 2022
darwin-rs, evolutionary algorithms with rust

darwin-rs This library allows you to write evolutionary algorithms (EA) using the Rust programming language. Written by Willi Kappler, License: MIT -

Willi Kappler 95 Jan 1, 2023
Radiate is a parallel genetic programming engine capable of evolving solutions to many problems as well as training learning algorithms.

Radiate Coming from Evolutionary Radiation. Evolutionary radiation is a rapid increase in the number of species with a common ancestor, characterized

kalivas 109 Dec 18, 2022
Compare binary files using alignment algorithms

biodiff Compare binary files using alignment algorithms. What is this This is a tool for binary diffing. The tool is able to show two binary files sid

null 483 Dec 22, 2022
A tool used to evaluate the output of retrieval algorithms. Written in Rust.

Rusteval A tool used to evaluate the output of retrieval algorithms. Written in Rust. Building Install Rust with curl -sSf https://static.rust-lang.or

Giorgos Sfikas 17 Mar 22, 2022
This crate implements fast route planning algorithms in Rust.

This crate implements fast route planning algorithms in Rust. Algorithms Currently implemented: Contraction Hierarchies: The implementat

Payas Rajan 4 Aug 15, 2021
A browser app that evolves vehicles using genetic algorithms, written in Rust and Bevy

Vehicle Evolver Deluxe This is a simulation that uses AI (to be specific: genetic algorithms) to try to build better and better vehicles. The vehicles

null 95 Dec 26, 2022
Genetic Algorithms Library

genx genx provides modular building blocks to run simulations of optimization and search problems using Genetic Algorithms (GA). The vision for genx i

Lakshya Singh 29 Aug 9, 2022
ECFFT algorithms on the BN254 base field

ECFFT algorithms on the BN254 base field This crate implements structs and traits for the ECFFT algorithms from the paper Elliptic Curve Fast Fourier

null 36 Nov 28, 2022
A library that can be used as a building block for high-performant graph algorithms.

graph A library that can be used as a building block for high-performant graph algorithms. Graph provides implementations for directed and undirected

Martin Junghanns 222 Jan 1, 2023