Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
sieve.h File Reference

Discrete convolution-based filtering on real or complex fields. More...

#include "oakfield/operator_split.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for sieve.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimSieveOperatorConfig
 Configuration parameters for the sieve operator family. More...
 

Typedefs

typedef enum SimSieveMode SimSieveMode
 Available response shapes for the sieve operator.
 
typedef struct SimSieveOperatorConfig SimSieveOperatorConfig
 Configuration parameters for the sieve operator family.
 

Enumerations

enum  SimSieveMode {
  SIM_SIEVE_MODE_LOW_PASS = 0 , SIM_SIEVE_MODE_HIGH_PASS , SIM_SIEVE_MODE_BAND_PASS_DOG , SIM_SIEVE_MODE_BAND_STOP_DOG ,
  SIM_SIEVE_MODE_SAVGOL_SMOOTH , SIM_SIEVE_MODE_SAVGOL_DERIVATIVE , SIM_SIEVE_MODE_HANN_LOW_PASS , SIM_SIEVE_MODE_HANN_HIGH_PASS ,
  SIM_SIEVE_MODE_BLACKMAN_LOW_PASS , SIM_SIEVE_MODE_BLACKMAN_HIGH_PASS , SIM_SIEVE_MODE_TUKEY_LOW_PASS , SIM_SIEVE_MODE_TUKEY_HIGH_PASS
}
 Available response shapes for the sieve operator. More...
 

Functions

SimResult sim_add_sieve_operator (struct SimContext *context, const SimSieveOperatorConfig *config, size_t *out_index)
 Register a sieve filtering operator with the provided configuration.
 
SimResult sim_sieve_config (struct SimContext *context, size_t operator_index, SimSieveOperatorConfig *out_config)
 Retrieve the configuration currently bound to a sieve operator.
 
SimResult sim_sieve_update (struct SimContext *context, size_t operator_index, const SimSieveOperatorConfig *config)
 Update an existing sieve operator in-place.
 

Detailed Description

Discrete convolution-based filtering on real or complex fields.

Supports Gaussian, difference-of-Gaussians, Savitzky-Golay, and windowed responses. Complex support is component-wise (Re/Im filtered independently).

Enumeration Type Documentation

◆ SimSieveMode

Available response shapes for the sieve operator.

Enumerator
SIM_SIEVE_MODE_LOW_PASS 

Gaussian-like low-pass response.

SIM_SIEVE_MODE_HIGH_PASS 

High-pass response.

SIM_SIEVE_MODE_BAND_PASS_DOG 

Difference-of-Gaussians band-pass response.

SIM_SIEVE_MODE_BAND_STOP_DOG 

Difference-of-Gaussians band-stop response.

SIM_SIEVE_MODE_SAVGOL_SMOOTH 

Savitzky-Golay smoothing response.

SIM_SIEVE_MODE_SAVGOL_DERIVATIVE 

Savitzky-Golay derivative response.

SIM_SIEVE_MODE_HANN_LOW_PASS 

Hann-windowed low-pass response.

SIM_SIEVE_MODE_HANN_HIGH_PASS 

Hann-windowed high-pass response.

SIM_SIEVE_MODE_BLACKMAN_LOW_PASS 

Blackman-windowed low-pass response.

SIM_SIEVE_MODE_BLACKMAN_HIGH_PASS 

Blackman-windowed high-pass response.

SIM_SIEVE_MODE_TUKEY_LOW_PASS 

Tukey-windowed low-pass response.

SIM_SIEVE_MODE_TUKEY_HIGH_PASS 

Tukey-windowed high-pass response.

Function Documentation

◆ sim_add_sieve_operator()

SimResult sim_add_sieve_operator ( struct SimContext context,
const SimSieveOperatorConfig config,
size_t *  out_index 
)

Register a sieve filtering operator with the provided configuration.

Parameters
contextSimulation context that will own the operator.
configOptional sieve configuration; NULL selects normalized defaults.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, kernel construction, field compatibility checks, allocation, or registration.

◆ sim_sieve_config()

SimResult sim_sieve_config ( struct SimContext context,
size_t  operator_index,
SimSieveOperatorConfig out_config 
)

Retrieve the configuration currently bound to a sieve operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_sieve_operator().
[out]out_configReceives the normalized configuration.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL pointers, SIM_RESULT_NOT_FOUND for a missing operator, or SIM_RESULT_INVALID_STATE when the operator has no sieve state.

◆ sim_sieve_update()

SimResult sim_sieve_update ( struct SimContext context,
size_t  operator_index,
const SimSieveOperatorConfig config 
)

Update an existing sieve operator in-place.

Passing NULL for config keeps the current configuration and reapplies normalization. A successful update rebuilds the filter kernel and invalidates the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the sieve operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code from lookup, kernel construction, field compatibility checks, or state validation.