https://github.com/rmja/drone-framesync
Fast frame synchronization algorithms for embedded systems
https://github.com/rmja/drone-framesync
Last synced: over 1 year ago
JSON representation
Fast frame synchronization algorithms for embedded systems
- Host: GitHub
- URL: https://github.com/rmja/drone-framesync
- Owner: rmja
- Created: 2021-02-03T08:36:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-16T12:33:15.000Z (over 3 years ago)
- Last Synced: 2025-01-29T08:25:36.149Z (over 1 year ago)
- Language: Rust
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# drone-framesync
Fast frame synchronization algorithms for finding a position of a syncword within a bitstream with some allowed error tolerance.
The crate contains several algorithms that perform differently on different architectures.
There is a [benchmark project](benchmark) that tests all the algorithms and lists the number of cycles they use.
For Cortex-M4, the fastest algorithms have been determined and are selected based on the allowed threshold.
```rust
use drone_framesync::detectors::{cortexm4, Detector};
// Get the fastest detector for the 16 bit syncword 0xFFFF with an allowed tolerance of 2 bits.
let detector = cortexm4::sync16_tol2::<0xFFFF>();
let haystack = [0u8; 32];
let position = detector.position(&haystack);
// Get the fastest detector for the 32 bit syncword 0xFFFFFFFF with an allowed tolerance of 2 bits.
let detector = cortexm4::sync32_tol2::<0xFFFFFFFF>();
let haystack = [0u8; 32];
let position = detector.position(&haystack);
```
## Usage
Add the crate to your `Cargo.toml` dependencies:
```toml
[dependencies]
drone-framesync = { git = "https://github.com/rmja/drone-framesync" }
```
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.