Go to the source code of this file.
|
#define | M_PI 3.14159265358979323846 |
|
|
float | sinc (float x) |
|
float | cosc (float x) |
|
float | clamp (float x, float min, float max) |
|
float | decayavg (float average, float input, int weight) |
| This is always called with an int weight. More...
|
|
float | blackman (float x) |
|
float | hamming (float x) |
|
float | hanning (float x) |
|
float | rcos (float t, float T, float alpha=1.0) |
|
◆ M_PI
#define M_PI 3.14159265358979323846 |
◆ blackman()
float blackman |
( |
float |
x | ) |
|
|
inline |
Definition at line 55 of file misc.h.
References cos(), and M_PI.
57 return (0.42 - 0.50 *
cos(2 *
M_PI * x) + 0.08 *
cos(4 *
M_PI * x));
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
◆ clamp()
float clamp |
( |
float |
x, |
|
|
float |
min, |
|
|
float |
max |
|
) |
| |
|
inline |
◆ cosc()
Definition at line 37 of file misc.h.
References cos(), and M_PI.
39 return (fabs(x) < 1e-10) ? 0.0 : ((1.0 -
cos(
M_PI * x)) / (
M_PI * x));
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
◆ decayavg()
float decayavg |
( |
float |
average, |
|
|
float |
input, |
|
|
int |
weight |
|
) |
| |
|
inline |
This is always called with an int weight.
Definition at line 48 of file misc.h.
50 if (weight <= 1)
return input;
51 return ( ( input - average ) / (
float)weight ) + average ;
◆ hamming()
Definition at line 60 of file misc.h.
References cos(), and M_PI.
62 return 0.54 - 0.46 *
cos(2 *
M_PI * x);
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
◆ hanning()
Definition at line 65 of file misc.h.
References cos(), and M_PI.
67 return 0.5 - 0.5 *
cos(2 *
M_PI * x);
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
◆ rcos()
float rcos |
( |
float |
t, |
|
|
float |
T, |
|
|
float |
alpha = 1.0 |
|
) |
| |
|
inline |
Definition at line 70 of file misc.h.
References cos(), M_PI, and sin().
72 if( t == 0 )
return 1.0;
73 float taT = T / (2.0 * alpha);
74 if( fabs(t) == taT )
return ((alpha/2.0) *
sin(
M_PI/(2.0*alpha)));
Fixed< IntType, IntBits > cos(Fixed< IntType, IntBits > const &x)
Fixed< IntType, IntBits > sin(Fixed< IntType, IntBits > const &x)
◆ sinc()