sciport_rs/lib.rs
1//! # Sciport-rs
2//!
3//! Sciport is a collection of mathematical algorithms ported from the popular python package Scipy
4//!
5//! # Api design
6//!
7//! The main philosophy behind sciport is to change the api surface of scipy to better utilize the
8//! rich rust typesystem, when deciding between keeping the original function signature and
9//! rewriting it to better represent the valid input space, more often than not we'll decide to
10//! change it.<br/>
11//! for example this is the scipy butter filter api:
12//!
13//! ```python
14//! scipy.signal.butter(N: int, Wn: array_like, btype: String, analog: bool, output: String, fs:
15//! float)
16//! ```
17//!
18//! Wn represents a single or a pair of frequencies and btype is the type of filter,
19//! however, a single frequency makes sense only for a subset of btypes and so does a pair,
20//! in our implementation we rewrite this function like:
21//!
22//! ```ignore
23//! fn filter<T>(order: u32, band_filter: BandFilter, analog: Analog) { .. }
24//! ```
25//!
26//! where T represents the output representation of the filter (Zpk, Ba, Sos), band_filter
27//! encapsulates the original Wn and btype like this:
28//!
29//! ```ignore
30//! enum BandFilter
31//!
32//! pub enum BandFilter {
33//! Highpass(f64),
34//! Lowpass(f64),
35//! Bandpass { low: f64, high: f64 },
36//! Bandstop { low: f64, high: f64 },
37//! }
38//! ```
39//!
40//! and analog encapsulates analog and fs (since a sampling rate makes sense only when talking
41//! about a digital filter) like this:
42//!
43//! ```ignore
44//! pub enum Analog {
45//! True,
46//! False {
47//! fs: f64
48//! }
49//! }
50//! ```
51//!
52//! # Modules
53//!
54//! ## Signal Processing
55//!
56//! The signal processing toolbox currently contains some filtering functions, a limited set of filter design tools, and a few B-spline interpolation algorithms for 1- and 2-D data. While the B-spline algorithms could technically be placed under the interpolation category, they are included here because they only work with equally-spaced data and make heavy use of filter-theory and transfer-function formalism to provide a fast B-spline transform.
57//!
58//! ## Special
59//!
60//! The main feature of this module is the definition of numerous special functions
61//! of mathematical physics. Available functions include airy, elliptic, bessel, gamma, beta,
62//! hypergeometric, parabolic cylinder, mathieu, spheroidal wave, struve, and kelvin.
63//!
64pub mod signal;
65pub mod special;