filter_data.cpp File Reference

File containing functions necessary to filter data. More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <curses.h>
#include "postprocess.h"
Include dependency graph for filter_data.cpp:

Functions

void extract_data_point (vector< vector< double > > &datapoints, int variable_id, double data[])
 Extract single column of data from from 2d vector of datapoints.
int gsl_get_fourier_coeffs (double data[], gsl_vector *f_data, int num_frames, gsl_fft_real_wavetable *real, gsl_fft_real_workspace *work)
 Return a gsl_vector containing complex coeffs obtained from the Fourier transform.
int get_fourier_dominant_estimate (double data[], gsl_vector *f_data, int num_dominant_freq)
 Get the first k dominant frequencies in Fourier representation, and set all others to zero.
void gsl_filter_data (double data[], int num_frames, int num_dominant_freq)
void gsl_low_pass_fourier (double data[], gsl_vector *f_data, int num_freq)
void gsl_low_pass_filter_data (double data[], int num_frames, int num_freq)

Detailed Description

File containing functions necessary to filter data.


Function Documentation

void extract_data_point ( vector< vector< double > > &  datapoints,
int  variable_id,
double  data[] 
)

Extract single column of data from from 2d vector of datapoints.

The input 2d vector datapoints contains data for n variables, over num_frame number of frames. datapoints[j][i] contains the value of i^th variable for frame j. This functions copies all values in datapoints[*][i] for given i into a array of doubles.

Referenced by filter_accl(), filter_sync_passive_active(), main(), and opti_first_extrema().

Here is the caller graph for this function:

int get_fourier_dominant_estimate ( double  data[],
gsl_vector *  f_data,
int  num_dominant_freq 
)

Get the first k dominant frequencies in Fourier representation, and set all others to zero.

This function takes the fourier representation obtained from gsl_get_fourier_coeffs function, identifies the top k dominant frequencies (k specified as input), and sets all others to zero. Thus, the function ignores all contributions from all non-dominant frequencies.

References gsl_vector2double().

Referenced by gsl_filter_data().

Here is the call graph for this function:

Here is the caller graph for this function:

void gsl_filter_data ( double  data[],
int  num_frames,
int  num_dominant_freq 
)

References get_fourier_dominant_estimate(), and gsl_get_fourier_coeffs().

Here is the call graph for this function:

int gsl_get_fourier_coeffs ( double  data[],
gsl_vector *  f_data,
int  num_frames,
gsl_fft_real_wavetable *  real,
gsl_fft_real_workspace *  work 
)

Return a gsl_vector containing complex coeffs obtained from the Fourier transform.

Parameters:
[in]data[]1d array containing the data to be filtered.
Returns:
Gsl_vector of size 2*num_frames with 2*i'th element containing real part of i'th Fourier coefficient, and 2*i+1'th element containing imaginary part of the i'th coefficient.

Referenced by gsl_filter_data(), and gsl_low_pass_filter_data().

Here is the caller graph for this function:

void gsl_low_pass_filter_data ( double  data[],
int  num_frames,
int  num_freq 
)

References gsl_get_fourier_coeffs(), and gsl_low_pass_fourier().

Referenced by filter_accl(), filter_sync_passive_active(), main(), and opti_first_extrema().

Here is the call graph for this function:

Here is the caller graph for this function:

void gsl_low_pass_fourier ( double  data[],
gsl_vector *  f_data,
int  num_freq 
)

References gsl_vector2double().

Referenced by gsl_low_pass_filter_data().

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Defines