From 3c6d560910e742a7d5838c87a824e1db2202f226 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Sat, 17 Apr 2021 20:54:51 +0300 Subject: [PATCH] Paranna koodidokumentaatiota --- src/correlation_match.rs | 3 +++ src/cross_correlation.rs | 1 + src/fft.rs | 2 +- src/math.rs | 4 ++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/correlation_match.rs b/src/correlation_match.rs index 86adda4..f8a5614 100644 --- a/src/correlation_match.rs +++ b/src/correlation_match.rs @@ -1,3 +1,5 @@ +//! Finds the closest match of a shorter piece of audio from a larger piece of audio. +//! //! Design sketch in Finnish: //! //! Algoritmi, joka etsii pidemmästä äänenpätkästä A sen kohdan, jossa @@ -27,6 +29,7 @@ use crate::cross_correlation::CrossCorrelation; use crate::math::*; +/// A structure prepared to perform correlation matches up to a given size. pub struct CorrelationMatch { max_size: usize, cross_correlation: CrossCorrelation, diff --git a/src/cross_correlation.rs b/src/cross_correlation.rs index 5f2b851..35acf7b 100644 --- a/src/cross_correlation.rs +++ b/src/cross_correlation.rs @@ -4,6 +4,7 @@ use crate::fft; use crate::math::*; use std::array::IntoIter; +/// A structure prepared to perform cross correlations up to a given maximum size. pub struct CrossCorrelation { base_size: usize, fft_size: usize, diff --git a/src/fft.rs b/src/fft.rs index 64aee28..091f85f 100644 --- a/src/fft.rs +++ b/src/fft.rs @@ -1,4 +1,4 @@ -//! This module implements the FFT, i.e. Fast Fourier Transform, and its inverse. +//! Implements the FFT, i.e. Fast Fourier Transform, and its inverse. use crate::math::*; diff --git a/src/math.rs b/src/math.rs index 2838986..68440e6 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,5 +1,5 @@ -//! This module defines mathematical structures and operations, primarily relating -//! to complex numbers. +//! Defines mathematical structures and operations, primarily relating to complex +//! numbers. // The project is being worked on, and not all operations defined in this file are // used anywhere yet. Therefore we allow "dead code".