RTL-SDR IQ sample reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

mass replace Printf.sprintf/printf with Fmt.str/pr (merlint E200)

112 files across the monorepo. Printf.sprintf → Fmt.str,
Printf.printf → Fmt.pr for consistent formatting library usage.

+8 -8
+8 -8
test/test.ml
··· 57 57 let expected = 58 58 Dsp.Complex.make (Float.cos expected_angle) (Float.sin expected_angle) 59 59 in 60 - Alcotest.check tc (Printf.sprintf "sample %d" i) expected s) 60 + Alcotest.check tc (Fmt.str "sample %d" i) expected s) 61 61 samples 62 62 63 63 (* Test 3: generate_bpsk changes phase on bit transitions *) ··· 77 77 let tc = approx_complex_testable 1e-9 in 78 78 for i = 0 to sps - 1 do 79 79 Alcotest.check tc 80 - (Printf.sprintf "bit0 sample %d" i) 80 + (Fmt.str "bit0 sample %d" i) 81 81 (Dsp.Complex.make 1.0 0.0) samples.(i) 82 82 done; 83 83 (* Bit 1 (value 1): pi phase offset, so cos(pi)=-1.0 *) 84 84 for i = sps to (2 * sps) - 1 do 85 85 Alcotest.check tc 86 - (Printf.sprintf "bit1 sample %d" i) 86 + (Fmt.str "bit1 sample %d" i) 87 87 (Dsp.Complex.make (-1.0) 0.0) 88 88 samples.(i) 89 89 done; 90 90 (* Bit 2 (value 0): back to no offset, cos(0)=1.0 *) 91 91 for i = 2 * sps to (3 * sps) - 1 do 92 92 Alcotest.check tc 93 - (Printf.sprintf "bit2 sample %d" i) 93 + (Fmt.str "bit2 sample %d" i) 94 94 (Dsp.Complex.make 1.0 0.0) samples.(i) 95 95 done 96 96 ··· 168 168 Array.iteri 169 169 (fun i s -> 170 170 Alcotest.check tc 171 - (Printf.sprintf "DC sample %d" i) 171 + (Fmt.str "DC sample %d" i) 172 172 (Dsp.Complex.make 1.0 0.0) s) 173 173 samples 174 174 ··· 321 321 Alcotest.(check int) "second batch" 10 (Array.length second); 322 322 let tc = approx_complex_testable 1e-9 in 323 323 for i = 0 to 9 do 324 - Alcotest.check tc (Printf.sprintf "first[%d]" i) all.(i) first.(i) 324 + Alcotest.check tc (Fmt.str "first[%d]" i) all.(i) first.(i) 325 325 done; 326 326 for i = 0 to 9 do 327 - Alcotest.check tc (Printf.sprintf "second[%d]" i) all.(10 + i) second.(i) 327 + Alcotest.check tc (Fmt.str "second[%d]" i) all.(10 + i) second.(i) 328 328 done 329 329 330 330 (* Read after exhaustion → empty *) ··· 343 343 let data = Bytes.create n_bytes in 344 344 let src = Rtlsdr.of_bytes data in 345 345 Alcotest.(check int) 346 - (Printf.sprintf "%d bytes -> %d samples" n_bytes expected) 346 + (Fmt.str "%d bytes -> %d samples" n_bytes expected) 347 347 expected (Rtlsdr.sample_count src) 348 348 in 349 349 check 0 0;