bpmrf/rf_filter.c

Go to the documentation of this file.
00001 
00005 #include <bpm/bpm_interface.h>
00006 #include <bpm/bpm_rf.h>
00007 
00018 int rf_filter( double **RF, enum rffiltertype_t filttype, int nfiltpar, double *pars ) {
00019 
00020 
00021   if ( ! RF ) {
00022     bpm_error( "Invalid RF pointer in rf_filter(...)",
00023                __FILE__, __LINE__ );
00024     return BPM_FAILURE;
00025   }
00026 
00027   // Call the approriate filter function
00028   switch (filttype) {
00029     
00030   case nofilter:
00031     // No filter selected
00032     break;
00033 
00034   case butterworth_low_pass:
00035     // Low pass butterworth
00036     if ( nfiltpar != 2 ) {
00037       bpm_error( "Incorrect number of parameters given for a butterworth low pass filter",
00038                  __FILE__, __LINE__ );
00039     }
00040 
00041     rf_butterworthlowpass( RF, (int)pars[0], pars[1] );
00042     break;
00043 
00044   case butterworth_band_pass:
00045     // band pass butterworth
00046         if ( nfiltpar != 3 ) {
00047       bpm_error( "Incorrect number of parameters given for a butterworth low pass filter",
00048                  __FILE__, __LINE__ );
00049     }
00050 
00051     rf_butterworthbandpass( RF, (int)pars[0], pars[1], pars[2] );
00052     break;
00053 
00054   case butterworth_high_pass:
00055     // high pass butterworth
00056         if ( nfiltpar != 2 ) {
00057       bpm_error( "Incorrect number of parameters given for a butterworth high pass filter",
00058                  __FILE__, __LINE__ );
00059     }
00060 
00061     rf_butterworthhighpass( RF, (int)pars[0], pars[1] );
00062     break;
00063   }
00064 
00065   return BPM_SUCCESS;
00066 }
00067 // end of file

Generated on Fri Nov 9 21:17:11 2007 for libbpm by  doxygen 1.5.1