MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MathematicalHelper.hpp File Reference
+ Include dependency graph for MathematicalHelper.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MayaFlux
 Main namespace for the Maya Flux audio engine.
 
namespace  MayaFlux::Yantra
 

Functions

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_linear (DataType &input, double a, double b)
 Linear transformation y = ax + b using C++20 ranges (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_linear (DataType &input, double a, double b, std::vector< std::vector< double > > &working_buffer)
 Linear transformation y = ax + b using C++20 ranges (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_power (DataType &input, double exponent)
 Power transformation y = x^exponent (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_power (DataType &input, double exponent, std::vector< std::vector< double > > &working_buffer)
 Power transformation y = x^exponent (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_polynomial (DataType &input, const std::vector< double > &coefficients)
 Polynomial transformation using existing Generator::Polynomial (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_polynomial (DataType &input, const std::vector< double > &coefficients, std::vector< std::vector< double > > &working_buffer)
 Polynomial transformation using existing Generator::Polynomial (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_exponential (DataType &input, double a, double b, double base=std::numbers::e)
 Exponential transformation y = a * base^(b * x) (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_exponential (DataType &input, double a, double b, std::vector< std::vector< double > > &working_buffer, double base=std::numbers::e)
 Exponential transformation y = a * base^(b * x) (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::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)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_logarithmic (DataType &input, double a, double b, double c, std::vector< std::vector< double > > &working_buffer, double base=std::numbers::e)
 Logarithmic transformation y = a * log_base(b * x + c) (OUT-OF-PLACE)
 
template<OperationReadyData DataType, typename TrigFunc >
requires std::invocable<TrigFunc, double>
DataType MayaFlux::Yantra::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)
 
template<OperationReadyData DataType, typename TrigFunc >
requires std::invocable<TrigFunc, double>
DataType MayaFlux::Yantra::transform_trigonometric (DataType &input, TrigFunc trig_func, double frequency, double amplitude, double phase, std::vector< std::vector< double > > &working_buffer)
 Trigonometric transformation using specified function (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_quantize (DataType &input, uint8_t bits)
 Quantization transformation (bit reduction) using C++20 features (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_quantize (DataType &input, uint8_t bits, std::vector< std::vector< double > > &working_buffer)
 Quantization transformation (bit reduction) using C++20 features (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_clamp (DataType &input, double min_val, double max_val)
 Clamp transformation using C++20 ranges (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_clamp (DataType &input, double min_val, double max_val, std::vector< std::vector< double > > &working_buffer)
 Clamp transformation using C++20 ranges (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_wrap (DataType &input, double wrap_range)
 Wrap transformation (modulo operation) using C++20 ranges (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_wrap (DataType &input, double wrap_range, std::vector< std::vector< double > > &working_buffer)
 Wrap transformation (modulo operation) using C++20 ranges (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_normalize (DataType &input, const std::pair< double, double > &target_range={ -1.0, 1.0 })
 Normalize transformation using existing infrastructure (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_normalize (DataType &input, const std::pair< double, double > &target_range, std::vector< std::vector< double > > &working_buffer)
 Normalize transformation using existing infrastructure (OUT-OF-PLACE)
 
void MayaFlux::Yantra::interpolate (std::span< double > input, std::vector< double > &output, uint32_t target_size)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::interpolate_linear (DataType &input, size_t target_size)
 Linear interpolation between data points using C++20 ranges (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::interpolate_linear (DataType &input, size_t target_size, std::vector< std::vector< double > > &working_buffer)
 Linear interpolation between data points using C++20 ranges (OUT-OF-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::interpolate_cubic (DataType &input, size_t target_size)
 Cubic interpolation between data points using C++20 ranges (IN-PLACE)
 
template<OperationReadyData DataType>
DataType MayaFlux::Yantra::interpolate_cubic (DataType &input, size_t target_size, std::vector< std::vector< double > > &working_buffer)
 Cubic interpolation between data points using C++20 ranges (OUT-OF-PLACE)