Changes in src/mathutils.h [7380327:0683ee2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.h
r7380327 r0683ee2 1 1 /* 2 Copyright (C) 2003-201 4Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 83 83 84 84 /** swap the left and right halves of a vector 85 85 86 86 This function swaps the left part of the signal with the right part of the 87 87 signal. Therefore 88 88 89 89 \f$ a[0], a[1], ..., a[\frac{N}{2}], a[\frac{N}{2}+1], ..., a[N-1], a[N] \f$ 90 90 91 91 becomes 92 92 93 93 \f$ a[\frac{N}{2}+1], ..., a[N-1], a[N], a[0], a[1], ..., a[\frac{N}{2}] \f$ 94 94 … … 96 96 can be used before computing the FFT to simplify the phase relationship of the 97 97 resulting spectrum. See Amalia de Götzen's paper referred to above. 98 98 99 99 */ 100 100 void fvec_shift (fvec_t * v); … … 112 112 113 113 The High Frequency Content is defined as \f$ \sum_0^{N-1} (k+1) v[k] \f$. 114 115 \param v vector to get the energy from 114 115 \param v vector to get the energy from 116 116 117 117 \return the HFC of v 118 118 119 119 */ 120 120 smpl_t fvec_local_hfc (fvec_t * v); 121 121 122 /** computes the p-norm of a vector 123 122 /** computes the p-norm of a vector 123 124 124 Computes the p-norm of a vector for \f$ p = \alpha \f$ 125 125 126 126 \f$ L^p = ||x||_p = (|x_1|^p + |x_2|^p + ... + |x_n|^p ) ^ \frac{1}{p} \f$ 127 127 128 128 If p = 1, the result is the Manhattan distance. 129 129 … … 134 134 135 135 References: 136 136 137 137 - <a href="http://en.wikipedia.org/wiki/Lp_space">\f$L^p\f$ space</a> on 138 138 Wikipedia … … 142 142 143 143 \return the p-norm of v 144 144 145 145 */ 146 146 smpl_t fvec_alpha_norm (fvec_t * v, smpl_t p); … … 148 148 /** alpha normalisation 149 149 150 This function divides all elements of a vector by the p-norm as computed by 150 This function divides all elements of a vector by the p-norm as computed by 151 151 fvec_alpha_norm(). 152 152 … … 166 166 167 167 /** remove the minimum value of the vector to each elements 168 168 169 169 \param v vector to remove minimum from 170 170 … … 177 177 position of a vector, taking the median among post elements before and up to 178 178 pre elements after pos. 179 179 180 180 \param v input vector 181 181 \param tmp temporary vector of length post+1+pre 182 \param post length of causal part to take before pos 182 \param post length of causal part to take before pos 183 183 \param pre length of anti-causal part to take after pos 184 \param pos index to compute threshold for 185 186 \return moving median threshold value 184 \param pos index to compute threshold for 185 186 \return moving median threshold value 187 187 188 188 */ … … 197 197 \param v input vector 198 198 \param tmp temporary vector of length post+1+pre 199 \param post length of causal part to take before pos 199 \param post length of causal part to take before pos 200 200 \param pre length of anti-causal part to take after pos 201 201 … … 203 203 void fvec_adapt_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre); 204 204 205 /** returns the median of a vector 205 /** returns the median of a vector 206 206 207 207 The QuickSelect routine is based on the algorithm described in "Numerical … … 216 216 217 217 \return the median of v 218 218 219 219 */ 220 220 smpl_t fvec_median (fvec_t * v); … … 249 249 250 250 /** Quadratic interpolation using Lagrange polynomial. 251 251 252 252 Inspired from ``Comparison of interpolation algorithms in real-time sound 253 processing'', Vladimir Arnost, 254 255 \param s0,s1,s2 are 3 consecutive samples of a curve 253 processing'', Vladimir Arnost, 254 255 \param s0,s1,s2 are 3 consecutive samples of a curve 256 256 \param pf is the floating point index [0;2] 257 257 258 258 \return \f$ s0 + (pf/2.)*((pf-3.)*s0-2.*(pf-2.)*s1+(pf-1.)*s2); \f$ 259 259
Note: See TracChangeset
for help on using the changeset viewer.