pub struct SignalInfo {Show 14 fields
pub file_name: String,
pub format: SignalFormat,
pub samples_per_frame: Option<u32>,
pub skew: Option<u32>,
pub byte_offset: Option<u64>,
pub adc_gain: Option<f64>,
pub baseline: Option<i32>,
pub units: Option<String>,
pub adc_resolution: Option<u8>,
pub adc_zero: Option<i32>,
pub initial_value: Option<Sample>,
pub checksum: Option<i32>,
pub block_size: Option<i32>,
pub description: Option<String>,
}Expand description
Signal specification from a WFDB header signal line.
§Examples
Here are a few examples of a validated signal specification line:
100.dat 212 200 11 1024 995 -22131 0 MLIIfrom MIT-BIH Databasedata0 8 100 10 0 -53 -1279 0 ECG signal 0from AHA Database- 16minimal specification (standard I/O, format 16)sig.dat 16x2:100+512 200(500)/uV 12 2048 0 0 0 Channel Awith samples per frame, skew, byte offset, and full ADC specifications
Fields§
§file_name: StringName of the file containing the signal samples.
format: SignalFormatStorage format for the signal.
samples_per_frame: Option<u32>Number of samples per frame (default: 1).
skew: Option<u32>Number of samples of skew relative to sample 0.
byte_offset: Option<u64>Byte offset from beginning of file to sample 0.
adc_gain: Option<f64>ADC gain in ADC units per physical unit.
baseline: Option<i32>Baseline value in ADC units corresponding to 0 physical units.
units: Option<String>Physical unit name (e.g., “mV”, “uV”).
adc_resolution: Option<u8>ADC resolution in bits.
adc_zero: Option<i32>ADC zero value (center of ADC range).
initial_value: Option<Sample>Initial sample value (for difference formats).
checksum: Option<i32>Checksum of all samples.
block_size: Option<i32>Block size in bytes for special files (usually 0).
description: Option<String>Human-readable description of the signal.
Implementations§
Source§impl SignalInfo
impl SignalInfo
Sourcepub const DEFAULT_ADC_GAIN: f64 = 200f64
pub const DEFAULT_ADC_GAIN: f64 = 200f64
Default ADC gain (ADC units per physical unit) when omitted.
Sourcepub const DEFAULT_ADC_RESOLUTION_AMPLITUDE: u8 = 12u8
pub const DEFAULT_ADC_RESOLUTION_AMPLITUDE: u8 = 12u8
Default ADC resolution (bits) for amplitude-format signals.
Sourcepub const DEFAULT_ADC_RESOLUTION_DIFFERENCE: u8 = 10u8
pub const DEFAULT_ADC_RESOLUTION_DIFFERENCE: u8 = 10u8
Default ADC resolution (bits) for difference-format signals.
Sourcepub const DEFAULT_ADC_ZERO: i32 = 0i32
pub const DEFAULT_ADC_ZERO: i32 = 0i32
Default ADC zero value when omitted.
Sourcepub const DEFAULT_BASELINE: i32 = 0i32
pub const DEFAULT_BASELINE: i32 = 0i32
Default baseline value when omitted (equals ADC zero).
Sourcepub const DEFAULT_UNITS: &'static str = "mV"
pub const DEFAULT_UNITS: &'static str = "mV"
Default physical units when omitted.
Sourcepub const DEFAULT_SAMPLES_PER_FRAME: u32 = 1u32
pub const DEFAULT_SAMPLES_PER_FRAME: u32 = 1u32
Default samples per frame when omitted.
Sourcepub const DEFAULT_SKEW: u32 = 0u32
pub const DEFAULT_SKEW: u32 = 0u32
Default skew when omitted.
Sourcepub const DEFAULT_BYTE_OFFSET: u64 = 0u64
pub const DEFAULT_BYTE_OFFSET: u64 = 0u64
Default byte offset when omitted.
Sourcepub const DEFAULT_BLOCK_SIZE: i32 = 0i32
pub const DEFAULT_BLOCK_SIZE: i32 = 0i32
Default block size when omitted.
Sourcepub fn from_signal_line(line: &str) -> Result<Self>
pub fn from_signal_line(line: &str) -> Result<Self>
Build signal information from a signal specification line in a WFDB header.
§Errors
Will return an error if the format of the signal specification line is invalid.
Sourcepub const fn format(&self) -> SignalFormat
pub const fn format(&self) -> SignalFormat
Get the format of the signal.
Sourcepub fn samples_per_frame(&self) -> u32
pub fn samples_per_frame(&self) -> u32
Get the samples per frame.
Fallback to the default value when omitted.
Sourcepub fn skew(&self) -> u32
pub fn skew(&self) -> u32
Get the skew of the signal.
Fallback to the default value when omitted.
Sourcepub fn byte_offset(&self) -> u64
pub fn byte_offset(&self) -> u64
Get the byte offset of the signal file.
Fallback to the default value when omitted.
Sourcepub fn adc_gain(&self) -> f64
pub fn adc_gain(&self) -> f64
Get the ADC gain of the signal.
Fallback to the default ADC gain when omitted.
Sourcepub fn baseline(&self) -> i32
pub fn baseline(&self) -> i32
Get the baseline value of the signal.
Fallback to the ADC zero value when omitted.
Sourcepub fn units(&self) -> &str
pub fn units(&self) -> &str
Get the physical units of the signal.
Fallback to the default units when omitted.
Sourcepub const fn adc_resolution(&self) -> u8
pub const fn adc_resolution(&self) -> u8
Get the ADC resolution of the signal.
Returns the specified resolution if present, otherwise returns default based on signal format (12 bits for amplitude formats, 10 for difference).
Sourcepub fn adc_zero(&self) -> i32
pub fn adc_zero(&self) -> i32
Get the ADC zero value of the signal.
Fallback to the default ADC zero when omitted.
Sourcepub fn initial_value(&self) -> Sample
pub fn initial_value(&self) -> Sample
Get the initial value of the signal.
Fallback to the ADC zero value when omitted.
Sourcepub fn block_size(&self) -> i32
pub fn block_size(&self) -> i32
Get the block size of the signal file.
Fallback to the default block size when omitted.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Get the description of the signal.
Trait Implementations§
Source§impl Clone for SignalInfo
impl Clone for SignalInfo
Source§fn clone(&self) -> SignalInfo
fn clone(&self) -> SignalInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more