PortAudio
2.0
|
Tests the dither scaling and conversion accuracy in pa_converters.c. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "portaudio.h"
#include "pa_converters.h"
#include "pa_dither.h"
#include "pa_types.h"
#include "pa_endianness.h"
#include "paqa_macros.h"
Macros | |
#define | PAQA_SHOW_CHARTS 0 |
#define | NUM_BINS 32 |
#define | NUM_SAMPLES 1024 |
#define | LINEARITY_NUM_STEPS 41 |
Functions | |
int | ShowDitherDistribution (void) |
double | CalculateRSquared (double *xa, double *ya, int numPoints) |
void | linearRegression (double *xa, double *ya, int numPoints, double *a, double *b) |
int | TestAllDitherScaling (void) |
int | TestAllDitherClipping (void) |
int | main (int argc, const char **argv) |
Tests the dither scaling and conversion accuracy in pa_converters.c.
Link with pa_dither.c and pa_converters.c
#define LINEARITY_NUM_STEPS 41 |
#define NUM_BINS 32 |
Referenced by ShowDitherDistribution().
#define NUM_SAMPLES 1024 |
#define PAQA_SHOW_CHARTS 0 |
double CalculateRSquared | ( | double * | xa, |
double * | ya, | ||
int | numPoints | ||
) |
Calculate the Coefficient of Determination, "R-squared". You want a value as close to 1.0 as possible.
void linearRegression | ( | double * | xa, |
double * | ya, | ||
int | numPoints, | ||
double * | a, | ||
double * | b | ||
) |
int main | ( | int | argc, |
const char ** | argv | ||
) |
int ShowDitherDistribution | ( | void | ) |
Show a histogram of the dither values.
References NUM_BINS, PaUtil_Generate16BitTriangularDither(), and PaUtil_InitializeTriangularDitherState().
Referenced by main().
int TestAllDitherClipping | ( | void | ) |