MythTV  master
pink.h
Go to the documentation of this file.
1 #ifndef AUDIOPINK
2 #define AUDIOPINK
3 
4 #include <array>
5 #include "libmyth/mythexp.h"
6 
7 #define PINK_DEFAULT_ROWS (12)
8 #define PINK_MAX_RANDOM_ROWS (32)
9 #define PINK_RANDOM_BITS (24)
10 #define PINK_RANDOM_SHIFT ((sizeof(int32_t)*8)-PINK_RANDOM_BITS)
11 
13 {
14  std::array<int32_t,PINK_MAX_RANDOM_ROWS> pink_rows;
15  int32_t pink_running_sum; /* Used to optimize summing of generators. */
16  int32_t pink_index; /* Incremented each sample. */
17  int32_t pink_index_mask; /* Index wrapped by ANDing with this mask. */
18  float pink_scalar; /* Used to scale within range of -1.0 to +1.0 */
19 };
20 
21 MPUBLIC void initialize_pink_noise( pink_noise_t *pink, int num_rows = PINK_DEFAULT_ROWS);
23 
24 #endif
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
generate_pink_noise_sample
MPUBLIC float generate_pink_noise_sample(pink_noise_t *pink)
Definition: pink.cpp:56
initialize_pink_noise
MPUBLIC void initialize_pink_noise(pink_noise_t *pink, int num_rows=PINK_DEFAULT_ROWS)
Definition: pink.cpp:41
mythexp.h
pink_noise_t::pink_index_mask
int32_t pink_index_mask
Definition: pink.h:17
pink_noise_t::pink_running_sum
int32_t pink_running_sum
Definition: pink.h:15
pink_noise_t::pink_index
int32_t pink_index
Definition: pink.h:16
pink_noise_t::pink_scalar
float pink_scalar
Definition: pink.h:18
pink_noise_t
Definition: pink.h:12
PINK_DEFAULT_ROWS
#define PINK_DEFAULT_ROWS
Definition: pink.h:7
pink_noise_t::pink_rows
std::array< int32_t, PINK_MAX_RANDOM_ROWS > pink_rows
Definition: pink.h:14