|
Oakfield API Documentation 1.0.0
Numerical core APIs
|
Fractional Brownian motion (fBm) stimulus with Hurst exponent. More...
#include "coords.h"#include "oakfield/operator_split.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>

Go to the source code of this file.
Classes | |
| struct | SimStimulusFbmConfig |
| Configuration for seeded fractional Brownian motion stimulus noise. More... | |
Typedefs | |
| typedef struct SimStimulusFbmConfig | SimStimulusFbmConfig |
| Configuration for seeded fractional Brownian motion stimulus noise. | |
Functions | |
| SimResult | sim_add_stimulus_fbm_operator (struct SimContext *context, const SimStimulusFbmConfig *config, size_t *out_index) |
| Register a fractional Brownian motion stimulus operator. | |
| SimResult | sim_stimulus_fbm_config (struct SimContext *context, size_t operator_index, SimStimulusFbmConfig *out_config) |
| Copy the current fBm configuration from a registered operator. | |
| SimResult | sim_stimulus_fbm_update (struct SimContext *context, size_t operator_index, const SimStimulusFbmConfig *config) |
| Replace or renormalize a registered fBm stimulus configuration. | |
Fractional Brownian motion (fBm) stimulus with Hurst exponent.
Synthesizes fractal noise fields using a multi-octave cosine basis: f(x) = sum_o A 2^{-H o} cos(2π λ^o x + φ_o).
For complex fields, the sum is written as a complex-valued field with sinusoidal basis per octave.
| SimResult sim_add_stimulus_fbm_operator | ( | struct SimContext * | context, |
| const SimStimulusFbmConfig * | config, | ||
| size_t * | out_index | ||
| ) |
Register a fractional Brownian motion stimulus operator.
The implementation copies and normalizes config, initializes octave phases from the configured seed, and registers the noise operator on the target field.
| context | Simulation context that will own the operator. | |
| config | Optional fBm configuration; NULL selects normalized defaults. | |
| [out] | out_index | Optional destination for the registered operator index. |
| SimResult sim_stimulus_fbm_config | ( | struct SimContext * | context, |
| size_t | operator_index, | ||
| SimStimulusFbmConfig * | out_config | ||
| ) |
Copy the current fBm configuration from a registered operator.
| context | Simulation context containing the operator. | |
| operator_index | Index returned by sim_add_stimulus_fbm_operator(). | |
| [out] | out_config | Receives the operator's normalized configuration. |
| SimResult sim_stimulus_fbm_update | ( | struct SimContext * | context, |
| size_t | operator_index, | ||
| const SimStimulusFbmConfig * | config | ||
| ) |
Replace or renormalize a registered fBm stimulus configuration.
Passing NULL for config keeps the existing configuration and reapplies normalization. A successful update refreshes octave data and invalidates the scheduler plan.
| context | Simulation context containing the operator. |
| operator_index | Index of the fBm operator to update. |
| config | Optional replacement configuration. |