ostrosco / comms-rs

A library for building DSP communication pipelines.
MIT License
13 stars 1 forks source link

Feat/vector processing #9

Closed rfdoell closed 5 years ago

rfdoell commented 5 years ago

Please let me know if this is the kind of thing you're looking for.

All feedback is welcome! My rust is pretty subpar at this point - all I can say is that this complies for now.

We should discuss what our default assumptions are about sample format; I'm just going with int16 (interleaved) for now.

Also, how should we handle intermediate state? I have some ideas for vectorizing input samples (stream -> vec and vec-> stream), but I'm not sure how to create a function that will fit nicely in the node structure at the moment.

Thanks!

ostrosco commented 5 years ago

I don't have any insight into the sample format. That's likely a question for @garbagetrash as he might know more.

With regards to intermediate state, you could capture the mutable state into an FnMut closure and pass that in, or you could create a structure that implements the function you want to use as your entry point and pass that in. I know the former works for certain. I've not tried the latter with the current Node implementation.

The code looks just fine to me. I'd add some more documentation on your methods once you've got everything flushed out. Also, once you have the entry point for your node, make sure to instantiate it with create_node! so that people can pull in your node. It'd likely be useful to make a new() function that instantiates a node and passes in the correct function as needed.

garbagetrash commented 5 years ago

Yeah int16 I/Q interleaved is the best place to start in my opinion. I have nothing to say about the code, really... BPSK bit to symbol mapping is pretty obvious, but I wonder if there's some semi-official source we can reference for mappings on things like 16 QAM or whatever.

Especially when you start thinking about stuff like Gray coding I think it gets non-trivial quickly.