#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <gsl/gsl_sort.h>
#include <gsl/gsl_statistics.h>
#include "dglitch.h"
Go to the source code of this file.
Data Structures | |
struct | ts_dglitch |
Private members of dglitch object. More... | |
Defines | |
#define | DG_STRIDE (size_t)1 |
#define | DEBUG_DEGLITCH(a) |
Functions | |
static void | dg_push (p_dglitch dg, double num) |
static void | dg_sort (double *vector, uint32_t size) |
static int32_t | dg_compare (const void *val1, const void *val2) |
p_dglitch | dglitch_create (te_dglitch_type type, uint32_t window_size) |
void | dglitch_apply (p_dglitch dg, double *data, uint32_t size) |
void | dglitch_destroy (p_dglitch *dg) |
#define DEBUG_DEGLITCH | ( | a | ) |
#define DG_STRIDE (size_t)1 |
static int32_t dg_compare | ( | const void * | val1, | |
const void * | val2 | |||
) | [static] |
static void dg_push | ( | p_dglitch | dg, | |
double | num | |||
) | [static] |
Push new number onto de-glitcher stack
dg | Pointer to deglitch object. | |
num | Number to push onto stack. |
Definition at line 154 of file dglitch.c.
References ts_dglitch::stack, and ts_dglitch::window_size.
Referenced by dglitch_apply().
static void dg_sort | ( | double * | vector, | |
uint32_t | size | |||
) | [static] |
Temporary.
Definition at line 121 of file dglitch.c.
References dg_compare().
Referenced by dglitch_apply().
void dglitch_apply | ( | p_dglitch | dg, | |
double * | data, | |||
uint32_t | size | |||
) |
Apply the deglitch algorith to the data.
dg | Pointer to the deglitch object. | |
data | Pointer to the data to be deglitched. | |
size | Number of data points in data. |
Definition at line 101 of file dglitch.c.
References DEBUG_DEGLITCH, dg_push(), dg_sort(), DG_STRIDE, ts_dglitch::sorted_stack, ts_dglitch::stack, and ts_dglitch::window_size.
Referenced by morse_code().
p_dglitch dglitch_create | ( | te_dglitch_type | type, | |
uint32_t | window_size | |||
) |
Creates a deglitch object.
type | Type of DeGlitch object to create. |
window_size | Number of consecutive samples used to compute one deglitched value. |
Definition at line 78 of file dglitch.c.
References ts_dglitch::sorted_stack, ts_dglitch::stack, and ts_dglitch::window_size.
Referenced by morse_start_threads().
void dglitch_destroy | ( | p_dglitch * | dg | ) |
Destroys, and frees all memory from a deglitch object.
dg | Pointer to the deglitch object to be freed. |
Definition at line 144 of file dglitch.c.
Referenced by free_all().