FilterSpecification
FilterSpecification
Complete specification for creating a filter. More…
#include <analog_filter.hpp>
Public Functions
| Name | |
|---|---|
| std::vector< std::string > | validate() const Validate the filter specification. |
| bool | isValid() const Check if the specification is valid. |
| std::unique_ptr< IFilter > | createFilter() const Create a filter from this specification. |
| nlohmann::json | toJson() const Convert specification to JSON. |
| std::string | getName() const Get a descriptive name for this filter configuration. |
| FilterSpecification | fromJson(nlohmann::json const & json) Create specification from JSON. |
Public Attributes
| Name | |
|---|---|
| FilterFamily | family |
| FilterResponse | response |
| int | order |
| double | cutoff_hz |
| double | cutoff_low_hz |
| double | cutoff_high_hz |
| double | sampling_rate_hz |
| bool | zero_phase |
| double | ripple_db |
| double | q_factor |
Detailed Description
struct FilterSpecification;Complete specification for creating a filter.
This structure stores all parameters needed to create a filter and can be serialized to/from JSON for pipeline configuration.
Public Functions Documentation
function validate
std::vector< std::string > validate() constValidate the filter specification.
Return: std::vector
function isValid
inline bool isValid() constCheck if the specification is valid.
Return: true if valid, false otherwise
function createFilter
std::unique_ptr< IFilter > createFilter() constCreate a filter from this specification.
Exceptions:
- std::invalid_argument if specification is invalid
Return: std::unique_ptr
function toJson
nlohmann::json toJson() constConvert specification to JSON.
Return: nlohmann::json JSON representation
function getName
std::string getName() constGet a descriptive name for this filter configuration.
Return: std::string Human-readable filter description
function fromJson
static FilterSpecification fromJson(
nlohmann::json const & json
)Create specification from JSON.
Parameters:
- json JSON object
Exceptions:
- std::invalid_argument if JSON is malformed
Return: FilterSpecification Created specification
Public Attributes Documentation
variable family
FilterFamily family = FilterFamily::Butterworth;variable response
FilterResponse response = FilterResponse::Lowpass;variable order
int order = 4;variable cutoff_hz
double cutoff_hz = 10.0;variable cutoff_low_hz
double cutoff_low_hz = 5.0;variable cutoff_high_hz
double cutoff_high_hz = 15.0;variable sampling_rate_hz
double sampling_rate_hz = 1000.0;variable zero_phase
bool zero_phase = false;variable ripple_db
double ripple_db = 0.5;variable q_factor
double q_factor = 10.0;Updated on 2026-11-13 at 20:25:39 +0000