Skip to content

Commit

Permalink
Task | FnVaFft | Threshold filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
a-givertzman committed Sep 23, 2024
1 parent 58e194d commit 7e4fd67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tests/unit/services/task/functions/va/fn_va_fft_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ mod fn_va_fft {
( 128, 128, 2, vec![( 16.0, 50.0), ( 36.0, 150.0), ( 62.0, 200.0)]),
( 256, 256, 2, vec![( 2.0, 50.0), ( 4.0, 150.0), ( 12.0, 200.0), ( 37.0, 20.0), ( 112.0, 12.0), ( 126.0, 15.0)]),
( 10_000, 10_000, 2, vec![( 5.0, 5.0), ( 10.0, 10.0), ( 50.0, 50.0), (100.0, 100.0), (400.0, 150.0), (4000.0, 200.0), (4998.0, 300.0)]),
( 30_000, 30_000, 2, vec![( 5.0, 5.0), ( 10.0, 10.0), ( 50.0, 50.0), (100.0, 100.0), (400.0, 150.0), (4000.0, 200.0), (9000.0, 200.0), (12000.0, 200.0), (14998.0, 300.0)]),
(300_000, 300_000, 2, vec![( 5.0, 5.0), ( 10.0, 10.0), ( 50.0, 50.0), (100.0, 100.0), (400.0, 150.0), (4000.0, 200.0), (9000.0, 200.0), (12000.0, 200.0), (24000.0, 250.0), (64000.0, 264.0), (120000.0, 280.0), (149998.0, 300.0)]),
( 30_000, 30_000, 2, vec![( 5.0, 5.0), ( 10.0, 10.0), ( 50.0, 50.0), (100.0, 100.0), (400.0, 150.0), (4000.0, 200.1), (9000.0, 200.2), (12000.0, 200.3), (14998.0, 300.0)]),
(300_000, 300_000, 2, vec![( 5.0, 5.0), ( 10.0, 10.0), ( 50.0, 50.0), (100.0, 100.0), (400.0, 150.0), (4000.0, 201.1), (9000.0, 202.2), (12000.0, 203.3), (24000.0, 250.0), (64000.0, 264.0), (120000.0, 280.0), (149998.0, 300.0)]),
];
for (sampl_freq, fft_size, target_ffts, target_freqs) in test_data {
let services = Arc::new(RwLock::new(Services::new(self_id, RetainConf::new(
Expand Down Expand Up @@ -176,15 +176,15 @@ mod fn_va_fft {
}

log::debug!("main | target: {:?}", fft_scalar.iter().filter_map(|val| {
if *val > 0.0 {
if *val > 1.0 {
Some(format!("{:.3}", val))
} else {
None
}
}).collect::<Vec<String>>());
log::debug!("main | FnVaFft received: {:?}", received.iter().filter_map(|v| {
let val = v.as_double().value;
if val > 0.0 {
if val > 1.0 {
Some(format!("{:.3}", v.as_double().value))
} else {
None
Expand Down

0 comments on commit 7e4fd67

Please sign in to comment.