Performs the mathematical operation specified by m_operation on the input data. Supports both in-place and out-of-place transformations based on transformer settings.
79 {
82 auto gain_factor = get_parameter_or<double>("gain_factor", 1.0);
85 }
87 }
88
90 auto offset_value = get_parameter_or<double>("offset_value", 0.0);
93 }
95 }
96
98 auto exponent = get_parameter_or<double>("exponent", 2.0);
99
102 }
104 }
105
107 auto scale = get_parameter_or<double>("scale", 1.0);
108 auto input_scale = get_parameter_or<double>("input_scale", 1.0);
109 auto offset = get_parameter_or<double>("offset", 1.0);
110 auto base = get_parameter_or<double>("base", std::numbers::e);
111
114 }
116 }
117
119 auto scale = get_parameter_or<double>("scale", 1.0);
120 auto rate = get_parameter_or<double>("rate", 1.0);
121 auto base = get_parameter_or<double>("base", std::numbers::e);
122
125 }
127 }
128
130 auto trig_function = get_parameter_or<std::string>("trig_function", "sin");
131 auto frequency = get_parameter_or<double>("frequency", 1.0);
132 auto amplitude = get_parameter_or<double>("amplitude", 1.0);
133 auto phase = get_parameter_or<double>("phase", 0.0);
134
135 if (trig_function == "sin") {
138 }
140 }
141 if (trig_function == "cos") {
144 }
146 }
147 if (trig_function == "tan") {
150 }
152 }
154 }
155
157 auto bits = get_parameter_or<uint8_t>("bits", 16);
160 }
162 }
163
165 auto target_peak = get_parameter_or<double>("target_peak", 1.0);
166 std::pair<double, double> target_range = { -target_peak, target_peak };
169 }
171 }
172
174 auto coefficients = get_parameter_or<std::vector<double>>(
"coefficients", std::vector<double> { 0.0, 1.0 });
177 }
179 }
180
181 default:
183 }
184 }
DataType transform_polynomial(DataType &input, const std::vector< double > &coefficients)
Polynomial transformation using existing Generator::Polynomial (IN-PLACE)
DataType transform_linear(DataType &input, double a, double b)
Linear transformation y = ax + b using C++20 ranges (IN-PLACE)
@ GAIN
Linear gain/attenuation.
@ NORMALIZE
Normalization.
@ QUANTIZE
Quantization/bit reduction.
@ TRIGONOMETRIC
Trigonometric functions.
@ LOGARITHMIC
Logarithmic transform.
@ EXPONENTIAL
Exponential transform.
@ POLYNOMIAL
Polynomial transform.
DataType transform_logarithmic(DataType &input, double a, double b, double c=1.0, double base=std::numbers::e)
Logarithmic transformation y = a * log_base(b * x + c) (IN-PLACE)
DataType transform_normalize(DataType &input, const std::pair< double, double > &target_range={ -1.0, 1.0 })
Normalize transformation using existing infrastructure (IN-PLACE)
DataType transform_exponential(DataType &input, double a, double b, double base=std::numbers::e)
Exponential transformation y = a * base^(b * x) (IN-PLACE)
DataType transform_power(DataType &input, double exponent)
Power transformation y = x^exponent (IN-PLACE)
DataType transform_quantize(DataType &input, uint8_t bits)
Quantization transformation (bit reduction) using C++20 features (IN-PLACE)
DataType transform_trigonometric(DataType &input, TrigFunc trig_func, double frequency=1.0, double amplitude=1.0, double phase=0.0)
Trigonometric transformation using specified function (IN-PLACE)