/*
- Copyright (C) 2003-2014 Paul Brossier <piem@aubio.org>
+ Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org>
This file is part of aubio.
uint_t fvec_max_elem (fvec_t * s);
/** swap the left and right halves of a vector
-
+
This function swaps the left part of the signal with the right part of the
signal. Therefore
\f$ a[0], a[1], ..., a[\frac{N}{2}], a[\frac{N}{2}+1], ..., a[N-1], a[N] \f$
-
+
becomes
-
+
\f$ a[\frac{N}{2}+1], ..., a[N-1], a[N], a[0], a[1], ..., a[\frac{N}{2}] \f$
This operation, known as 'fftshift' in the Matlab Signal Processing Toolbox,
can be used before computing the FFT to simplify the phase relationship of the
resulting spectrum. See Amalia de Götzen's paper referred to above.
-
+
*/
void fvec_shift (fvec_t * v);
/** compute the High Frequency Content of a vector
The High Frequency Content is defined as \f$ \sum_0^{N-1} (k+1) v[k] \f$.
-
- \param v vector to get the energy from
+
+ \param v vector to get the energy from
\return the HFC of v
-
+
*/
smpl_t fvec_local_hfc (fvec_t * v);
-/** computes the p-norm of a vector
-
+/** computes the p-norm of a vector
+
Computes the p-norm of a vector for \f$ p = \alpha \f$
\f$ L^p = ||x||_p = (|x_1|^p + |x_2|^p + ... + |x_n|^p ) ^ \frac{1}{p} \f$
-
+
If p = 1, the result is the Manhattan distance.
If p = 2, the result is the Euclidean distance.
input vector.
References:
-
+
- <a href="http://en.wikipedia.org/wiki/Lp_space">\f$L^p\f$ space</a> on
Wikipedia
\param p order of the computed norm
\return the p-norm of v
-
+
*/
smpl_t fvec_alpha_norm (fvec_t * v, smpl_t p);
/** alpha normalisation
- This function divides all elements of a vector by the p-norm as computed by
+ This function divides all elements of a vector by the p-norm as computed by
fvec_alpha_norm().
\param v vector to compute norm from
void fvec_add (fvec_t * v, smpl_t c);
/** remove the minimum value of the vector to each elements
-
+
\param v vector to remove minimum from
*/
This function computes the moving median threshold value of at the given
position of a vector, taking the median among post elements before and up to
pre elements after pos.
-
+
\param v input vector
\param tmp temporary vector of length post+1+pre
- \param post length of causal part to take before pos
+ \param post length of causal part to take before pos
\param pre length of anti-causal part to take after pos
- \param pos index to compute threshold for
+ \param pos index to compute threshold for
- \return moving median threshold value
+ \return moving median threshold value
*/
smpl_t fvec_moving_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre,
\param v input vector
\param tmp temporary vector of length post+1+pre
- \param post length of causal part to take before pos
+ \param post length of causal part to take before pos
\param pre length of anti-causal part to take after pos
*/
void fvec_adapt_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre);
-/** returns the median of a vector
+/** returns the median of a vector
The QuickSelect routine is based on the algorithm described in "Numerical
recipes in C", Second Edition, Cambridge University Press, 1992, Section 8.5,
\param v vector to get median from
\return the median of v
-
+
*/
smpl_t fvec_median (fvec_t * v);
smpl_t fvec_quadratic_peak_mag (fvec_t * x, smpl_t p);
/** Quadratic interpolation using Lagrange polynomial.
-
+
Inspired from ``Comparison of interpolation algorithms in real-time sound
-processing'', Vladimir Arnost,
-
- \param s0,s1,s2 are 3 consecutive samples of a curve
+processing'', Vladimir Arnost,
+
+ \param s0,s1,s2 are 3 consecutive samples of a curve
\param pf is the floating point index [0;2]
-
+
\return \f$ s0 + (pf/2.)*((pf-3.)*s0-2.*(pf-2.)*s1+(pf-1.)*s2); \f$
*/