diff --git a/rust/oxide-decoders/Cargo.toml b/rust/oxide-decoders/Cargo.toml index 7bd8b23..c45ae4b 100644 --- a/rust/oxide-decoders/Cargo.toml +++ b/rust/oxide-decoders/Cargo.toml @@ -16,4 +16,4 @@ log = "0.4.17" custom_error = "1.9.2" num = "0.4.0" tokio = { version = "1.28.1", features = ["full", "tracing"] } -num-complex = "0.4.3" +# num-complex = "0.4.3" diff --git a/rust/oxide-decoders/src/decoders/acars.rs b/rust/oxide-decoders/src/decoders/acars.rs index a09a8ca..bfda72a 100644 --- a/rust/oxide-decoders/src/decoders/acars.rs +++ b/rust/oxide-decoders/src/decoders/acars.rs @@ -16,7 +16,8 @@ use crate::Decoder; use custom_error::custom_error; -use num_complex::Complex; +// use num_complex::Complex; +use num::Complex; use std::fmt::Display; use std::fmt::Formatter; use std::ops::Add; @@ -482,7 +483,7 @@ impl ACARSDecoder { for in_ in &mut self.dm_buffer.into_iter().take(len) { let s: f32 = 1800.0 / INTRATE as f32 * 2.0 * std::f32::consts::PI + self.msk_df; - let mut v: Complex = num::Complex::new(0.0, 0.0); + let mut v: Complex = Complex::new(0.0, 0.0); let mut o: f32; /* VCO */ @@ -493,7 +494,7 @@ impl ACARSDecoder { /* mixer */ - self.inb[self.idx as usize] = in_ * Complex::exp(-self.msk_phi * num::Complex::i()); + self.inb[self.idx as usize] = in_ * Complex::exp(-self.msk_phi * Complex::i()); self.idx = (self.idx + 1) % (FLEN as u32); /* bit clock */ diff --git a/rust/oxide-decoders/src/lib.rs b/rust/oxide-decoders/src/lib.rs index 9d44d53..05ddb88 100644 --- a/rust/oxide-decoders/src/lib.rs +++ b/rust/oxide-decoders/src/lib.rs @@ -15,7 +15,8 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA use decoders::acars::AssembledACARSMessage; -use num_complex::Complex; +//use num_complex::Complex; +use num::Complex; use tokio::sync::mpsc::UnboundedSender; #[macro_use] diff --git a/rust/oxide-rtlsdr/Cargo.toml b/rust/oxide-rtlsdr/Cargo.toml index 1b020e8..5b93267 100644 --- a/rust/oxide-rtlsdr/Cargo.toml +++ b/rust/oxide-rtlsdr/Cargo.toml @@ -22,4 +22,4 @@ custom_error = "1.9.2" oxide-decoders = { path = "../oxide-decoders" } tokio = { version = "1.28.1", features = ["full", "tracing"] } array-init = "2.1.0" -num-complex = "0.4.3" +# num-complex = "0.4.3" diff --git a/rust/oxide-rtlsdr/src/lib.rs b/rust/oxide-rtlsdr/src/lib.rs index 500c2df..cc0d262 100644 --- a/rust/oxide-rtlsdr/src/lib.rs +++ b/rust/oxide-rtlsdr/src/lib.rs @@ -16,7 +16,8 @@ #[macro_use] extern crate log; -use num_complex::Complex; +// use num_complex::Complex; +use num::Complex; use oxide_decoders::decoders::acars::ACARSDecoder; use oxide_decoders::decoders::acars::{self, AssembledACARSMessage}; use oxide_decoders::{Decoder, ValidDecoderType}; @@ -246,7 +247,7 @@ impl RtlSdr { let mut window: Vec> = vec![]; for i in 0..self.rtl_mult { // ch->wf[ind]=cexpf(AMFreq*ind*-I)/rtlMult/127.5; - let window_value = (am_freq * i as f32 * -num::complex::Complex::i()).exp() + let window_value = (am_freq * i as f32 * -Complex::i()).exp() / self.rtl_mult as f32 / 127.5; window.push(window_value); @@ -294,7 +295,7 @@ impl RtlSdr { pub async fn read_samples(mut self) { let rtloutbufz = self.get_rtloutbufsz(); let buffer_len: u32 = rtloutbufz as u32 * self.rtl_mult as u32 * 2; - let mut vb: [Complex; 320] = [num::complex::Complex::new(0.0, 0.0); 320]; + let mut vb: [Complex; 320] = [Complex::new(0.0, 0.0); 320]; match self.reader { None => {