Crate efd

source · []
Expand description

This crate implements Elliptical Fourier Descriptor (EFD) and its related functions.

Simple usage of resampling circle:

use efd::Efd;
use ndarray::{stack, Array1, Axis};
use std::f64::consts::TAU;

const N: usize = 10;
let circle = stack![
    Array1::linspace(0., TAU, N).mapv(f64::cos),
    Array1::linspace(0., TAU, N).mapv(f64::sin)
let curve = circle
    .map(|c| [c[0], c[1]])
let new_curve = Efd::from_curve(&curve, None).generate(20);


This crate support no-std solution via using “libm”, a crate provide pure-rust math functions, please enable it if disabled the “std” feature.


Elliptical Fourier Descriptor coefficients. Provide transformation between discrete points and coefficients.

Geometric information.


Check the difference between two curves.

Compute the total Fourier power and find the minimum number of harmonics required to exceed the threshold fraction of the total power.

A convenient function to apply Nyquist Frequency on fourier_power function.