│ │ │ │ -
#include "mathtools.h"
│ │ │ │ +
#include <stddef.h>
│ │ │ │ +#include <math.h>
│ │ │ │ +#include <limits.h>
│ │ │ │ +#include <float.h>
│ │ │ │ +#include <stdbool.h>
│ │ │ │ +#include <stdint.h>
│ │ │ │
│ │ │ │
Go to the source code of this file.
│ │ │ │
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_E 2.71828182845904523536028747135 |
│ │ │ │ + | e (natural logarithm base
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_LOG2_E 1.44269504088896340735992468100 |
│ │ │ │ + | log_2 (e)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_LOG10_E 0.43429448190325182765112891892 |
│ │ │ │ + | log_10 (e)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_SQRT_2 1.41421356237309504880168872421 |
│ │ │ │ + | sqrt(2)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_SQRT_HALF 0.70710678118654752440084436210 |
│ │ │ │ + | sqrt(1/2)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_SQRT_3 1.73205080756887729352744634151 |
│ │ │ │ + | sqrt(3)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI 3.14159265358979323846264338328 |
│ │ │ │ + | pi (180 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_TAU 6.28318530717958647692528676656 |
│ │ │ │ + | tau (2 * pi)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_2 1.57079632679489661923132169164 |
│ │ │ │ + | pi/2 (90 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_3 1.04719755119659774615421446109 |
│ │ │ │ + | pi/3 (60 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_4 0.78539816339744830961566084582 |
│ │ │ │ + | pi/4 (45 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_6 0.52359877559829887307710723055 |
│ │ │ │ + | pi/6 (30 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_9 0.34906585039886591538473815370 |
│ │ │ │ + | pi/9 (20 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_12 0.26179938779914943653855361527 |
│ │ │ │ + | pi / 12 (15 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_18 0.17453292519943295769236907685 |
│ │ │ │ + | pi / 18 (10 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_PI_DIV_36 0.08726646259971647884618453842 |
│ │ │ │ + | pi / 36 (5 deg)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_DEG_PER_RAD 57.2957795130823208767981548141 |
│ │ │ │ + | degrees per radian
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_RAD_PER_DEG 0.01745329251994329576923690768 |
│ │ │ │ + | radians per degree
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_SQRT_PI 1.77245385090551602729816748334 |
│ │ │ │ + | sqrt(pi)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_TWO_DIV_SQRT_PI 1.12837916709551257389615890312 |
│ │ │ │ + | 2/sqrt(pi)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_ONE_DIV_PI 0.31830988618379067153776752675 |
│ │ │ │ + | 1/pi
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_TWO_DIV_PI 0.63661977236758134307553505349 |
│ │ │ │ + | 2/pi
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_LN_10 2.30258509299404568401799145468 |
│ │ │ │ + | ln(10)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_LN_2 0.69314718055994530941723212146 |
│ │ │ │ + | ln(2)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_LOG_2 0.30102999566398119521373889472 |
│ │ │ │ + | log(2)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_LN_PI 1.14472988584940017414342735135 |
│ │ │ │ + | ln(pi)
|
│ │ │ │ + |
│ │ │ │ +#define | BRAHE_EULER 0.57721566490153286060651209008 |
│ │ │ │ + | Euler constant.
|
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ |
│ │ │ │ -bool | brahe_prng_init (brahe_prng_state_t *prng_state, const brahe_prng_type_t type, const uint32_t seed) |
│ │ │ │ - | Initialize a psuedo-random number generator (PRNG)
|
│ │ │ │ - |
│ │ │ │ -void | brahe_prng_free (brahe_prng_state_t *prng_state) |
│ │ │ │ - | Free resources used by PRNG.
|
│ │ │ │ - |
│ │ │ │ -uint32_t | brahe_prng_next (brahe_prng_state_t *prng_state) |
│ │ │ │ - | Get the next integer.
|
│ │ │ │ - |
│ │ │ │ -uint32_t | brahe_prng_range (brahe_prng_state_t *prng_state, const uint32_t lo, const uint32_t hi) |
│ │ │ │ - | Get the next integer in the range [lo,hi].
|
│ │ │ │ - |
│ │ │ │ -size_t | brahe_prng_index (brahe_prng_state_t *prng_state, const size_t length) |
│ │ │ │ - | Get the next random value as a size_t index.
|
│ │ │ │ - |
│ │ │ │ -double | brahe_prng_real1 (brahe_prng_state_t *prng_state) |
│ │ │ │ - | Get the next number in the range [0,1].
|
│ │ │ │ - |
│ │ │ │ -double | brahe_prng_real2 (brahe_prng_state_t *prng_state) |
│ │ │ │ - | Get the next number in the range [0,1)
|
│ │ │ │ - |
│ │ │ │ -double | brahe_prng_real3 (brahe_prng_state_t *prng_state) |
│ │ │ │ - | Get the next number in the range (0,1)
|
│ │ │ │ - |
│ │ │ │ -double | brahe_prng_real53 (brahe_prng_state_t *prng_state) |
│ │ │ │ - | Get the next number in the range [0,1)
|
│ │ │ │ - |
│ │ │ │ -
│ │ │ │ - |
│ │ │ │ -static uint32_t | BRAHE_UNKNOWN_SEED = 0 |
│ │ │ │ - |
│ │ │ │ +double | brahe_round_nearest (const double x) |
│ │ │ │ + | Round to nearest value.
|
│ │ │ │ + |
│ │ │ │ +double | brahe_sigdig (const double x, const uint16_t n) |
│ │ │ │ + | Set number of significant digits in a floating-point value.
|
│ │ │ │ + |
│ │ │ │ +uint64_t | brahe_lcm (const uint64_t x, const uint64_t y) |
│ │ │ │ + | Lowest common multiple.
|
│ │ │ │ + |
│ │ │ │ +uint64_t | brahe_gcf (uint64_t x, uint64_t y) |
│ │ │ │ + | Greatest common factor (denominator)
|
│ │ │ │ + |
│ │ │ │ +double | brahe_log2base (const double x, const double base) |
│ │ │ │ + | Logarithm to a specified base.
|
│ │ │ │ + |
│ │ │ │ +int | brahe_sizepow2 (const int n) |
│ │ │ │ + | Smallest power of 2 that includes a given value.
|
│ │ │ │ + |
│ │ │ │ +char * | brahe_pretty_int (int64_t n, brahe_pretty_format fmt) |
│ │ │ │ + | Turn a 64-bit integer into a pretty string.
|
│ │ │ │ + |
│ │ │ │ +brahe_statistics | brahe_get_statistics (double *data, size_t n) |
│ │ │ │ + | statistics for array of double
|
│ │ │ │ + |
│ │ │ │ +double * | brahe_moving_average (const double *data, const int n, const int distance) |
│ │ │ │ + | Moving average.
|
│ │ │ │ + |
│ │ │ │ +double * | brahe_simple_fft (const double *data, const int n) |
│ │ │ │ + | Simple real-to-real fft (arbitrary length)
|
│ │ │ │ + |
│ │ │ │ +double * | brahe_simple_fft2 (const double *data, const int n) |
│ │ │ │ + | Simple real-to-real fft (power of 2 length)
|
│ │ │ │ + |
│ │ │ │ +double * | brahe_make_sinusoid (const brahe_wave_factor_t *factors, const size_t factor_n, const size_t array_n) |
│ │ │ │ + | Sine wave based artificial signal generator.
|
│ │ │ │ + |
│ │ │ │ +void | brahe_add_noise (double *a, const size_t n, double noise) |
│ │ │ │ + | Apply noise to a signal.
|
│ │ │ │ + |
│ │ │ │ +double | brahe_asinh (const double x) |
│ │ │ │ + | Hyperbolic arcsine.
|
│ │ │ │ + |
│ │ │ │ +double | brahe_acosh (const double x) |
│ │ │ │ + | Hyperbolic arccosine.
|
│ │ │ │ + |
│ │ │ │ +double | brahe_atanh (const double x) |
│ │ │ │ + | Hyperbolic arctangent.
|
│ │ │ │ + |
│ │ │ │
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_DEG_PER_RAD
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_DEG_PER_RAD 57.2957795130823208767981548141 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_E
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_E 2.71828182845904523536028747135 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_EULER
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_EULER 0.57721566490153286060651209008 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_LN_10
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_LN_10 2.30258509299404568401799145468 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_LN_2
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_LN_2 0.69314718055994530941723212146 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_LN_PI
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_LN_PI 1.14472988584940017414342735135 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_LOG10_E
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_LOG10_E 0.43429448190325182765112891892 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_LOG2_E
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_LOG2_E 1.44269504088896340735992468100 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_LOG_2
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_LOG_2 0.30102999566398119521373889472 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_ONE_DIV_PI
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_ONE_DIV_PI 0.31830988618379067153776752675 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI 3.14159265358979323846264338328 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_12
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_12 0.26179938779914943653855361527 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_18
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_18 0.17453292519943295769236907685 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_2
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_2 1.57079632679489661923132169164 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_3
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_3 1.04719755119659774615421446109 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_36
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_36 0.08726646259971647884618453842 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_4
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_4 0.78539816339744830961566084582 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_6
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_6 0.52359877559829887307710723055 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_PI_DIV_9
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_PI_DIV_9 0.34906585039886591538473815370 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_RAD_PER_DEG
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_RAD_PER_DEG 0.01745329251994329576923690768 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_SQRT_2
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_SQRT_2 1.41421356237309504880168872421 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_SQRT_3
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_SQRT_3 1.73205080756887729352744634151 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_SQRT_HALF
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_SQRT_HALF 0.70710678118654752440084436210 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_SQRT_PI
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_SQRT_PI 1.77245385090551602729816748334 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_TAU
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_TAU 6.28318530717958647692528676656 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_TWO_DIV_PI
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_TWO_DIV_PI 0.63661977236758134307553505349 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ BRAHE_TWO_DIV_SQRT_PI
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + #define BRAHE_TWO_DIV_SQRT_PI 1.12837916709551257389615890312 |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_pretty_format
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_statistics
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_type_t
│ │ │ │ +
│ │ │ │ +
◆ brahe_pretty_format_t
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -Enumerator |
---|
BRAHE_PRNG_MARSENNE_TWISTER | Marsenne Twister (Matsumoto & Nishimura)
│ │ │ │ - |
│ │ │ │ -BRAHE_PRNG_KISS | Keep is Simple, Stupid (Marsaglia)
│ │ │ │ - |
│ │ │ │ -BRAHE_PRNG_CMWC4096 | CMWC4096 (Marsaglia)
│ │ │ │ - |
│ │ │ │ -BRAHE_PRNG_MWC1038 | MWC1038 (Marsaglia)
│ │ │ │ + |
Enumerator |
---|
BRAHE_PRETTY_TEXT | english text (nine thousand, two hundred eleven)
│ │ │ │ |
│ │ │ │ -BRAHE_PRNG_ISAAC | Indirect, Shift, Accumulate, Add, and Count (Jenkins)
│ │ │ │ + |
BRAHE_PRETTY_COMMA | comma delimited, (1,234,567,890)
│ │ │ │ |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_free()
│ │ │ │ +
│ │ │ │ +
◆ brahe_acosh()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - void brahe_prng_free |
│ │ │ │ + double brahe_acosh |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state | ) |
│ │ │ │ + const double |
│ │ │ │ + x | ) |
│ │ │ │ |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Frees the resources used by a PRNG
- Parameters
-
│ │ │ │ +
Calculates cosh-1.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ + x | a value |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- true if successful, false if failed
│ │ │ │ +- Returns
- inverse hyperbolic cosine of x
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_index()
│ │ │ │ +
│ │ │ │ +
◆ brahe_add_noise()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - size_t brahe_prng_index |
│ │ │ │ + void brahe_add_noise |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state, |
│ │ │ │ + double * |
│ │ │ │ + a, |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ |
│ │ │ │ const size_t |
│ │ │ │ - length |
│ │ │ │ + n, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + double |
│ │ │ │ + noise |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ ) |
│ │ │ │ | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next value as a size_t "index" in the range [0,length).
- Parameters
-
│ │ │ │ +
Adds a percentage of noise to a signal. If "noise" is set to 0.1 (for example) each value will be adjust to between 90% and 110% of its original value. This function changes the existing values in the array.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ - length | - Maximum value of result |
│ │ │ │ + a | array containing signal data |
│ │ │ │ + n | number of samples in signal |
│ │ │ │ + noise | percentage of noise |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- A pseudorandom size_t value
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_init()
│ │ │ │ +
│ │ │ │ +
◆ brahe_asinh()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - bool brahe_prng_init |
│ │ │ │ + double brahe_asinh |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state, |
│ │ │ │ + const double |
│ │ │ │ + x | ) |
│ │ │ │ + |
│ │ │ │
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Calculates sinh-1.
- Parameters
-
│ │ │ │ +
│ │ │ │ + x | a value |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
- Returns
- inverse hyperbolic sine of x
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_atanh()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ - |
│ │ │ │ + double brahe_atanh |
│ │ │ │ + ( |
│ │ │ │ + const double |
│ │ │ │ + x | ) |
│ │ │ │ |
│ │ │ │ - const brahe_prng_type_t |
│ │ │ │ - type, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Calculates tanh-1.
- Parameters
-
│ │ │ │ +
│ │ │ │ + x | a value |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
- Returns
- inverse hyperbolic tangent of x
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_gcf()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + uint64_t brahe_gcf |
│ │ │ │ + ( |
│ │ │ │ + uint64_t |
│ │ │ │ + x, |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ |
│ │ │ │ - const uint32_t |
│ │ │ │ - seed |
│ │ │ │ + uint64_t |
│ │ │ │ + y |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ ) |
│ │ │ │ | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Initializes a psuedo-random number generator using a specified algorithm.
- Parameters
-
│ │ │ │ +
Calculates the greatest common factor for two values.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object to be initialized for a specific algorithm |
│ │ │ │ - type | Algorithm to be used for this PRNG |
│ │ │ │ - seed | Initialization seed |
│ │ │ │ + x | first value |
│ │ │ │ + y | second value |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- true if successful, false if failed
│ │ │ │ +- Returns
- The greatest common factor for x and y
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_next()
│ │ │ │ +
│ │ │ │ +
◆ brahe_get_statistics()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - uint32_t brahe_prng_next |
│ │ │ │ + brahe_statistics brahe_get_statistics |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state | ) |
│ │ │ │ + double * |
│ │ │ │ + data, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ |
│ │ │ │ + size_t |
│ │ │ │ + n |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next uint32_t in sequence.
- Parameters
-
│ │ │ │ +
Calculate several common statistics for an array of doubles.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ + data | array of double values |
│ │ │ │ + n | number of elements in data |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- A pseudorandom uint32_t value
│ │ │ │ +- Returns
- statistics for data
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_range()
│ │ │ │ +
│ │ │ │ +
◆ brahe_lcm()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - uint32_t brahe_prng_range |
│ │ │ │ + uint64_t brahe_lcm |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state, |
│ │ │ │ + const uint64_t |
│ │ │ │ + x, |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ |
│ │ │ │ - const uint32_t |
│ │ │ │ - lo, |
│ │ │ │ + const uint64_t |
│ │ │ │ + y |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Calculates the lowest common multiple for two values.
- Parameters
-
│ │ │ │ +
│ │ │ │ + x | first value |
│ │ │ │ + y | second value |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
- Returns
- The lowest common multiple for x and y
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_log2base()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + double brahe_log2base |
│ │ │ │ + ( |
│ │ │ │ + const double |
│ │ │ │ + x, |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ |
│ │ │ │ - const uint32_t |
│ │ │ │ - hi |
│ │ │ │ + const double |
│ │ │ │ + base |
│ │ │ │
│ │ │ │
│ │ │ │ |
│ │ │ │ ) |
│ │ │ │ | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next int_value between lo and hi, inclusive.
- Parameters
-
│ │ │ │ +
Calculates the base-n logarithm for a given value. If a range error occurs, the return value equals NaN.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ - lo | - Minimum value of result |
│ │ │ │ - hi | - Maximum value of result |
│ │ │ │ + x | value for which logarithm is required |
│ │ │ │ + base | lagarithm base |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- A pseudorandom uint32_t value
│ │ │ │ +- Returns
- logarithm of x to base base; NAN on range error
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_real1()
│ │ │ │ +
│ │ │ │ +
◆ brahe_make_sinusoid()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - double brahe_prng_real1 |
│ │ │ │ + double * brahe_make_sinusoid |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state | ) |
│ │ │ │ + const brahe_wave_factor_t * |
│ │ │ │ + factors, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const size_t |
│ │ │ │ + factor_n, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const size_t |
│ │ │ │ + array_n |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next real number in the range [0,1], i.e., a number greater than or equal to 0 and less than or equal to 1. Provides 32-bit precision.
- Parameters
-
│ │ │ │ +
Generates an array of doubles by combining sine waves. The primary purpose is to produce an artificial signal with known properties, for testing signal analysis applications. The caller is responsible for freeing the memory used by the array returned by this function.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ + factors | defines properties of the sine waves to be combined |
│ │ │ │ + factor_n | number of elements in factors |
│ │ │ │ + array_n | number of elements in the output array |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- A pseudorandom double value
│ │ │ │ +- Returns
- an allocated array containg values generated from the given factors
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_real2()
│ │ │ │ +
│ │ │ │ +
◆ brahe_moving_average()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - double brahe_prng_real2 |
│ │ │ │ + double * brahe_moving_average |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state | ) |
│ │ │ │ + const double * |
│ │ │ │ + data, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const int |
│ │ │ │ + n, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const int |
│ │ │ │ + distance |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next real number in the range [0,1), i.e., a number greater than or equal to 0 and less than 1. Provides 32-bit precision.
- Parameters
-
│ │ │ │ +
Computes the moving average for an array. The returned buffer must be freed by the calling code.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ + data | array of double values to be averaged |
│ │ │ │ + n | number of elements in data |
│ │ │ │ + distance | number elements to average before and after an element in data |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- A pseudorandom double value
│ │ │ │ +- Returns
- an allocated n-length array containing the moving average of corresponding elements in data
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_real3()
│ │ │ │ +
│ │ │ │ +
◆ brahe_pretty_int()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - double brahe_prng_real3 |
│ │ │ │ + char * brahe_pretty_int |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state | ) |
│ │ │ │ + int64_t |
│ │ │ │ + n, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + brahe_pretty_format |
│ │ │ │ + fmt |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next real number in the range (0,1), i.e., a number greater than 0 and less than 1. Provides 32-bit precision.
- Parameters
-
│ │ │ │ +
Returns a nicely formatted strong for a given 64-bit integer.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ + n | number to be formatted |
│ │ │ │ + fmt | specifies format, as text or comma-delimited |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -- Returns
- A pseudorandom double value
│ │ │ │ +- Returns
- an allocated string containing the generated text
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
◆ brahe_prng_real53()
│ │ │ │ +
│ │ │ │ +
◆ brahe_round_nearest()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ - double brahe_prng_real53 |
│ │ │ │ + double brahe_round_nearest |
│ │ │ │ ( |
│ │ │ │ - brahe_prng_state_t * |
│ │ │ │ - prng_state | ) |
│ │ │ │ + const double |
│ │ │ │ + x | ) |
│ │ │ │ |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Returns the next real number in the range [0,1), i.e., a number greater than or equal to 0 and less than 1. Provides 53-bit precision.
- Parameters
-
│ │ │ │ +
Rounds a value to nearest integer, rounding to even for exact fractions of 0.5.
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_sigdig()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + double brahe_sigdig |
│ │ │ │ + ( |
│ │ │ │ + const double |
│ │ │ │ + x, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const uint16_t |
│ │ │ │ + n |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Returns the given value rounded for the number of specified decimal digits of precision.
- Parameters
-
│ │ │ │
│ │ │ │ - prng_state | Object containing the state of a PRNG |
│ │ │ │ + x | - Original value to be rounded |
│ │ │ │ + n | - Number of significant digits |
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
- Returns
- A pseudorandom double value
│ │ │ │ +
- Returns
- The value x rounded to n digits of precision
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
◆ BRAHE_UNKNOWN_SEED
│ │ │ │ +
│ │ │ │ +
◆ brahe_simple_fft()
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │
│ │ │ │ - uint32_t BRAHE_UNKNOWN_SEED = 0 |
│ │ │ │ + double * brahe_simple_fft |
│ │ │ │ + ( |
│ │ │ │ + const double * |
│ │ │ │ + data, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const int |
│ │ │ │ + n |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │
│ │ │ │
│ │ │ │ - |
│ │ │ │ -
│ │ │ │ -static |
│ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ +
A simple real-to-real FFT for arbitrary-length data. This is not intended to replace dedicated libraries such as FFTW. The caller is responsible for freeing the memory used by the array returned by this function. /param data input array /param n length of data /return an allocated array containing the real FFT of data
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_simple_fft2()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + double * brahe_simple_fft2 |
│ │ │ │ + ( |
│ │ │ │ + const double * |
│ │ │ │ + data, |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + |
│ │ │ │ + const int |
│ │ │ │ + n |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + |
│ │ │ │ + ) |
│ │ │ │ + | |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
A simple real-to-real FFT for power of 2-length data. This is not intended to replace dedicated libraries such as FFTW. The caller is responsible for freeing the memory used by the array returned by this function. /param data input array /param n length of data /return an allocated array containing the real FFT of data
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
◆ brahe_sizepow2()
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ + int brahe_sizepow2 |
│ │ │ │ + ( |
│ │ │ │ + const int |
│ │ │ │ + n | ) |
│ │ │ │ + |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
Returns the smallest power of 2 that includes n in its range
- Parameters
-
│ │ │ │ +
│ │ │ │ + n | number that must be less than the result |
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
- Returns
- the lowest power of 2 that is greater than n, or
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ © 2011 Scott Robert Ladd. All rights reserved.
│ │ │ │ ├── html2text {}
│ │ │ │ │ @@ -1,153 +1,390 @@
│ │ │ │ │ ************ BBrraahhee -- aa hheetteerrooggeennoouuss ccoolllleeccttiioonn ooff mmaatthheemmaattiiccaall ttoooollss ************
│ │ │ │ │ ********** _MM_aa_ii_nn_ _II_nn_dd_ee_xx
│ │ │ │ │ _HH_oo_mm_ee_ _PP_aa_gg_ee **********
│ │ │ │ │ Created by _S_c_o_t_t_ _R_o_b_e_r_t_ _L_a_d_d
│ │ │ │ │ ===============================================================================
│ │ │ │ │ * _s_r_c
│ │ │ │ │ -_D_a_t_a_ _S_t_r_u_c_t_u_r_e_s | _E_n_u_m_e_r_a_t_i_o_n_s | _F_u_n_c_t_i_o_n_s | _V_a_r_i_a_b_l_e_s
│ │ │ │ │ -prng.h File Reference
│ │ │ │ │ -#include "_m_a_t_h_t_o_o_l_s_._h"
│ │ │ │ │ +_D_a_t_a_ _S_t_r_u_c_t_u_r_e_s | _M_a_c_r_o_s | _T_y_p_e_d_e_f_s | _E_n_u_m_e_r_a_t_i_o_n_s | _F_u_n_c_t_i_o_n_s
│ │ │ │ │ +mathtools.h File Reference
│ │ │ │ │ +#include
│ │ │ │ │ +#include
│ │ │ │ │ +#include
│ │ │ │ │ +#include
│ │ │ │ │ +#include
│ │ │ │ │ +#include
│ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_.
│ │ │ │ │ DDaattaa SSttrruuccttuurreess
│ │ │ │ │ -struct _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t
│ │ │ │ │ - Contains state variables for a PRNG. _M_o_r_e_._._.
│ │ │ │ │ +struct _b_r_a_h_e___s_t_a_t_i_s_t_i_c_s___t
│ │ │ │ │ + Structure containing statistical values calculate from a double array.
│ │ │ │ │ + _M_o_r_e_._._.
│ │ │ │ │
│ │ │ │ │ -EEnnuummeerraattiioonnss
│ │ │ │ │ -enum _b_r_a_h_e___p_r_n_g___t_y_p_e___t {
│ │ │ │ │ - _B_R_A_H_E___P_R_N_G___M_A_R_S_E_N_N_E___T_W_I_S_T_E_R = 0 , _B_R_A_H_E___P_R_N_G___K_I_S_S ,
│ │ │ │ │ - _B_R_A_H_E___P_R_N_G___C_M_W_C_4_0_9_6 , _B_R_A_H_E___P_R_N_G___M_W_C_1_0_3_8 ,
│ │ │ │ │ - _B_R_A_H_E___P_R_N_G___I_S_A_A_C
│ │ │ │ │ - }
│ │ │ │ │ - Defines types of prngs. _M_o_r_e_._._.
│ │ │ │ │ +struct _b_r_a_h_e___w_a_v_e___f_a_c_t_o_r___t
│ │ │ │ │ + Sine wave definition. _M_o_r_e_._._.
│ │ │ │ │
│ │ │ │ │ -FFuunnccttiioonnss
│ │ │ │ │ - bool _b_r_a_h_e___p_r_n_g___i_n_i_t (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state, const
│ │ │ │ │ - _b_r_a_h_e___p_r_n_g___t_y_p_e___t type, const uint32_t seed)
│ │ │ │ │ - Initialize a psuedo-random number generator (PRNG)
│ │ │ │ │ +MMaaccrrooss
│ │ │ │ │ +#define _B_R_A_H_E___E 2.71828182845904523536028747135
│ │ │ │ │ + e (natural logarithm base
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___L_O_G_2___E 1.44269504088896340735992468100
│ │ │ │ │ + log_2 (e)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___L_O_G_1_0___E 0.43429448190325182765112891892
│ │ │ │ │ + log_10 (e)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___S_Q_R_T___2 1.41421356237309504880168872421
│ │ │ │ │ + sqrt(2)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___S_Q_R_T___H_A_L_F 0.70710678118654752440084436210
│ │ │ │ │ + sqrt(1/2)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___S_Q_R_T___3 1.73205080756887729352744634151
│ │ │ │ │ + sqrt(3)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I 3.14159265358979323846264338328
│ │ │ │ │ + pi (180 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___T_A_U 6.28318530717958647692528676656
│ │ │ │ │ + tau (2 * pi)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___2 1.57079632679489661923132169164
│ │ │ │ │ + pi/2 (90 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___3 1.04719755119659774615421446109
│ │ │ │ │ + pi/3 (60 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___4 0.78539816339744830961566084582
│ │ │ │ │ + pi/4 (45 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___6 0.52359877559829887307710723055
│ │ │ │ │ + pi/6 (30 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___9 0.34906585039886591538473815370
│ │ │ │ │ + pi/9 (20 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___1_2 0.26179938779914943653855361527
│ │ │ │ │ + pi / 12 (15 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___1_8 0.17453292519943295769236907685
│ │ │ │ │ + pi / 18 (10 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___P_I___D_I_V___3_6 0.08726646259971647884618453842
│ │ │ │ │ + pi / 36 (5 deg)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___D_E_G___P_E_R___R_A_D 57.2957795130823208767981548141
│ │ │ │ │ + degrees per radian
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___R_A_D___P_E_R___D_E_G 0.01745329251994329576923690768
│ │ │ │ │ + radians per degree
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___S_Q_R_T___P_I 1.77245385090551602729816748334
│ │ │ │ │ + sqrt(pi)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___T_W_O___D_I_V___S_Q_R_T___P_I 1.12837916709551257389615890312
│ │ │ │ │ + 2/sqrt(pi)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___O_N_E___D_I_V___P_I 0.31830988618379067153776752675
│ │ │ │ │ + 1/pi
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___T_W_O___D_I_V___P_I 0.63661977236758134307553505349
│ │ │ │ │ + 2/pi
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___L_N___1_0 2.30258509299404568401799145468
│ │ │ │ │ + ln(10)
│ │ │ │ │ +
│ │ │ │ │ +#define _B_R_A_H_E___L_N___2 0.69314718055994530941723212146
│ │ │ │ │ + ln(2)
│ │ │ │ │
│ │ │ │ │ - void _b_r_a_h_e___p_r_n_g___f_r_e_e (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state)
│ │ │ │ │ - Free resources used by PRNG.
│ │ │ │ │ +#define _B_R_A_H_E___L_O_G___2 0.30102999566398119521373889472
│ │ │ │ │ + log(2)
│ │ │ │ │
│ │ │ │ │ -uint32_t _b_r_a_h_e___p_r_n_g___n_e_x_t (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state)
│ │ │ │ │ - Get the next integer.
│ │ │ │ │ +#define _B_R_A_H_E___L_N___P_I 1.14472988584940017414342735135
│ │ │ │ │ + ln(pi)
│ │ │ │ │
│ │ │ │ │ -uint32_t _b_r_a_h_e___p_r_n_g___r_a_n_g_e (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state, const uint32_t lo,
│ │ │ │ │ - const uint32_t hi)
│ │ │ │ │ - Get the next integer in the range [lo,hi].
│ │ │ │ │ +#define _B_R_A_H_E___E_U_L_E_R 0.57721566490153286060651209008
│ │ │ │ │ + Euler constant.
│ │ │ │ │
│ │ │ │ │ - size_t _b_r_a_h_e___p_r_n_g___i_n_d_e_x (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state, const size_t
│ │ │ │ │ - length)
│ │ │ │ │ - Get the next random value as a size_t index.
│ │ │ │ │ +TTyyppeeddeeffss
│ │ │ │ │ +typedef enum _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t___t _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t
│ │ │ │ │ + Formats for pretty-printing integers.
│ │ │ │ │
│ │ │ │ │ - double _b_r_a_h_e___p_r_n_g___r_e_a_l_1 (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state)
│ │ │ │ │ - Get the next number in the range [0,1].
│ │ │ │ │ + typedef struct _b_r_a_h_e___s_t_a_t_i_s_t_i_c_s___t _b_r_a_h_e___s_t_a_t_i_s_t_i_c_s
│ │ │ │ │ + Structure containing statistical values
│ │ │ │ │ + calculate from a double array.
│ │ │ │ │
│ │ │ │ │ - double _b_r_a_h_e___p_r_n_g___r_e_a_l_2 (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state)
│ │ │ │ │ - Get the next number in the range [0,1)
│ │ │ │ │ +EEnnuummeerraattiioonnss
│ │ │ │ │ +enum _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t___t { _B_R_A_H_E___P_R_E_T_T_Y___T_E_X_T , _B_R_A_H_E___P_R_E_T_T_Y___C_O_M_M_A }
│ │ │ │ │ + Formats for pretty-printing integers. _M_o_r_e_._._.
│ │ │ │ │
│ │ │ │ │ - double _b_r_a_h_e___p_r_n_g___r_e_a_l_3 (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state)
│ │ │ │ │ - Get the next number in the range (0,1)
│ │ │ │ │ +FFuunnccttiioonnss
│ │ │ │ │ + double _b_r_a_h_e___r_o_u_n_d___n_e_a_r_e_s_t (const double x)
│ │ │ │ │ + Round to nearest value.
│ │ │ │ │
│ │ │ │ │ - double _b_r_a_h_e___p_r_n_g___r_e_a_l_5_3 (_b_r_a_h_e___p_r_n_g___s_t_a_t_e___t *prng_state)
│ │ │ │ │ - Get the next number in the range [0,1)
│ │ │ │ │ + double _b_r_a_h_e___s_i_g_d_i_g (const double x, const uint16_t n)
│ │ │ │ │ + Set number of significant digits in a floating-point value.
│ │ │ │ │
│ │ │ │ │ -VVaarriiaabblleess
│ │ │ │ │ -static uint32_t _B_R_A_H_E___U_N_K_N_O_W_N___S_E_E_D = 0
│ │ │ │ │ + uint64_t _b_r_a_h_e___l_c_m (const uint64_t x, const uint64_t y)
│ │ │ │ │ + Lowest common multiple.
│ │ │ │ │
│ │ │ │ │ + uint64_t _b_r_a_h_e___g_c_f (uint64_t x, uint64_t y)
│ │ │ │ │ + Greatest common factor (denominator)
│ │ │ │ │ +
│ │ │ │ │ + double _b_r_a_h_e___l_o_g_2_b_a_s_e (const double x, const double base)
│ │ │ │ │ + Logarithm to a specified base.
│ │ │ │ │ +
│ │ │ │ │ + int _b_r_a_h_e___s_i_z_e_p_o_w_2 (const int n)
│ │ │ │ │ + Smallest power of 2 that includes a given value.
│ │ │ │ │ +
│ │ │ │ │ + char * _b_r_a_h_e___p_r_e_t_t_y___i_n_t (int64_t n, _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t fmt)
│ │ │ │ │ + Turn a 64-bit integer into a pretty string.
│ │ │ │ │ +
│ │ │ │ │ +_b_r_a_h_e___s_t_a_t_i_s_t_i_c_s _b_r_a_h_e___g_e_t___s_t_a_t_i_s_t_i_c_s (double *data, size_t n)
│ │ │ │ │ + statistics for array of double
│ │ │ │ │ +
│ │ │ │ │ + double * _b_r_a_h_e___m_o_v_i_n_g___a_v_e_r_a_g_e (const double *data, const int n, const
│ │ │ │ │ + int distance)
│ │ │ │ │ + Moving average.
│ │ │ │ │ +
│ │ │ │ │ + double * _b_r_a_h_e___s_i_m_p_l_e___f_f_t (const double *data, const int n)
│ │ │ │ │ + Simple real-to-real fft (arbitrary length)
│ │ │ │ │ +
│ │ │ │ │ + double * _b_r_a_h_e___s_i_m_p_l_e___f_f_t_2 (const double *data, const int n)
│ │ │ │ │ + Simple real-to-real fft (power of 2 length)
│ │ │ │ │ +
│ │ │ │ │ + double * _b_r_a_h_e___m_a_k_e___s_i_n_u_s_o_i_d (const _b_r_a_h_e___w_a_v_e___f_a_c_t_o_r___t *factors,
│ │ │ │ │ + const size_t factor_n, const size_t array_n)
│ │ │ │ │ + Sine wave based artificial signal generator.
│ │ │ │ │ +
│ │ │ │ │ + void _b_r_a_h_e___a_d_d___n_o_i_s_e (double *a, const size_t n, double noise)
│ │ │ │ │ + Apply noise to a signal.
│ │ │ │ │ +
│ │ │ │ │ + double _b_r_a_h_e___a_s_i_n_h (const double x)
│ │ │ │ │ + Hyperbolic arcsine.
│ │ │ │ │ +
│ │ │ │ │ + double _b_r_a_h_e___a_c_o_s_h (const double x)
│ │ │ │ │ + Hyperbolic arccosine.
│ │ │ │ │ +
│ │ │ │ │ + double _b_r_a_h_e___a_t_a_n_h (const double x)
│ │ │ │ │ + Hyperbolic arctangent.
│ │ │ │ │ +
│ │ │ │ │ +********** MMaaccrroo DDeeffiinniittiioonn DDooccuummeennttaattiioonn **********
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__DDEEGG__PPEERR__RRAADD **********
│ │ │ │ │ +#define BRAHE_DEG_PER_RAD 57.2957795130823208767981548141
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__EE **********
│ │ │ │ │ +#define BRAHE_E 2.71828182845904523536028747135
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__EEUULLEERR **********
│ │ │ │ │ +#define BRAHE_EULER 0.57721566490153286060651209008
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__LLNN__1100 **********
│ │ │ │ │ +#define BRAHE_LN_10 2.30258509299404568401799145468
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__LLNN__22 **********
│ │ │ │ │ +#define BRAHE_LN_2 0.69314718055994530941723212146
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__LLNN__PPII **********
│ │ │ │ │ +#define BRAHE_LN_PI 1.14472988584940017414342735135
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__LLOOGG1100__EE **********
│ │ │ │ │ +#define BRAHE_LOG10_E 0.43429448190325182765112891892
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__LLOOGG22__EE **********
│ │ │ │ │ +#define BRAHE_LOG2_E 1.44269504088896340735992468100
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__LLOOGG__22 **********
│ │ │ │ │ +#define BRAHE_LOG_2 0.30102999566398119521373889472
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__OONNEE__DDIIVV__PPII **********
│ │ │ │ │ +#define BRAHE_ONE_DIV_PI 0.31830988618379067153776752675
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII **********
│ │ │ │ │ +#define BRAHE_PI 3.14159265358979323846264338328
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__1122 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_12 0.26179938779914943653855361527
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__1188 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_18 0.17453292519943295769236907685
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__22 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_2 1.57079632679489661923132169164
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__33 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_3 1.04719755119659774615421446109
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__3366 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_36 0.08726646259971647884618453842
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__44 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_4 0.78539816339744830961566084582
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__66 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_6 0.52359877559829887307710723055
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__PPII__DDIIVV__99 **********
│ │ │ │ │ +#define BRAHE_PI_DIV_9 0.34906585039886591538473815370
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__RRAADD__PPEERR__DDEEGG **********
│ │ │ │ │ +#define BRAHE_RAD_PER_DEG 0.01745329251994329576923690768
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__SSQQRRTT__22 **********
│ │ │ │ │ +#define BRAHE_SQRT_2 1.41421356237309504880168872421
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__SSQQRRTT__33 **********
│ │ │ │ │ +#define BRAHE_SQRT_3 1.73205080756887729352744634151
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__SSQQRRTT__HHAALLFF **********
│ │ │ │ │ +#define BRAHE_SQRT_HALF 0.70710678118654752440084436210
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__SSQQRRTT__PPII **********
│ │ │ │ │ +#define BRAHE_SQRT_PI 1.77245385090551602729816748334
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__TTAAUU **********
│ │ │ │ │ +#define BRAHE_TAU 6.28318530717958647692528676656
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__TTWWOO__DDIIVV__PPII **********
│ │ │ │ │ +#define BRAHE_TWO_DIV_PI 0.63661977236758134307553505349
│ │ │ │ │ +********** _?◆_? BBRRAAHHEE__TTWWOO__DDIIVV__SSQQRRTT__PPII **********
│ │ │ │ │ +#define BRAHE_TWO_DIV_SQRT_PI 1.12837916709551257389615890312
│ │ │ │ │ +********** TTyyppeeddeeff DDooccuummeennttaattiioonn **********
│ │ │ │ │ +********** _?◆_? bbrraahhee__pprreettttyy__ffoorrmmaatt **********
│ │ │ │ │ +typedef enum _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t___t _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t
│ │ │ │ │ +********** _?◆_? bbrraahhee__ssttaattiissttiiccss **********
│ │ │ │ │ +typedef struct _b_r_a_h_e___s_t_a_t_i_s_t_i_c_s___t _b_r_a_h_e___s_t_a_t_i_s_t_i_c_s
│ │ │ │ │ ********** EEnnuummeerraattiioonn TTyyppee DDooccuummeennttaattiioonn **********
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__ttyyppee__tt **********
│ │ │ │ │ -enum _b_r_a_h_e___p_r_n_g___t_y_p_e___t
│ │ │ │ │ +********** _?◆_? bbrraahhee__pprreettttyy__ffoorrmmaatt__tt **********
│ │ │ │ │ +enum _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t___t
│ │ │ │ │ EEnnuummeerraattoorr
│ │ │ │ │ -BRAHE_PRNG_MARSENNE_TWISTER Marsenne Twister (Matsumoto & Nishimura)
│ │ │ │ │ -BRAHE_PRNG_KISS Keep is Simple, Stupid (Marsaglia)
│ │ │ │ │ -BRAHE_PRNG_CMWC4096 CMWC4096 (Marsaglia)
│ │ │ │ │ -BRAHE_PRNG_MWC1038 MWC1038 (Marsaglia)
│ │ │ │ │ -BRAHE_PRNG_ISAAC Indirect, Shift, Accumulate, Add, and Count
│ │ │ │ │ - (Jenkins)
│ │ │ │ │ +BRAHE_PRETTY_TEXT english text (nine thousand, two hundred eleven)
│ │ │ │ │ +BRAHE_PRETTY_COMMA comma delimited, (1,234,567,890)
│ │ │ │ │ ********** FFuunnccttiioonn DDooccuummeennttaattiioonn **********
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__ffrreeee(()) **********
│ │ │ │ │ -void brahe_prng_free ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee )
│ │ │ │ │ -Frees the resources used by a PRNG
│ │ │ │ │ - Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - Returns
│ │ │ │ │ - ttrruuee if successful, ffaallssee if failed
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__iinnddeexx(()) **********
│ │ │ │ │ -size_t brahe_prng_index ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee,
│ │ │ │ │ - const size_t lleennggtthh
│ │ │ │ │ - )
│ │ │ │ │ -Returns the next value as a size_t "index" in the range [0,length).
│ │ │ │ │ +********** _?◆_? bbrraahhee__aaccoosshh(()) **********
│ │ │ │ │ +double brahe_acosh ( const double xx )
│ │ │ │ │ +Calculates cosh-1.
│ │ │ │ │ Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - length - Maximum value of result
│ │ │ │ │ + x a value
│ │ │ │ │ Returns
│ │ │ │ │ - A pseudorandom size_t value
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__iinniitt(()) **********
│ │ │ │ │ -bool brahe_prng_init ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee,
│ │ │ │ │ - const _b_r_a_h_e___p_r_n_g___t_y_p_e___t ttyyppee,
│ │ │ │ │ - const uint32_t sseeeedd
│ │ │ │ │ + inverse hyperbolic cosine of xx
│ │ │ │ │ +********** _?◆_? bbrraahhee__aadddd__nnooiissee(()) **********
│ │ │ │ │ +void brahe_add_noise ( double * aa,
│ │ │ │ │ + const size_t nn,
│ │ │ │ │ + double nnooiissee
│ │ │ │ │ )
│ │ │ │ │ -Initializes a psuedo-random number generator using a specified algorithm.
│ │ │ │ │ +Adds a percentage of noise to a signal. If "noise" is set to 0.1 (for example)
│ │ │ │ │ +each value will be adjust to between 90% and 110% of its original value. This
│ │ │ │ │ +function changes the existing values in the array.
│ │ │ │ │ + Parameters
│ │ │ │ │ + a array containing signal data
│ │ │ │ │ + n number of samples in signal
│ │ │ │ │ + noise percentage of noise
│ │ │ │ │ +********** _?◆_? bbrraahhee__aassiinnhh(()) **********
│ │ │ │ │ +double brahe_asinh ( const double xx )
│ │ │ │ │ +Calculates sinh-1.
│ │ │ │ │ Parameters
│ │ │ │ │ - prng_state Object to be initialized for a specific algorithm
│ │ │ │ │ - type Algorithm to be used for this PRNG
│ │ │ │ │ - seed Initialization seed
│ │ │ │ │ - Returns
│ │ │ │ │ - ttrruuee if successful, ffaallssee if failed
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__nneexxtt(()) **********
│ │ │ │ │ -uint32_t brahe_prng_next ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee )
│ │ │ │ │ -Returns the next uint32_t in sequence.
│ │ │ │ │ - Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - Returns
│ │ │ │ │ - A pseudorandom uint32_t value
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__rraannggee(()) **********
│ │ │ │ │ -uint32_t brahe_prng_range ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee,
│ │ │ │ │ - const uint32_t lloo,
│ │ │ │ │ - const uint32_t hhii
│ │ │ │ │ + x a value
│ │ │ │ │ + Returns
│ │ │ │ │ + inverse hyperbolic sine of xx
│ │ │ │ │ +********** _?◆_? bbrraahhee__aattaannhh(()) **********
│ │ │ │ │ +double brahe_atanh ( const double xx )
│ │ │ │ │ +Calculates tanh-1.
│ │ │ │ │ + Parameters
│ │ │ │ │ + x a value
│ │ │ │ │ + Returns
│ │ │ │ │ + inverse hyperbolic tangent of xx
│ │ │ │ │ +********** _?◆_? bbrraahhee__ggccff(()) **********
│ │ │ │ │ +uint64_t brahe_gcf ( uint64_t xx,
│ │ │ │ │ + uint64_t yy
│ │ │ │ │ + )
│ │ │ │ │ +Calculates the greatest common factor for two values.
│ │ │ │ │ + Parameters
│ │ │ │ │ + x first value
│ │ │ │ │ + y second value
│ │ │ │ │ + Returns
│ │ │ │ │ + The greatest common factor for xx and yy
│ │ │ │ │ +********** _?◆_? bbrraahhee__ggeett__ssttaattiissttiiccss(()) **********
│ │ │ │ │ +_b_r_a_h_e___s_t_a_t_i_s_t_i_c_s brahe_get_statistics ( double * ddaattaa,
│ │ │ │ │ + size_t nn
│ │ │ │ │ + )
│ │ │ │ │ +Calculate several common statistics for an array of doubles.
│ │ │ │ │ + Parameters
│ │ │ │ │ + data array of double values
│ │ │ │ │ + n number of elements in data
│ │ │ │ │ + Returns
│ │ │ │ │ + statistics for data
│ │ │ │ │ +********** _?◆_? bbrraahhee__llccmm(()) **********
│ │ │ │ │ +uint64_t brahe_lcm ( const uint64_t xx,
│ │ │ │ │ + const uint64_t yy
│ │ │ │ │ + )
│ │ │ │ │ +Calculates the lowest common multiple for two values.
│ │ │ │ │ + Parameters
│ │ │ │ │ + x first value
│ │ │ │ │ + y second value
│ │ │ │ │ + Returns
│ │ │ │ │ + The lowest common multiple for xx and yy
│ │ │ │ │ +********** _?◆_? bbrraahhee__lloogg22bbaassee(()) **********
│ │ │ │ │ +double brahe_log2base ( const double xx,
│ │ │ │ │ + const double bbaassee
│ │ │ │ │ + )
│ │ │ │ │ +Calculates the base-n logarithm for a given value. If a range error occurs, the
│ │ │ │ │ +return value equals NaN.
│ │ │ │ │ + Parameters
│ │ │ │ │ + x value for which logarithm is required
│ │ │ │ │ + base lagarithm base
│ │ │ │ │ + Returns
│ │ │ │ │ + logarithm of xx to base bbaassee; NAN on range error
│ │ │ │ │ +********** _?◆_? bbrraahhee__mmaakkee__ssiinnuussooiidd(()) **********
│ │ │ │ │ +double * brahe_make_sinusoid ( const _b_r_a_h_e___w_a_v_e___f_a_c_t_o_r___t * ffaaccttoorrss,
│ │ │ │ │ + const size_t ffaaccttoorr__nn,
│ │ │ │ │ + const size_t aarrrraayy__nn
│ │ │ │ │ + )
│ │ │ │ │ +Generates an array of doubles by combining sine waves. The primary purpose is
│ │ │ │ │ +to produce an artificial signal with known properties, for testing signal
│ │ │ │ │ +analysis applications. The caller is responsible for freeing the memory used by
│ │ │ │ │ +the array returned by this function.
│ │ │ │ │ + Parameters
│ │ │ │ │ + factors defines properties of the sine waves to be combined
│ │ │ │ │ + factor_n number of elements in factors
│ │ │ │ │ + array_n number of elements in the output array
│ │ │ │ │ + Returns
│ │ │ │ │ + an allocated array containg values generated from the given factors
│ │ │ │ │ +********** _?◆_? bbrraahhee__mmoovviinngg__aavveerraaggee(()) **********
│ │ │ │ │ +double * brahe_moving_average ( const double * ddaattaa,
│ │ │ │ │ + const int nn,
│ │ │ │ │ + const int ddiissttaannccee
│ │ │ │ │ + )
│ │ │ │ │ +Computes the moving average for an array. The returned buffer must be freed by
│ │ │ │ │ +the calling code.
│ │ │ │ │ + Parameters
│ │ │ │ │ + data array of double values to be averaged
│ │ │ │ │ + n number of elements in data
│ │ │ │ │ + distance number elements to average before and after an element in ddaattaa
│ │ │ │ │ + Returns
│ │ │ │ │ + an allocated nn-length array containing the moving average of
│ │ │ │ │ + corresponding elements in ddaattaa
│ │ │ │ │ +********** _?◆_? bbrraahhee__pprreettttyy__iinntt(()) **********
│ │ │ │ │ +char * brahe_pretty_int ( int64_t nn,
│ │ │ │ │ + _b_r_a_h_e___p_r_e_t_t_y___f_o_r_m_a_t ffmmtt
│ │ │ │ │ + )
│ │ │ │ │ +Returns a nicely formatted strong for a given 64-bit integer.
│ │ │ │ │ + Parameters
│ │ │ │ │ + n number to be formatted
│ │ │ │ │ + fmt specifies format, as text or comma-delimited
│ │ │ │ │ + Returns
│ │ │ │ │ + an allocated string containing the generated text
│ │ │ │ │ +********** _?◆_? bbrraahhee__rroouunndd__nneeaarreesstt(()) **********
│ │ │ │ │ +double brahe_round_nearest ( const double xx )
│ │ │ │ │ +Rounds a value to nearest integer, rounding to even for exact fractions of 0.5.
│ │ │ │ │ +********** _?◆_? bbrraahhee__ssiiggddiigg(()) **********
│ │ │ │ │ +double brahe_sigdig ( const double xx,
│ │ │ │ │ + const uint16_t nn
│ │ │ │ │ + )
│ │ │ │ │ +Returns the given value rounded for the number of specified decimal digits of
│ │ │ │ │ +precision.
│ │ │ │ │ + Parameters
│ │ │ │ │ + x - Original value to be rounded
│ │ │ │ │ + n - Number of significant digits
│ │ │ │ │ + Returns
│ │ │ │ │ + The value xx rounded to nn digits of precision
│ │ │ │ │ +********** _?◆_? bbrraahhee__ssiimmppllee__fffftt(()) **********
│ │ │ │ │ +double * brahe_simple_fft ( const double * ddaattaa,
│ │ │ │ │ + const int nn
│ │ │ │ │ )
│ │ │ │ │ -Returns the next int_value between lo and hi, inclusive.
│ │ │ │ │ +A simple real-to-real FFT for arbitrary-length data. This is not intended to
│ │ │ │ │ +replace dedicated libraries such as FFTW. The caller is responsible for freeing
│ │ │ │ │ +the memory used by the array returned by this function. /param data input array
│ │ │ │ │ +/param n length of data /return an allocated array containing the real FFT of
│ │ │ │ │ +data
│ │ │ │ │ +********** _?◆_? bbrraahhee__ssiimmppllee__fffftt22(()) **********
│ │ │ │ │ +double * brahe_simple_fft2 ( const double * ddaattaa,
│ │ │ │ │ + const int nn
│ │ │ │ │ + )
│ │ │ │ │ +A simple real-to-real FFT for power of 2-length data. This is not intended to
│ │ │ │ │ +replace dedicated libraries such as FFTW. The caller is responsible for freeing
│ │ │ │ │ +the memory used by the array returned by this function. /param data input array
│ │ │ │ │ +/param n length of data /return an allocated array containing the real FFT of
│ │ │ │ │ +data
│ │ │ │ │ +********** _?◆_? bbrraahhee__ssiizzeeppooww22(()) **********
│ │ │ │ │ +int brahe_sizepow2 ( const int nn )
│ │ │ │ │ +Returns the smallest power of 2 that includes n in its range
│ │ │ │ │ Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - lo - Minimum value of result
│ │ │ │ │ - hi - Maximum value of result
│ │ │ │ │ - Returns
│ │ │ │ │ - A pseudorandom uint32_t value
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__rreeaall11(()) **********
│ │ │ │ │ -double brahe_prng_real1 ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee )
│ │ │ │ │ -Returns the next real number in the range [0,1], i.e., a number greater than or
│ │ │ │ │ -equal to 0 and less than or equal to 1. Provides 32-bit precision.
│ │ │ │ │ - Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - Returns
│ │ │ │ │ - A pseudorandom double value
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__rreeaall22(()) **********
│ │ │ │ │ -double brahe_prng_real2 ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee )
│ │ │ │ │ -Returns the next real number in the range [0,1), i.e., a number greater than or
│ │ │ │ │ -equal to 0 and less than 1. Provides 32-bit precision.
│ │ │ │ │ - Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - Returns
│ │ │ │ │ - A pseudorandom double value
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__rreeaall33(()) **********
│ │ │ │ │ -double brahe_prng_real3 ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee )
│ │ │ │ │ -Returns the next real number in the range (0,1), i.e., a number greater than 0
│ │ │ │ │ -and less than 1. Provides 32-bit precision.
│ │ │ │ │ - Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - Returns
│ │ │ │ │ - A pseudorandom double value
│ │ │ │ │ -********** _?◆_? bbrraahhee__pprrnngg__rreeaall5533(()) **********
│ │ │ │ │ -double brahe_prng_real53 ( _b_r_a_h_e___p_r_n_g___s_t_a_t_e___t * pprrnngg__ssttaattee )
│ │ │ │ │ -Returns the next real number in the range [0,1), i.e., a number greater than or
│ │ │ │ │ -equal to 0 and less than 1. Provides 53-bit precision.
│ │ │ │ │ - Parameters
│ │ │ │ │ - prng_state Object containing the state of a PRNG
│ │ │ │ │ - Returns
│ │ │ │ │ - A pseudorandom double value
│ │ │ │ │ -********** VVaarriiaabbllee DDooccuummeennttaattiioonn **********
│ │ │ │ │ -********** _?◆_? BBRRAAHHEE__UUNNKKNNOOWWNN__SSEEEEDD **********
│ │ │ │ │ -uint32_t BRAHE_UNKNOWN_SEED = 0 static
│ │ │ │ │ + n number that must be less than the result
│ │ │ │ │ + Returns
│ │ │ │ │ + the lowest power of 2 that is greater than nn, or
│ │ │ │ │ ===============================================================================
│ │ │ │ │ © 2011 Scott Robert Ladd. All rights reserved.
│ │ │ │ │ HTML documentation generated by Dimitri van Heesch's excellent _D_o_x_y_g_e_n tool.
│ │ │ ├── ./usr/share/doc/libbrahe-dev/html/a00005_source.html
│ │ │ │ @@ -17,15 +17,15 @@
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
Go to the documentation of this file.
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ @@ -72,108 +72,246 @@
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
53#if !defined(LIBBRAHE_PRNG_H)
│ │ │ │ -
54#define LIBBRAHE_PRNG_H
│ │ │ │ +
53#if !defined(LIBBRAHE_MATHTOOLS_H)
│ │ │ │ +
54#define LIBBRAHE_MATHTOOLS_H
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
58#if defined(__cplusplus)
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
61#if defined(__cplusplus)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
66#pragma warning (disable: 4244 4267 4996)
│ │ │ │ +
67#if !defined(__cplusplus)
│ │ │ │ +
│ │ │ │ +
69static const int true = 1;
│ │ │ │ +
70static const int false = 0;
│ │ │ │ +
│ │ │ │ +
72typedef unsigned __int64 uint64_t;
│ │ │ │ +
73typedef __int64 int64_t;
│ │ │ │ +
74typedef unsigned __int32 uint32_t;
│ │ │ │ +
75typedef __int32 int32_t;
│ │ │ │ +
76typedef unsigned __int16 uint16_t;
│ │ │ │ +
77typedef __int16 int16_t;
│ │ │ │ +
78typedef unsigned __int8 uint8_t;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
177#if defined(__cplusplus)
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
size_t brahe_prng_index(brahe_prng_state_t *prng_state, const size_t length)
Get the next random value as a size_t index.
│ │ │ │ -
static uint32_t BRAHE_UNKNOWN_SEED
Definition prng.h:90
│ │ │ │ -
double brahe_prng_real2(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
│ │ │ │ -
uint32_t brahe_prng_range(brahe_prng_state_t *prng_state, const uint32_t lo, const uint32_t hi)
Get the next integer in the range [lo,hi].
│ │ │ │ -
bool brahe_prng_init(brahe_prng_state_t *prng_state, const brahe_prng_type_t type, const uint32_t seed)
Initialize a psuedo-random number generator (PRNG)
│ │ │ │ -
void brahe_prng_free(brahe_prng_state_t *prng_state)
Free resources used by PRNG.
│ │ │ │ -
double brahe_prng_real1(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1].
│ │ │ │ -
brahe_prng_type_t
Defines types of prngs.
Definition prng.h:64
│ │ │ │ -
@ BRAHE_PRNG_ISAAC
Indirect, Shift, Accumulate, Add, and Count (Jenkins)
Definition prng.h:74
│ │ │ │ -
@ BRAHE_PRNG_MARSENNE_TWISTER
Marsenne Twister (Matsumoto & Nishimura)
Definition prng.h:66
│ │ │ │ -
@ BRAHE_PRNG_MWC1038
MWC1038 (Marsaglia)
Definition prng.h:72
│ │ │ │ -
@ BRAHE_PRNG_CMWC4096
CMWC4096 (Marsaglia)
Definition prng.h:70
│ │ │ │ -
@ BRAHE_PRNG_KISS
Keep is Simple, Stupid (Marsaglia)
Definition prng.h:68
│ │ │ │ -
uint32_t brahe_prng_next(brahe_prng_state_t *prng_state)
Get the next integer.
│ │ │ │ -
double brahe_prng_real53(brahe_prng_state_t *prng_state)
Get the next number in the range [0,1)
│ │ │ │ -
double brahe_prng_real3(brahe_prng_state_t *prng_state)
Get the next number in the range (0,1)
│ │ │ │ -
Contains state variables for a PRNG.
Definition prng.h:79
│ │ │ │ -
void * m_data2
Definition prng.h:83
│ │ │ │ -
size_t m_b
Definition prng.h:86
│ │ │ │ -
void * m_data1
Definition prng.h:82
│ │ │ │ -
size_t m_i
Definition prng.h:84
│ │ │ │ -
size_t m_a
Definition prng.h:85
│ │ │ │ -
size_t m_c
Definition prng.h:87
│ │ │ │ -
brahe_prng_type_t m_type
Definition prng.h:80
│ │ │ │ -
uint32_t m_seed
Definition prng.h:81
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
308#define BRAHE_E 2.71828182845904523536028747135
│ │ │ │ +
│ │ │ │ +
311#define BRAHE_LOG2_E 1.44269504088896340735992468100
│ │ │ │ +
│ │ │ │ +
314#define BRAHE_LOG10_E 0.43429448190325182765112891892
│ │ │ │ +
│ │ │ │ +
317#define BRAHE_SQRT_2 1.41421356237309504880168872421
│ │ │ │ +
│ │ │ │ +
320#define BRAHE_SQRT_HALF 0.70710678118654752440084436210
│ │ │ │ +
│ │ │ │ +
323#define BRAHE_SQRT_3 1.73205080756887729352744634151
│ │ │ │ +
│ │ │ │ +
326#define BRAHE_PI 3.14159265358979323846264338328
│ │ │ │ +
│ │ │ │ +
329#define BRAHE_TAU 6.28318530717958647692528676656
│ │ │ │ +
│ │ │ │ +
332#define BRAHE_PI_DIV_2 1.57079632679489661923132169164
│ │ │ │ +
│ │ │ │ +
335#define BRAHE_PI_DIV_3 1.04719755119659774615421446109
│ │ │ │ +
│ │ │ │ +
338#define BRAHE_PI_DIV_4 0.78539816339744830961566084582
│ │ │ │ +
│ │ │ │ +
341#define BRAHE_PI_DIV_6 0.52359877559829887307710723055
│ │ │ │ +
│ │ │ │ +
344#define BRAHE_PI_DIV_9 0.34906585039886591538473815370
│ │ │ │ +
│ │ │ │ +
347#define BRAHE_PI_DIV_12 0.26179938779914943653855361527
│ │ │ │ +
│ │ │ │ +
350#define BRAHE_PI_DIV_18 0.17453292519943295769236907685
│ │ │ │ +
│ │ │ │ +
353#define BRAHE_PI_DIV_36 0.08726646259971647884618453842
│ │ │ │ +
│ │ │ │ +
356#define BRAHE_DEG_PER_RAD 57.2957795130823208767981548141
│ │ │ │ +
│ │ │ │ +
359#define BRAHE_RAD_PER_DEG 0.01745329251994329576923690768
│ │ │ │ +
│ │ │ │ +
362#define BRAHE_SQRT_PI 1.77245385090551602729816748334
│ │ │ │ +
│ │ │ │ +
365#define BRAHE_TWO_DIV_SQRT_PI 1.12837916709551257389615890312
│ │ │ │ +
│ │ │ │ +
368#define BRAHE_ONE_DIV_PI 0.31830988618379067153776752675
│ │ │ │ +
│ │ │ │ +
371#define BRAHE_TWO_DIV_PI 0.63661977236758134307553505349
│ │ │ │ +
│ │ │ │ +
374#define BRAHE_LN_10 2.30258509299404568401799145468
│ │ │ │ +
│ │ │ │ +
377#define BRAHE_LN_2 0.69314718055994530941723212146
│ │ │ │ +
│ │ │ │ +
380#define BRAHE_LOG_2 0.30102999566398119521373889472
│ │ │ │ +
│ │ │ │ +
383#define BRAHE_LN_PI 1.14472988584940017414342735135
│ │ │ │ +
│ │ │ │ +
386#define BRAHE_EULER 0.57721566490153286060651209008
│ │ │ │ +
│ │ │ │ +
388#if defined(__cplusplus)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
double brahe_log2base(const double x, const double base)
Logarithm to a specified base.
│ │ │ │ +
double brahe_round_nearest(const double x)
Round to nearest value.
│ │ │ │ +
brahe_pretty_format_t
Formats for pretty-printing integers.
Definition mathtools.h:156
│ │ │ │ +
@ BRAHE_PRETTY_COMMA
comma delimited, (1,234,567,890)
Definition mathtools.h:160
│ │ │ │ +
@ BRAHE_PRETTY_TEXT
english text (nine thousand, two hundred eleven)
Definition mathtools.h:158
│ │ │ │ +
char * brahe_pretty_int(int64_t n, brahe_pretty_format fmt)
Turn a 64-bit integer into a pretty string.
│ │ │ │ +
double * brahe_moving_average(const double *data, const int n, const int distance)
Moving average.
│ │ │ │ +
int brahe_sizepow2(const int n)
Smallest power of 2 that includes a given value.
│ │ │ │ +
uint64_t brahe_lcm(const uint64_t x, const uint64_t y)
Lowest common multiple.
│ │ │ │ +
double * brahe_simple_fft2(const double *data, const int n)
Simple real-to-real fft (power of 2 length)
│ │ │ │ +
double brahe_sigdig(const double x, const uint16_t n)
Set number of significant digits in a floating-point value.
│ │ │ │ +
double brahe_asinh(const double x)
Hyperbolic arcsine.
│ │ │ │ +
double brahe_acosh(const double x)
Hyperbolic arccosine.
│ │ │ │ +
struct brahe_statistics_t brahe_statistics
Structure containing statistical values calculate from a double array.
│ │ │ │ +
double brahe_atanh(const double x)
Hyperbolic arctangent.
│ │ │ │ +
double * brahe_simple_fft(const double *data, const int n)
Simple real-to-real fft (arbitrary length)
│ │ │ │ +
brahe_statistics brahe_get_statistics(double *data, size_t n)
statistics for array of double
│ │ │ │ +
enum brahe_pretty_format_t brahe_pretty_format
Formats for pretty-printing integers.
│ │ │ │ +
double * brahe_make_sinusoid(const brahe_wave_factor_t *factors, const size_t factor_n, const size_t array_n)
Sine wave based artificial signal generator.
│ │ │ │ +
uint64_t brahe_gcf(uint64_t x, uint64_t y)
Greatest common factor (denominator)
│ │ │ │ +
void brahe_add_noise(double *a, const size_t n, double noise)
Apply noise to a signal.
│ │ │ │ +
Structure containing statistical values calculate from a double array.
Definition mathtools.h:179
│ │ │ │ +
double min
minimum value from array
Definition mathtools.h:181
│ │ │ │ +
double mean
mean (average)
Definition mathtools.h:185
│ │ │ │ +
double variance
variance
Definition mathtools.h:187
│ │ │ │ +
double max
maximum value
Definition mathtools.h:183
│ │ │ │ +
double sigma
standard deviation
Definition mathtools.h:189
│ │ │ │ +
Sine wave definition.
Definition mathtools.h:244
│ │ │ │ +
double amplitude
arbitrary wave amplitude
Definition mathtools.h:248
│ │ │ │ +
double wavelength
wavelength
Definition mathtools.h:246
│ │ │ │
│ │ │ │