ModemTrait

Trait ModemTrait 

Source
pub trait ModemTrait {
    // Required methods
    fn modulate(&self, data: &[bool]) -> Result<Vec<f32>, Box<dyn Error>>;
    fn demodulate(&self, samples: &[f32]) -> Result<Vec<bool>, Box<dyn Error>>;
    fn analyze_bit(&self, samples: &[f32]) -> Result<(f32, f32), Box<dyn Error>>;
}

Required Methods§

Source

fn modulate(&self, data: &[bool]) -> Result<Vec<f32>, Box<dyn Error>>

Source

fn demodulate(&self, samples: &[f32]) -> Result<Vec<bool>, Box<dyn Error>>

Source

fn analyze_bit(&self, samples: &[f32]) -> Result<(f32, f32), Box<dyn Error>>

Analyzes a small chunk of audio, returning the energy at the mark and space frequencies. Returns (mark_energy, space_energy).

Implementors§