MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ apply_trig()

template<typename TrigFunc >
requires std::invocable<TrigFunc, double> && std::same_as<std::invoke_result_t<TrigFunc, double>, double>
void MayaFlux::Kinesis::Discrete::apply_trig ( std::span< double >  data,
TrigFunc  func,
double  frequency,
double  amplitude,
double  phase 
)
noexcept

Trigonometric map y = amplitude * f(frequency*x + phase) applied in-place.

Template Parameters
TrigFuncCallable matching double(double)
Parameters
dataTarget span
funcTrigonometric function (std::sin, std::cos, etc.)
frequencyFrequency scaling applied to x
amplitudeAmplitude scaling applied to output
phasePhase offset added to x before the function

Definition at line 81 of file Transform.hpp.

86{
87 std::ranges::transform(data, data.begin(),
88 [&](double x) { return amplitude * func(frequency * x + phase); });
89}