#dsp #no-std

no-std fixed_trigonometry

Fixed point numerical approimations to trigonometric functions

21 unstable releases (3 breaking)

0.4.3 May 8, 2022
0.4.2 Mar 20, 2022
0.3.6 Feb 1, 2022
0.3.5 Jan 30, 2022
0.1.2 Sep 18, 2021

#1963 in Cryptography

Download history 9/week @ 2023-10-19 47/week @ 2023-10-26 14/week @ 2023-11-02 11/week @ 2023-11-09 8/week @ 2023-11-16 29/week @ 2023-11-23 93/week @ 2023-11-30 7/week @ 2023-12-07 29/week @ 2023-12-14 51/week @ 2023-12-21 4/week @ 2023-12-28 28/week @ 2024-01-04 11/week @ 2024-01-11 29/week @ 2024-01-18 48/week @ 2024-01-25 45/week @ 2024-02-01

135 downloads per month

Custom license

34KB
492 lines

Fixed Trigonometry

No-STD fixed-point implementation of trigonometric functions in Rust.

It utilizes the fixed library to allow flexibility in fixed point sizes and precisions.

The package.

The documentation.

Release notes are found under RELEASES.md.

Functionality

The library currently implements:

  • fft/ifft calculation, for complex fixed-point vectors.
  • sin and cos using low order polynomails, for real fixed-point numbers.
  • atan using numerical methods.
  • sqrt using the Nonlinear IIR Filter (NIIRF) method.
  • powi and complex::powi calculation.
  • no-std utilities for complex numbers.

lib.rs:

No-STD fixed-point numeric implementation of trigonometric functions in Rust.

It utilizes the fixed library to allow flexibility in fixed point sizes and precisions.

The library mixed-num has these functions implemented as traits.

The library NDSP support fixed point numbers in vectors, with various implemented operations.

Example

use fixed_trigonometry::*;
use fixed::{types::extra::U28, FixedI32};

let arg = atan::atan( FixedI32::<U28>::from_num(0.6)/FixedI32::<U28>::from_num(0.4) );
assert_eq!{ arg.to_num::<f32>(), 0.9782037 };

Dependencies

~3.5MB
~65K SLoC