Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00078 #ifndef WAVELET_H
00079 # define WAVELET_H
00080
00081 #include "definitions.h"
00082 #include <gsl/gsl_wavelet.h>
00083
00084 #include <gsl/gsl_rng.h>
00085 #include <gsl/gsl_randist.h>
00086
00087 #include "eeg.h"
00088
00089 #ifdef __cplusplus
00090 extern "C" {
00091 #endif
00092
00093
00094
00099 typedef double (*ThresholdSelectionFunction) (const double*,int);
00104 typedef double (*ThresholdFunction) (double,double);
00109 typedef double* (*SignalExtensionFunction) (double*,int,int);
00110
00115 typedef struct {
00116 int first_thresholding_level;
00117 gsl_wavelet_type *wavelet;
00118 int vanishing_moments;
00119 ThresholdSelectionFunction threshselfct;
00120 ThresholdFunction threshfct;
00121 SignalExtensionFunction sigextfct;
00122 } WaveletParameters;
00123
00124
00125
00126
00127 double soft_thresholding( double d, double lambda );
00128 double hard_thresholding( double d, double lambda );
00129
00130 double translation_invariant_thresholding( const double *data, int n );
00131 double conventional_thresholding ( const double *data, int n );
00132 double sureshrink ( const double *data, int n );
00133 double heuristic_sure ( const double *data, int n );
00134
00135 WaveletParameters wavelet_init();
00136 int wavelet_denoise ( double *data, int n, WaveletParameters P );
00137 int wavelet_extend_and_denoise( double *data, int n, WaveletParameters P );
00138 EEG* eeg_wavelet_denoise ( EEG *eeg, WaveletParameters P, bool alloc );
00139
00140 #ifdef __cplusplus
00141 }
00142 #endif
00143 #endif