Crate radiorust

source ·
Expand description

Software defined radio

Getting started

For getting started, have a look at the blocks module for a selection of ready-to-use signal processing blocks and see the “Hello World” example below. To learn how to implement your own blocks, check out the flow module and refer to the implementation of blocks::Nop, which is a trival block that simply outputs all received data as is.

Hello World example

The following example requires the cpal feature to be enabled.

use radiorust::prelude::*;

#[tokio::main]
async fn main() {
    let morse_keyer = blocks::morse::Keyer::with_message(
        4096,
        48000.0,
        blocks::morse::Speed::from_paris_wpm(16.0),
        "Hello World!",
    )
    .unwrap();
    let audio_modulator = blocks::FreqShifter::with_shift(700.0);
    audio_modulator.feed_from(&morse_keyer);
    let playback = blocks::io::audio::cpal::AudioPlayer::new(48000.0, None).unwrap();
    playback.feed_from(&audio_modulator);
    playback.wait().await.unwrap();
}

Modules

Signal processing blocks that can be connected with each other
Pools allowing to get buffers that are recycled when dropped
Data flow between blocks
Mathematic functions helpful for signal processing
Metering (e.g. level or bandwidth measurement)
Generic floats and complex numbers
Re-export of certain important items
Sample data type
Synchonization primitives
Window functions

Macros

Macro to convert number into a generic Float type, which must be in scope as “Flt