• API Main Page
  • Documentation
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

src/wavelet.h

Go to the documentation of this file.
00001 /* **************************************************************************
00002  *   Copyright (C) 2008 by Matthias Ihrke   *
00003  *   mihrke@uni-goettingen.de   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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      - Function Pointers
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       -- Wavelet-based Denoising routines                                       -- 
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 /* - WAVELET_H - */

Generated on Fri Jun 25 2010 14:10:22 for libeegtools by  doxygen 1.7.0