No description
| benches | Initial commit | |
| examples | Initial commit | |
| src | Initial commit | |
| tests | Initial commit | |
| .gitignore | Initial commit | |
| Cargo.toml | Initial commit | |
| GPT_Prompt.txt | Initial commit | |
| LICENSE | Initial commit | |
| README.md | Remove github specific stuff | |
Forked from alesgenova / pitch-detection
pitch_detection
Usage
usepitch_detection::detector::mcleod::McLeodDetector;usepitch_detection::detector::PitchDetector;fn main(){constSAMPLE_RATE: usize =44100;constSIZE: usize =1024;constPADDING: usize =SIZE/2;constPOWER_THRESHOLD: f64 =5.0;constCLARITY_THRESHOLD: f64 =0.7;// Signal coming from some source (microphone, generated, etc...)
letdt=1.0/SAMPLE_RATEasf64;letfreq=300.0;letsignal: Vec<f64>=(0..SIZE).map(|x|(2.0*std::f64::consts::PI*xasf64*dt*freq).sin()).collect();letmutdetector=McLeodDetector::new(SIZE,PADDING);letpitch=detector.get_pitch(&signal,SAMPLE_RATE,POWER_THRESHOLD,CLARITY_THRESHOLD).unwrap();println!("Frequency: {}, Clarity: {}",pitch.frequency,pitch.clarity);}Live Demo
Documentation
LaTeX formulas can be used in documentation. This is enabled by a method outlined in rust-latex-doc-minimal-example. To build the docs, use
cargo doc --no-deps
The --no-deps flag is needed because special headers are included to auto-process the math in the documentation. This
header is specified using a relative path and so an error is produced if cargo tries generate documentation for
dependencies.