| Crates.io | sdr-iq-file-reader |
| lib.rs | sdr-iq-file-reader |
| version | 1.0.2 |
| created_at | 2024-10-06 23:11:32.593317+00 |
| updated_at | 2024-10-07 17:35:34.785099+00 |
| description | A Rust library for reading and parsing SDR (Software Defined Radio) files into complex samples. Supports various sample formats including u8, i8, i16, u16, f32, and f64. |
| homepage | |
| repository | https://github.com/Feriixu/sdr-iq-file-reader-rs |
| max_upload_size | |
| id | 1399467 |
| size | 26,382 |
sdr_file_reader is a Rust library for reading and parsing Software Defined Radio (SDR) files. It supports a wide range of sample formats, including unsigned and signed 8-bit and 16-bit integers, as well as 32-bit and 64-bit floating-point numbers. The library provides an easy interface for converting raw SDR data into complex samples that can be used for further processing.
u8, i8, i16, u16, f32, and f64.Complex<f32> or Complex<f64>).Add the following to your Cargo.toml:
[dependencies]
sdr_file_reader = "0.1.0"
Here is an example of how to use the sdr_file_reader library to read SDR data from a file:
use sdr_file_reader::{SdrFileReader, SampleType};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let file_path = "gqrx_20240929_015218_580206500_2400000_fc.raw";
let mut reader = SdrFileReader::new(file_path, 1024, SampleType::F32)?;
while let Some(samples) = reader.read_next_chunk_complexf32()? {
// Process the samples here
println!("Read {} samples", samples.len());
}
Ok(())
}
The SampleType enum represents the different formats of samples that can be used in SDR files:
U8: Unsigned 8-bit integerI8: Signed 8-bit integerI16: Signed 16-bit integerU16: Unsigned 16-bit integerF32: 32-bit floating pointF64: 64-bit floating point