My own corner of monopam
2
fork

Configure Feed

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

ocaml-demod: bind README example to typecheck

The example chained top-level [let] bindings into a bare [match]
expression with an unbound [sample], which doesn't parse, and didn't
list [dsp] in the mdx libraries. Wrap each of the two flows
([demod_file] and [demod_step]) as a function with explicit inputs and
add [dsp] to the mdx stanza.

+13 -10
+12 -9
ocaml-demod/README.md
··· 33 33 ## Usage 34 34 35 35 ```ocaml 36 - (* Demodulate a BPSK recording *) 37 - let samples = Dsp.Iq.of_file "bpsk_recording.raw" 38 - let demod = Demod.bpsk_create ~samples_per_symbol:4 ~loop_bw:0.05 39 - let bits = Demod.bpsk_demod demod samples 36 + (* Demodulate a BPSK recording. *) 37 + let demod_file path = 38 + let samples = Dsp.Iq.of_file path in 39 + let demod = Demod.bpsk_create ~samples_per_symbol:4 ~loop_bw:0.05 in 40 + Demod.bpsk_demod demod samples 41 + 42 + (* Or use the building blocks individually. *) 43 + let demod_step ~costas ~timing sample = 44 + let corrected = Demod.costas_step costas sample in 45 + match Demod.timing_step timing corrected with 46 + | Some _symbol -> `Symbol 47 + | None -> `Pending 40 48 41 - (* Or use the building blocks individually *) 42 49 let costas = Demod.costas_create ~order:2 ~loop_bw:0.03 43 - let corrected = Demod.costas_step costas sample 44 50 let timing = Demod.timing_create ~samples_per_symbol:4 ~loop_bw:0.02 45 - match Demod.timing_step timing corrected with 46 - | Some symbol -> () 47 - | None -> () 48 51 ``` 49 52 50 53 ## API Overview
+1 -1
ocaml-demod/dune
··· 4 4 5 5 (mdx 6 6 (files README.md) 7 - (libraries demod)) 7 + (libraries demod dsp))