Minor improvements

This commit is contained in:
2025-08-28 11:33:33 +02:00
parent 044cfb069a
commit 83731f77e0
2 changed files with 3 additions and 8 deletions

View File

@@ -230,12 +230,7 @@ const RCAL_VAL: f32 = 1000.0;
/// Convert raw 18-bit 2's complement value to signed i32
fn sign_extend_18bit(val: u32) -> i32 {
let masked = val & 0x3FFFF;
if masked & (1 << 17) != 0 {
(masked | 0xFFFC0000) as i32
} else {
masked as i32
}
((val << 14) as i32) >> 14
}
/// Calculate magnitude and phase of Rz using Rcal reference