/* MCL Copyright (c) 2012-18, Enzo De Sena All rights reserved. Authors: Enzo De Sena, enzodesena@gmail.com */ #ifndef MCL_TRANSFORMOP_H #define MCL_TRANSFORMOP_H #include "mcltypes.h" #include namespace mcl { /** Performs the fft of the input signal. Equivalent to Matlab's fft(input, n_point) */ std::vector Fft(const std::vector& input, Int n_point) noexcept; /** Performs the fft of the real input signal. Equivalent to Voice Box's rfft(input, n_point) */ std::vector Rfft(const std::vector& input, Int n_point) noexcept; /** Performs the fft of real vectors. Equivalent to Voice Box's rfft(input, n_point) */ std::vector > Rfft(const std::vector >& input, Int n_point) noexcept; /** Performs the inverse fft of conjugate symmetric spectrum. Equivalent to Voice Box's rfft(input, n_point) */ std::vector Irfft(const std::vector& input, Int n_point) noexcept; /** Performs the inverse fft of conjugate symmetric spectra. Equivalent to Voice Box's rfft(input, n_point) */ std::vector > Irfft(const std::vector >& input, Int n_point) noexcept; /** Performs the ifft of the input signal. Equivalent to Matlab's ifft(input, n_point) */ std::vector Ifft(const std::vector& input, Int n_point) noexcept; /** Performs the equivalent of Matlab's Hilbert (i.e. computes the so-called discrete-time analytic signal). */ std::vector Hilbert(const std::vector& input) noexcept; /** Returns the real cepstrum of the real sequence X. Equivalent to Matlab's rceps(vector) */ std::vector RCeps(const std::vector& vector) noexcept; /** Returns the (unique) minimum-phase sequence that has the same real cepstrum as vector. Equivalent to Matlab's [~, out] = rceps(vector). */ std::vector MinPhase(const std::vector& vector) noexcept; /** Equivalent to Matlab's xcorr(vect_a, vect_b) */ std::vector XCorr(const std::vector& vector_a, const std::vector& vector_b); // The method XCorr naturally is placed in vectorop, but since it depends // on the Fft method, I place it here, so someone who doesn't want to // compile with KissFFT won't get compilation errors. bool TransformOpTest(); } /**< namespace mcl */ #endif