#ifndef MENGA_DSP_COMMON #define MENGA_DSP_COMMON #include typedef std::complex Complex; namespace Mengu { // returns a Complex number with the same norm as x but with the angle phase template std::complex with_phase(const std::complex &x, T phase); // A complex number with the same phase as x, but with distance from the origin amp template std::complex with_amp(const std::complex &x, T amp) { return x / std::sqrt(std::norm(x)) * amp; } } #endif