dglitch.c File Reference

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <gsl/gsl_sort.h>
#include <gsl/gsl_statistics.h>
#include "dglitch.h"

Include dependency graph for dglitch.c:

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 Documentation

#define DEBUG_DEGLITCH (  ) 

Definition at line 51 of file dglitch.c.

Referenced by dglitch_apply().

#define DG_STRIDE   (size_t)1

Definition at line 49 of file dglitch.c.

Referenced by dglitch_apply().


Function Documentation

static int32_t dg_compare ( const void *  val1,
const void *  val2 
) [static]

Temporary.

Definition at line 126 of file dglitch.c.

Referenced by dg_sort().

static void dg_push ( p_dglitch  dg,
double  num 
) [static]

Push new number onto de-glitcher stack

Parameters:
dg Pointer to deglitch object.
num Number to push onto stack.
Todo:
Should be implemented in double Z fir fashion.

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().

Here is the call graph for this function:

void dglitch_apply ( p_dglitch  dg,
double *  data,
uint32_t  size 
)

Apply the deglitch algorith to the data.

Parameters:
dg Pointer to the deglitch object.
data Pointer to the data to be deglitched.
size Number of data points in data.

Todo:
Problem HERE, gsl_sort freezes! This is a workaround.

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().

Here is the call graph for this function:

p_dglitch dglitch_create ( te_dglitch_type  type,
uint32_t  window_size 
)

Creates a deglitch object.

Parameters:
type Type of DeGlitch object to create.
See also:
te_dglitch_type
Parameters:
window_size Number of consecutive samples used to compute one deglitched value.
Returns:
Pointer to the created deglitch object.

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.

Parameters:
dg Pointer to the deglitch object to be freed.

Definition at line 144 of file dglitch.c.

Referenced by free_all().


Generated on Mon Jun 22 21:39:02 2009 for morse2txt by  doxygen 1.5.6