https://github.com/bwplotka/pwave
Simple & smart header-only library for signal generation.
https://github.com/bwplotka/pwave
Last synced: 10 months ago
JSON representation
Simple & smart header-only library for signal generation.
- Host: GitHub
- URL: https://github.com/bwplotka/pwave
- Owner: bwplotka
- License: apache-2.0
- Created: 2015-11-02T15:23:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-03T13:50:13.000Z (about 10 years ago)
- Last Synced: 2025-02-09T23:16:06.871Z (12 months ago)
- Language: C++
- Homepage:
- Size: 176 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# P-Wave (pwave)

Simple & smart header-only library for sequential signal generation.
Useful for testing complicated algorithms like Moving Average calculations, Change Point Detections.
Used in https://github.com/mesosphere/serenity
## Features
* Generated samples based on custom math model (any f(x) like linear, sinus etc)
* Optional noise modifiers (deterministic or random)
* Custom modifiers (spikes, drops etc)
* Print as CSV
## Usage
1. Include `pwave` in your `c++11` code.
2. Use robust `SignalScenario` class for creating custom, complex scenarios:
```cpp
SignalScenario signalGen =
SignalScenario(NUMBER_OF_ITERATIONS)
.use(math::linearFunction)
.after(12).add(-24.05)
.after(2).use(new SymetricNoiseGenerator(MAX_NOISE))
.after(23).use(math::sinFunction);
```
3. Iterate over generated values:
```cpp
ITERATE_SIGNAL(signalGen) {
// Use generated result in your code.
double_t result = (*signalGen)();
// See result as CSV:
(*signalGen).printCSVLine(result);
}
```