File containing functions necessary to filter data. More...
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <curses.h>
#include "postprocess.h"
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) |
File containing functions necessary to filter data.
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().
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().
void gsl_filter_data | ( | double | data[], |
int | num_frames, | ||
int | num_dominant_freq | ||
) |
References get_fourier_dominant_estimate(), and gsl_get_fourier_coeffs().
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.
[in] | data[] | 1d array containing the data to be filtered. |
Referenced by gsl_filter_data(), and gsl_low_pass_filter_data().
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().
void gsl_low_pass_fourier | ( | double | data[], |
gsl_vector * | f_data, | ||
int | num_freq | ||
) |
References gsl_vector2double().
Referenced by gsl_low_pass_filter_data().