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

◆ transform_spectral_invert() [1/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_spectral_invert ( DataType &  input,
uint32_t  window_size,
uint32_t  hop_size,
std::vector< std::vector< double > > &  working_buffer 
)

Spectral inversion (phase inversion in frequency domain) using C++20 ranges (OUT-OF-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - will NOT be modified
window_sizeFFT window size
hop_sizeHop size for overlap-add
working_bufferBuffer for operations (will be resized if needed)
Returns
Spectrally inverted data

Definition at line 397 of file SpectralHelper.hpp.

401{
402 auto [target_data, structure_info] = OperationHelper::setup_operation_buffer(input, working_buffer);
403
404 auto processor = [](Eigen::VectorXcd& spectrum, size_t) {
405 std::ranges::transform(spectrum, spectrum.begin(),
406 [](const std::complex<double>& bin) { return std::conj(bin); });
407 };
408
409 working_buffer.resize(target_data.size());
410 for (size_t i = 0; i < target_data.size(); ++i) {
411 working_buffer[i] = process_spectral_windows(target_data[i], window_size, hop_size, processor);
412 }
413
414 return OperationHelper::reconstruct_from_double<DataType>(working_buffer, structure_info);
415}

References process_spectral_windows(), and MayaFlux::Yantra::OperationHelper::setup_operation_buffer().

+ Here is the call graph for this function: