Skip to main content

thd

Function thd 

Source
pub fn thd(frequency: &[f64], magnitude: &[f64]) -> Option<f64>
Expand description

Total harmonic distortion as a percentage of the fundamental.

Every bin that is neither DC nor the fundamental counts as distortion: 100 · sqrt(Σ m²) / m_fundamental. A spectrum with no fundamental, or one whose fundamental is zero, has no answer.